Changes

Jump to: navigation, search

Addons development

2,131 bytes added, 02:55, 1 October 2021
fix redirects
#Sidebar
#Database (Introduced Gramps 5.x and greater)
#Rule (Introduced Gramps 5.1.x and greater)
==Writing an addon==
# [[#List_and_document_your_addon_on_the_wiki|Document your addon]] and publish it to the addon list
# [[#List_your_addon_in_the_Gramps_Plugin_Manager|Register your addon with the Plugin Manager]]
# [[Contact#Mailing_listsAnnounce_it_on_the_Gramps_mailing_list|Announce it on the Gramps mailing list]] - Let users know it exist and how to use it.
# [[#Support_it_through_issue_tracker|Support it through the issue tracker]]
# [[#Maintain_the_code_as_Gramps_continues_to_evolve|Maintain the code]] as Gramps continues to evolve
Create your NewProjectName.py and NewProjectName.gpr.py files.
Follow the development API for your tool, [[Report-writing_tutorial|report]], view, or [[Gramplets]]. Place all of your associated .py, .glade, etc. files in this directory. For general information on Gramps development see [[Portal:Developers]] and [[Writing a plugin|Writing a Plugin]] specifically.
=== Test your addon as you develop ===
{{man warn|{{bug|10436}} Symlinks to folders in gramps plugin dir are not scanned}}
To test your addon as you develop it is suggested that you insert copy your NewProjectName plugin into your Gramps user plugin directory with a link to from your addon development directory, like so: prior to testing. cd ~/Or just edit in the Gramps user plugin directory until it is ready to publish, then copy back to your addon development directory.gramps/gramps51/plugins ln -s ~/addons-source/NewProjectName NewProjectName
Your installed Gramps will search this folder (and subdirectories) for .gpr.py files, and add them to the plugin list.
_("Remaining names | rest")
Where "rest" is the English string that we want to present and "Remaining names" is a hint for translators.
 
==== Commands to compile translations ====
 
To build and compile translations for all projects to their download/Addon.addon.tgz files:
 
: <code>python3 make.py gramps51 build all</code>
 
To compile translations for all projects :
 
: <code>python3 make.py gramps51 compile all</code>
== Create a Gramps Plugin Registration file ==
Each report category has a set of standards and interface. The categories CATEGORY_TEXT and CATEGORY_DRAW use the Document interface of Gramps. See also [[Report API]] for a draft view on this.
The application programming interface or API for reports is treated at [[Report-writing_tutorial]]. For general information on Gramps development see [[Portal:Developers]] and [[Writing a plugin|Writing a Plugin]] specifically.
=== General plugins ===
</pre>
{{man note|Note:|Running the command '''<code>make.py xxx build''' </code> will increment the third number in your dotted version number of all addons in the <code>*.gpr.py </code> file. Consider this number to be a "build number".}}
This will leave your 'addons-source' with untracked changes according to git. You should delete the 'NewProjectName/locale' directory. The updated 'NewProjectName/NewProjectName.gpr.py ' is ready to add and commit the next time you make other changes.
git add gramps52/download/NewProjectName.addon.tgz
git commit -m " Added new plugin: NewProjectName"</pre>
 
== List your addon in the Gramps Plugin Manager==
{{man warn|Gramps needs to have been built|Make sure you have already built gramps51 or master. Change to the appropriate git branch in your gramps directory, and run '<code>python3 setup.py build' </code> See [[Linux:Build_from_source]]}}
To create a listing:
== List and document your addon on the wiki==
===List your addon===Add a short description of your addon to the Addons list by editing the current release listing eg: [[5.1_Addons]] or if the addon is meant for a future release [[5.2_Addons]] when available. ==== Example addon template ====Examine the listing for other addons and refer to the [[Plugin list legend]] for details of on the meaning of each columns.<pre>|- <!-- Copy this section and list your Addon -->|<!-- Plugin / Documentation -->|<!-- Type -->|<!-- Image -->|<!-- Description -->|<!-- Use -->|<!-- Rating (out of 4) -->|<!-- Contact -->|<!-- Download -->|-</pre> ===Document your addon===Document the addon in the wiki using the page name format of {{man menu|Addon:NewProjectName}} examine the other addon support pages for the general format to use. ({{man tip|Hint:on creating a new wiki page.|To create a new wiki page use the search box to search for the name of your page that doesn't exist then on the search results page you will be provided with a link to create the new page, by selecting and you can add your content, examine }} ====Example addon article====Consider including the following information: <pre><!-- Copy this section to your Addon support page-->{{Third-party plugin}}<!-- This is a mediawiki template that expands out to display the other standard addon support pages for message you see at the general format to use.)top of each addon page--> <!--sections only add if needed-->== Usage ==
Edit [[5.1_Addons]] or ( when available [[5.2_Addons]]) and add a short description of your addon and you can also point to the addon.tgz stored on GitHub as the downloadable file for manual installations.=== Configure Options ===
== Miscellaneous commands Features==
To build and compile translations for all projects to their download/Addon.addon.tgz files:== Prerequisites ==
: <code>python3 make.py gramps51 build all</code>== Issues ==
To compile translations for all projects <!--default categories-->[[Category:Addons]][[Category:Plugins]][[Category:Developers/General]]</pre>
: <code>python3 make== Announce it on the Gramps mailing list ==Join the [[Contact#Mailing_lists|Gramps Mailing lists]] and announce it to the users with general information on why you created and how to use it.py gramps51 compile all</code>
== Support it through issue tracker ==
Become a team member user on the [https://gramps-project.org/bugs/view_all_bug_page.php Gramps MantisBT (Mantis BugTracker)].
and please check it regularly. There is no automated notification of issues (and possible feature requests) related to your addon when reported by users.
Users tend to not understand coding and they make assumptions. So be kindly mentoring kind and guiding if a report is ambiguous or inaccurate. A dismissive or condescending negative remark from a an addon developer or anyone can be very damagingdiscouraging.
== Maintain the code as Gramps continues to evolve ==
* A place for controversial plugins that will never be accepted into core, but are loved by many users (eg, Data Entry Gramplet).
* A place for experimental components to live.
== Example code adding common enhancements ==
* Copy all the Gramplet's output to a system clipboard via context pop-up menu : Enhancement request {{bug|11573}}, [https://github.com/gramps-project/gramps/pull/1014/commits/72012e13b4ca15caca4b7f36fdb9702c1fd470fd example pull]
* add a custom [[Gramps_Glossary#viewmode|View Mode]] toolbar icon via the <code>.gpr.py</code> : [https://github.com/gramps-project/gramps/pull/1017 Pull 1017 Discussion], [https://github.com/gramps-project/gramps/pull/1017/commits/76e41d546d6ec519dd78fbe07f663135b5c79351 example Pull]
= Resources =
* [[Brief_introduction_to_Git|Git introduction]]
* [[Getting started with Gramps development]]
* [[Portal:Developers]]
* [https://gramps-project.org/docs/gen/gen_plug.html?highlight=include_in_listing#module-gramps.gen.plug._pluginreg Registration Module]
;Gramps Addons site for Gramps 4.2 and newer
1,969
edits

Navigation menu