Open main menu

Gramps β

Changes

Addons development

1,636 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==
===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.
 
You can also point to the addon.tgz stored on GitHub as the downloadable file for manual installations.
 
Refer to the [[Plugin list legend]] for details of on the meaning of each columns.
==== 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 -->
===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-->== Miscellaneous commands Usage ==
To build and compile translations for all projects to their download/Addon.addon.tgz files:=== Configure Options === ==Features== == 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 ==
* 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,971
edits