Open main menu

Gramps β

Changes

Addons development

16,993 bytes added, 10 March
Get a local copy of Gramps and its addons
{{man tip|Information on developing Gramps addons|If you are looking for addons to install, visit: [[Third-party Addons]]}}{{man warn|WarningNote that this article anticipates that most addons will be developed under Linux.|([[Getting started with Gramps development|Linux is the principal development platform.]]) While it is possible to do so under Windows or MacOS, some of the steps will differ and the documented processes have not been as thoroughly reviewed. So developer beware.<br>See [[Portal:Developers]]}}If you are developing a [[Third-party Addons|This Third-party Addon]]; this page documents the API, methods, and best practices for developing a 3rd-party addon for Gramps 34.2 / 3.3 / 3and later.4.}}
==What can addons extend?==Addons for Gramps can extend the program in many different ways. You can add any of the following [https://github.com/gramps-project/gramps/blob/master/gramps/gen/plug/_pluginreg.py types ] of addons:
# Doc creator<!-- sync with https://gramps-project.org/wiki/index.php?title=Addon_list_legend&action=edit&section=2 --> * '''Importer''' (IMPORT) - adds additional file format import options to Gramps# * '''Exporter''' (EXPORT) - adds additional file format export options to Gramps* '''[[Gramps_Glossary# gramplet|Gramplet]]''' (GRAMPLET) - adds a new interactive interface section to a Gramps view mode, which can be activated by right-clicking on the dashboard View or from the menu of the Sidebar/Bottombar in the other view categories. * '''Gramps [[Gramps_Glossary#viewmode|View ''(mode)'']]''' (VIEW) - adds a new view mode to the list of views available within a [[Gramps_Glossary# Importerview|View Category]]# * '''[[Map_Services|Map serviceService]]''' (MAPSERVICE) - adds new mapping options to Gramps# * '''Plugin lib''' (GENERAL) - libraries that are present giving extra functionality. Can add, replace and or modifies built-in Gramps options.* '''[[Gramps_{{man version}}_Wiki_Manual_-_Reports_-_part_8# Quick_Views|Quickreport'''/'''Quickview]]''' (QUICKREPORT) - a view that you can run by right-clicking on object, or if a person quickview, then through the Quick View Gramplet* '''[[Gramps_{{man version}}_Wiki_Manual_-_Reports_-_part_1|Report]]''' (REPORT) - adds a new output report / includes '''Website''' - output a static genealogy website based on your Gramps Family Tree data.* '''[[Gramps_{{man version}}_Wiki_Manual_-_Filters#Add_Rule_dialog|Rule]]''' (RULE) - adds new [[Gramps_Glossary# filter|filter]] rules. {{new|5.1}}* '''[[Gramps_{{man version}}_Wiki_Manual_-_Tools|Tool]]''' (TOOL) - adds a utility that helps process data from your family tree.* '''Doc creator''' (DOCGEN)* '''Relationships''' (RECALC)# Report* '''Sidebar''' (SIDEBAR)* '''[[Database_Backends|Database]]''' (DATABASE) - add support for another database backend. {{new|5.0}}# Tool* '''Thumbnailer''' (THUMBNAILER) {{new|5.2}}# View* '''Citation formatter''' (CITE) {{new|5.2}}
==Writing an addon==
Writing an addon is fairly straightforward if you have just a little bit of Python experience. And sharing your addon is the right thing to do. The general steps to writing an addon and sharing your own addons are:
# [[#Develop_your_addon|Develop your addon]]# [[#Create_a_Gramps_Plugin_Registration_file|Create a Gramps Plugin Registration file (.gpr.py)]]# Get translators to translate [[#internationalization|Invite translation of your addon ]] into multiple natural languages# [[#Package_your_addon|Package your addon]]# List [[#List_and_document_your_addon_on_the_wiki|Document your addon]] and document publish it to the addon list# [[#List_your_addon_in_the_Gramps_Plugin_Manager|Register your addonwith the Plugin Manager]]# [[#Announce_the_addon|Announce it on the Gramps Forum]] - 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
We'll now look at expand upon each of these steps in detailindividually.
== Develop your addon ==
The [http://github.com/gramps-project/addons subversion -source addons-source] repository has holds the source code for the addons with branches holding the version for different gramps. If you are working on an addon for gramps for the following structure:current Gramps {{man version}} public release, be sure to use the maintenance/gramps52 git branch, as the default is master branch for the developmental pre-release. (Currently gramps 5.3, which is not the typical target for addons.)
* Example commands are shown below referring to the public release rather than the master branch. The developers are currently merging changes to the most recent maintenance branch into master as necessary, so you don't have to do anything for that unless you are in a hurry.  The [http://github.com/gramps-project/addons-source addons-source] git repository has the following structure, with the code for each addon in its own folder: * /addons-source** /trunk''IndividualNameOfAddon1''** /''IndividualNameOfAddon2''** ... The [http://github.com/gramps-project/addons addons] git repository holds built versions of the addons for each release of Gramps, and has the following structure: * /addons** [https://github.com/gramps-project/addons/tree/master/gramps42 /contribgramps42]
*** /download
** * /listings** [https://github.com/gramps-project/addons/branchestree/master/gramps50 /gramps50]*** /download*** /listings** [https://github.com/gramps{{stable_branch}}-project/addons/tree/master/gramps51 /gramps51]*** /gramps32download*** /listings** [https://github.com/gramps-project/contribaddons/tree/master/gramps52 /gramps52]*** /download*** /listings === Get a local copy of Gramps and its addons === These steps show how to downloadthe addon sources. # Get an https://github.com/join account if you don't already have one.# Request GIT write access for the https://github.com/gramps-project/addons-source project by emailing the [[Contact#Mailing_lists|gramps-devel mailing list]]See also [[Brief_introduction_to_Git|git introduction]] for instructions on installing git and getting basic settings configured. Also [https://help.github.com/articles/generating-an-ssh-key/ Connecting to GitHub with SSH] will help with setting up credentials for GitHub.To fully build and advertise a new addon will require local copies of the three repositories, the 'addons-source', 'addons' and the main Gramps source 'gramps'. This wiki assumes that all three git repositories local locations are put into the same base directory and named with the repository names in order for the make.py script commands to work as shown. From the base directory, run the following commands to create a copy of each repository. If you want to use SSH;  git clone [email protected]:gramps-project/addons-source.git addons-source git clone [email protected]:gramps-project/addons.git addons git clone [email protected]:gramps-project/gramps.git gramps or if you want to use a web url:  git clone https://github.com/gramps-project/addons-source.git addons-source git clone https://github.com/gramps-project/addons.git addons git clone https://github.com/gramps-project/gramps.git gramps
The contrib subdirectories hold the source code for To switch to a local copy of the addons for a particular version. If you are working on a addon for gramps{{stable_branch}} then you should be working in gramps-addons/branches/gramps{{stable_branch}}/contrib. If you are working in gramps/trunk then you should use gramps-addons/trunk/contrib.gramps52 maintenance branch:
These steps show how to download and work with the addon development tools. cd addons-source git checkout -b gramps52 origin/maintenance/gramps52
# Checkout the gramps-addons files from the [https://sourceforge.net/projects/gramps-addons/ gramps-addons] project:## cd into gramps trunk, for example:### cd ~/gramps/trunk## Checkout gramps-addons:### svn co https://svn.code.sf.net/p/gramps-addons/code gramps-addons## Change or to trunk or branches/gramps{{stable_branch}} directory:### cd gramps-addons/branches/gramps{{stable_branch}}/contrib# Make a new project directory work in gramps-addon/branches/gramps{{stable_branch}}/contrib:## mkdir NewProjectName# Initialize the addonmaster branch:## ./make.py init NewProjectName
NOTE: to use make.py as shown throughout this document, you may have to use: cd addons-source git checkout -b gramps53 origin/master
GRAMPSPATH=== Other prerequisites ==={{man warn|These instructions, the make.py script etc.|are designed to operate in a Linux environment. {{man menu|They won't work on Windows without modifications.}}}}* Gramps uses Python version 3.2 or higher. You must have at least that version installed. If you have installed Gramps 4.2 or higher on your Linux system already, then a sufficient version of Python will be present. If you have more than one version of Python installed, then you must use the correct version for these scripts. On some systems, both Python 2.x and 3.x are installed. It is possible that the normal invocation of <code>python</code> starts up Python 2.x, and that to start up Python 3.x requires invoking with <code>python3</pathcode> or <code>python3.4</code> etc. You can test the version by <code>python –version</tocode> or <code>python3 –version</gramps code>. If this is so, replace any usage of 'python ' in the examples below with the appropriate invocation.* The make.py used in construction of the addons requires that the LANGUAGE environment variable be set to 'en_US.UTF-8'.* The make.py used in construction of the addons requires that the GRAMPSPATH environment variable be set to your path to the Gramps source tree.* intltool must be installed;: <code>sudo apt-get install intltool</code>
For example if your home directory is '/home/name' and you use the default ("suggested path names, use: <code>GRAMPSPATH=/home/name/gramps LANGUAGE='en_US.UTF-8' python3 make.py ./..</code>to replace the <code>./make.") is not correctpy</code> in the examples below.
Follow the development API for === Create your tool, [[Reportaddon subdirectory ===* Make a new project directory in addons-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 [[Portalsource::Developers]] and [[Writing a Plugin]] specifically.<code>mkdir NewProjectName</code>
To test ===Follow the development API for your addon as you develop it it is suggested that you replace tool===Create your Gramps user plugin directory with a link to your addon development directory, like so:NewProjectName.py and NewProjectName.gpr.py files.
cd ~/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.gramps/gramps{{stable_branch}}/ mv plugins/* /wherever/trunk/gramps-addons/branches/gramps{{stable_branch}}/contrib/ rm -rf plugins ln -s /wherever/trunk/gramps-addons/branches/gramps{{stable_branch}}/contrib plugins
Gramps will search this folder (and subdirectories) for .grp.py files, and add them to the plugin list.=== Test your addon as you develop ===
If you have code that you want {{man warn|{{bug|10436}} Symlinks to share between addons, you don't need to do anything special. Currently, Gramps adds each directory folders in which a .gpr.py is found onto the PYTHONPATH which is searched when you perform an import. Thus "import NewProjectName" will work from another addon. You should always make sure you name your addons with a name appropriate for Python imports.gramps plugin dir are not scanned}}
To commit test your changes so addon as you develop it is suggested that others can use you copy your NewProjectName plugin into your Gramps user plugin directory from your addondevelopment directory, prior to testing. Or just edit in the Gramps user plugin directory until it is ready to publish, follow these steps:then copy back to your addon development directory.
# Get an http://sourceforge.net account if you don't already have one.# Request SVN write access Your installed Gramps will search this folder (and subdirectories) for the gramps-addon project from https://sourceforge.net/project/memberlistgpr.php?group_id=285429# Remove the py files that should not be added , and add them to SVN:## the plugin list./make.py clean NewProjectName# Add the project to the repository:## svn add NewProjectName## svn commit -m "A message describing what this addon is"
Before making additional edits If you have code that you want to your addonshare between addons, you don't need to do anything special. Gramps adds each directory in which a .gpr.py is found onto the PYTHONPATH which is searched when you perform an import. Thus "import NewProjectName" will work from another addon. You should:always make sure you name your addons with a name appropriate for Python imports.
# svn update=== Commit your changes ===To commit your changes so that others can see your addon source. * Remove the files using the ''clean'' command that should not be added to GitHub (eg files(template.pot/ locale etc)):: <code>./make.py gramps52 clean NewProjectName</code>* Add the project to the repository:: <code>git add NewProjectName</code>* Commit it with an appropriate message: <code>git commit -m "A message describing what this addon is"</code> Before committing additional edits to your addon, you should: * to make sure that outside changes do not affect your commit: <code>git pull --rebase</code>* only the files you changed should be in this list# svn : <code>git status</code>* Commit it with an appropriate message# svn : <code>git commit -m "A message describing the changes"</code> If you have been given 'push' rights to GitHub 'gramps-project/addons-source', and when you are sure you are done and want to publish to the repository: * to make sure that outside changes do not affect your commit: <code>git pull --rebase</code>: <code>git push origin gramps52</code> Also you may want to [[Addons_development#Package_your_addon |Package your addon]] so it can be downloaded via the plugin manager.
=== Config ===
Some addons may want to have persistent data (data settings that remain between sessions). You can handle this yourself, or you can use Gramps' built-in configure system.
In At the top of the source file that defines the settingsof your addon, you would do this:
from config import configas configman cm config = configconfigman.register_manager("view_placetreeview_0grampletname") cm# register the values to save: config.register("section.variable1option-name1", value1) cmconfig.register("section.variable2option-name2", value2)
...
cm# load an existing file, if one: config.initload() # save it, it case it didn't exist: config.save()
This will create the file "view_placetreeview_0grampletname.ini" and put in the same directory as the addon. In If the addonconfig file already exists, you can then:it remains intact.
In the addon, you can then:  x = cmconfig.get("section.variable1option-name1") cmconfig.set("section.variable1option-name1", 3)
and when this code is exiting, you might want to save the config. In a Gramplet that would be:
def on_save(self):
cmconfig.save()
If your code is a system-level file, then you might want to save the config in the Gramps system folder:
cm config = configconfigman.register_manager("system", use_config_path=True)
This, however, would be rare; most .ini files would go into the plugins directory.
In other code that might use this config file, you would do this:
from config import configas configman cm config = configconfigman.get_manager("view_placetreeview_0grampletname") x = cmconfig.get("section.variable1option-name1")
=== Localization ===
For general help on translations in Gramps, see [[Coding for translation]]. However, that will only use translations that come with Gramps, or allows you to contribute translations to the Gramps core. To have your own managed translations that will be packaged with your addon, read the rest of this page.
Note that these instructions will only work for Python strings, if you have a glade file, it will not get translated.
For any addon which you have translations into other languages, you will need to add a way to retrieve the translation. You need to add this to the top of your NewProjectName.py file:
<pre> from TransUtils gramps.gen.const import get_addon_translatorGRAMPS_LOCALE as glocale _ = glocale.get_addon_translator(__file__).gettext</pre>
Then you can use the standard "_()" function to translate phrases in your addon.
You can use one of a few different types of translation functions:
# gettext
# lgettext
# ngettext
# lngettext
# ngettext# ugettext# ungettextsgettext
NOTE: Currently we don't These have a method of using a context become obsolete in any of these functionsGramps 4; gettext, ngettext, and sgettext always return translated strings in unicode for consistent portability between Python 2 and Python3.
See the [http://docs.python.org/3/library/gettext.html#the-gnutranslations-class python documentation] for documentation of gettext and ngettext. The translation functions that "l" versions return the string encoded according to the [http://docs.python.org/3/library/locale.html#locale.setlocale currently set locale]; the "u" versions return unicode strings in Python2 and are supported are defined as followsnot available in Python 3.
'''gettext(message)sgettext'''is a Gramps extension that filters out clarifying comments for translators, such as _("Remaining names | rest")Where "rest" is the English string that we want to present and "Remaining names" is a hint for translators.
If a fallback has been set, forward gettext() ==== Commands to the fallback. Otherwise, return the translated message. Overridden in derived classes.compile translations ====
'''lgettext(message)'''To build and compile translations for all projects to their download/Addon.addon.tgz files:
If a fallback has been set, forward lgettext() to the fallback. Otherwise, return the translated message. Overridden in derived classes: <code>python3 make.py gramps52 build all</code>
'''ugettext(message)'''To compile translations for all projects :
If a fallback has been set, forward ugettext() to the fallback. Otherwise, return the translated message as a Unicode string. Overridden in derived classes. '''ngettext(singular, plural, n)''' If a fallback has been set, forward ngettext() to the fallback. Otherwise, return the translated message. Overridden in derived classes. '''lngettext(singular, plural, n)''' If a fallback has been set, forward ngettext() to the fallback. Otherwise, return the translated message. Overridden in derived classes. '''ungettext(singular, plural, n)''' If a fallback has been set, forward ungettext() to the fallback. Otherwise, return the translated message as a Unicode string. Overridden in derived classes: <code>python3 make.py gramps52 compile all</code>
== Create a Gramps Plugin Registration file ==
<pre>
register(PTYPE,
gramps_target_version = "35.42",
version = "1.0.0",
ATTR = value,
</pre>
[https://github.com/gramps-project/gramps/blob/master/gramps/gen/plug/_pluginreg.py#L76 PTYPE ] is TOOL, GRAMPLET, REPORT, QUICKREPORTQUICKVIEW, IMPORT, EXPORT, DOCGEN, GENERAL, MAPSERVICE, VIEW, or RELCALC.
 ATTR depends on the PTYPE. But you must have '''gramps_target_version''' and '''version'''. '''gramps_target_version ''' should be a string of the form "X.Y" version number matching Gramps X major, Y minor integer. '''version ''' is a string of the form "X.Y.Z" representing the version of your addon. X, Y, and Z should all be integers.
Here is a sample Tool GPR file:
description = _("Attaches a shared source to multiple objects."),
version = '1.0.0',
gramps_target_version = '35.42',
status = STABLE,
fname = 'AttachSourceTool.py',
</pre>
You can see examples of the kinds of addons [httphttps://svngithub.code.sf.net/pcom/gramps/code/trunk-project/gramps/plugins/ here] (for example, see [httphttps://svn.codegithub.sf.net/pcom/gramps/code/trunk-project/gramps/plugins/drawreport/drawplugins.gpr.py trunk/gramps/plugins/drawreport/drawplugins.gpr.py]) and see the full documentation in the [httphttps://svngithub.code.sf.netcom/gramps-project/gramps/blob/p3f0db9303f29811b43325c30149c8844c7ce24b6/gramps/codegen/trunkplug/_pluginreg.py#L23 master/gramps/gen/plug/_pluginreg.py here] in the comments and docstrings.
Note that this .gpr.py will automatically use translations if you have them (see below). That is, the function "_" is predefined to use your locale translations; you only need to mark the text with _("TEXT") and include a translation of "TEXT" in your translation file. For example, in the above example, _("Attach Source") is marked for translation. If you have developed and packaged your addon with translation support, then that phrase will be converted into the user's language.
=== Report plugins ===
The possible report categories are ([https://github.com/gramps-project/gramps/blob/892fc270592095192947097d22a72834d5c70447/gramps/gen/plug/_pluginreg.py#L141-L149 gen/plug/_pluginreg.py]):
<pre>
#possible report categories
CATEGORY_BOOK = 4
CATEGORY_GRAPHVIZ = 5
CATEGORY_TREE = 6
REPORT_CAT = [ CATEGORY_TEXT, CATEGORY_DRAW, CATEGORY_CODE,
CATEGORY_WEB, CATEGORY_BOOK, CATEGORY_GRAPHVIZ, CATEGORY_TREE]
</pre>
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 Gramps development see [[Portal:Developers]] and [[Writing a plugin|Writing a Plugin]] specifically.
=== General plugins ===
description = _("Provides a library for doing something."),
version = '1.0',
gramps_target_version = '35.42',
status = STABLE,
fname = 'library.py',
Runs when plugin is registered.
"""
print ("Hello World!")
</pre>
category = "WEBSTUFF",
version = '1.0',
gramps_target_version = '35.42',
data = ["a", "b", "c"],
)
description = _("Provides a collection of stylesheets for the web"),
version = '1.0',
gramps_target_version = '35.42',
fname = "stylesheet.py",
load_on_reg = True,
def filters(namespace):
print ("Ok...", plugin.category, namespace, uistate)
# return a Filter object here
return filters
</pre>
 
<span id=internationalization>
 
== List the Prerequistes your addon depends on ==
 
''In your gpr file, you can have a line like:
 
<code>depends_on = ["libwebconnect"]</code>
 
which is a list of id's from other gpr files. This example will ensure that [[Addon:Web_Connect_Pack#Prerequisites|libwebconnect]] is loaded before your addon. If it can't be found, or you have a cycle, then your addons won't be loaded.
 
example code used in the Addon:Web_Connect_Pack that references libwebconnect Prerequistes [https://github.com/gramps-project/addons-source/blob/1304b65a7d758bfe17339c26260473ac3e9c4061/RUWebConnectPack/RUWebPack.gpr.py#L17 RUWebPack.gpr.py#L17 ]
 
This means that common Prerequistes can be shared between addons and that code sits in its own gpr/addon file.
 
<!--
 
[] for addon prerequistes have a look at converting them to use "depends_on = " like in the following addons
https://github.com/gramps-project/addons-source/search?utf8=%E2%9C%93&q=depends_on&type=
https://github.com/gramps-project/gramps/search?utf8=%E2%9C%93&q=depends_on&type=
 
which can be a comma separated list for multiple dependencies/prerequisites (so that addons that share prerequisites import the same library?) (maybe move spell check into an addon etc? tip of the day... possibilities...)
 
depends_on = ["libwebconnect"]
 
mentioned in the following
https://sourceforge.net/p/gramps/mailman/message/27070037/
''In your gpr file, you can have a line like:
 
depends_on = ["libwebconnect"]
 
which is a list of id's from other gpr files. This example will ensure
that libwebconnect is loaded before your plugin. If it can't be found,
or you have a cycle, then your plugin won't be loaded.
 
If it is a common function, perhaps libhtml is the right place to put
it, and you can put a depends_on on that.
 
-Doug''
 
 
example output is on terminal only:
 
Cannot resolve the following plugin dependencies:
Plugin 'UK Web Connect Pack' requires: ['libwebconnect']
 
[](feature) For plugins/addons if prerequisites not available display a page stating why/what is missing that includes the addon description and a url to the support page.
 
[] Gramps CLI info "gramps -v" needs a section that list third-party addons with version numbers and if prerequisites have been met.
 
[]update the Addon:Prerequisites Checker Gramplet to test for your Prerequisites.
 
-->
== Get translators to translate your addon into multiple languages ==
</span>If you [[# Localization|designed for localization]], the addon will begin supporting a single language. Make your addon inviting for volunteers to translate it into their native language.* Initialize and update the <code>template.pot </code> for your addon:## : <code>cd ~/addons-source</code>: <code>./make.py gramps52 init NewProjectName</code># * You should edit the header of <code>template.pot</code> with your information, so it gets copied to individual language files.* Initialize a language for your addon (say French, fr):## : <code>./make.py gramps52 init NewProjectName fr</code># * Update it from gramps and other addons:## : <code>./make.py gramps52 update NewProjectName fr</code># * Edit contribthe translations file manually:: <code>/NewProjectName/po/fr-local.po</code># * Compile the language:## : <code>./make.py gramps52 compile NewProjectName</code># * Add or update your local language file, and commit changes:## svn : <code>git add NewProjectName/po/fr-local.po</code>## svn : <code>git commit NewProjectName/po/fr-local.po -m "Added fr po file"</code>* If you have been given 'push' rights to GitHub 'gramps-project/addons-source', then;: <code>git push origin gramps52</code>
== Package your addon ==
To create a downloadable package:
: <code>./make.py gramps52 build NewProjectName</code> python or: <code>./make.py gramps53 build NewProjectName</code> for the master branch.
That This will automatically include the following files in your build and copy your addon to ../download:
NOTE: Running the '''make* *.py build''' will increment the third number in your dotted version number of all addons in the gpr* *.py fileglade* *.xml* *. Consider this number to be a "build number"txt* locale/*/LC_MESSAGES/*.mo
''New for Gramps 3Starting with Gramp 5.4'': You need to then make 0, if you have additional files beyond those listed above, you should create a MANIFEST file in the root of your addon available in listings of various languages. To do thatfolder listing the files (or pattern) one per line, like this sample MANIFEST file:
python make<pre>README.py listingmdextra_dir/*help_files/docs/help.html</pre>
That {{man note|Note:|Running the command <code>make.py xxx build</code> will create a series increment the third number in your dotted version number of files all addons in the <code>*.gpr.py</listings/ code> file. Consider this number to be a "build number".}}
Then 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 package to SVNnext time you make other changes.:<code>rm –rf –v 'NewProjectName/locale'</code>
svn Then add ../download/NewProjectName.addon.tgz ../listings/* cd .. svn commit -m "Message describing changes"the package to GitHub:
== Miscellaneous commands == <pre> cd '~/addons' git add gramps52/download/NewProjectName.addon.tgz git commit -m "Added new plugin: NewProjectName"</pre>or (for the master branch);<pre> cd '~/addons' git add gramps53/download/NewProjectName.addon.tgz git commit -m " Added new plugin: NewProjectName"</pre>
To build all projects:== List your addon in the Gramps Plugin Manager==
{{man warn|Gramps needs to have been built|Make sure you have already built gramps52 or master. python makeChange to the appropriate git branch in your gramps directory, and run <code>python3 setup.py build all</code> See [[Linux:Build_from_source]]}}
To compile all projects to their download/Addon.addon.tgz filescreate a listing:
python : <code>cd '~/gramps-addons'</code> or wherever you have built your addon: <code>GRAMPSPATH=path/to/your/gramps/install ./make.py gramps52 listing NewProjectName</code>or (for the master branch);: <code>cd '~/gramps-addons'</code> or wherever you have built your addon: <code>GRAMPSPATH=path/to/your/gramps/install ./make.py compile allgramps53 listing NewProjectName</code>
== List and document your addon ==That will create a series of files in the <tt>../listings/</tt> directory.
Edit Then add the updated listing to GitHub: <pre> cd '~/addons' git add gramps52/listings/* git commit -m "Added new plugin to listings: NewProjectName"</pre>or (for the master branch);<pre> cd '~/addons' git add gramps53/listings/* git commit -m " Added new plugin to listings: NewProjectName"</pre> == 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: [[Plugins35.42_Addons]] and describe your or if the addonis meant for a future release [[5.3_Addons]] when available. You can point  ==== Example addon template ====Examine the listing for other addons and refer to the addon.tgz in SVN as [[Addon list legend]] for details of on the downloadable filemeaning 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}} ====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 standard addon message you see at the top of each addon page--> <!--sections only add if needed-->== Usage == === Configure Options === ==Features== == Prerequisites == == Issues == <!--default categories-->[[Category:Addons]][[Category:Plugins]][[Category:Developers/General]]</pre> == Announce the addon ==Join the [[Contact#Forum|Gramps Forum]] and announce it to the users with general information on why you created and how to use it.
== Support it through issue tracker ==
Visit httpBecome a user on the [https://www.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 kind and become guiding if a userreport is ambiguous or inaccurate. A negative remark from an addon developer or anyone can be very discouraging. == Maintain the code as Gramps continues to evolve == {{man tip|When submitting an update the patch part of the version number MAJOR.MINOR.PATCH is updated during the addon build process e.g. 1.1.3 to 1.1.4|You can find this step in [https://github.com/gramps-project/addons-source/blob/master/make.py#L125 addons-source/make.py].[https://gramps.discourse.group/t/should-addons-pr-include-version-number-update/2591]}} Remember that Gramps addons exist for many reasons and there are many Gramps developers that do support addons in various ways (translations, triage, keeping in sync with master, download infrastructure, etc). Some reasons why the addons exist; they provide:* A quick way for anyone to share their work; the Gramps-project has never denied adding a addon.* A method to continuously update and develop a stand-alone component, often before being officially accepted.* A place for controversial plugins that will never be accepted into core, but are loved by many users (eg, Data Entry Gramplet). Suggest * A place for experimental components to check it regularlylive.
== Maintain the Example code as GRAMPS continues to evolve 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* httphttps://github.com/gramps-project/addons-source - Source code (Git)* https://github.svn.sourceforge.net/viewvccom/gramps-project/addons/ - SVN browsedownloadable .tgz files;Gramps Addons site for Gramps 4.1 and older* For 4.1.x and earlier, see [[Addons development old]]. = Addon Development Tutorials and Samples =* [[Report-writing_tutorial|Report-writing Tutorial]]* [[Quick_Views|Quick Views]]* [[Gramplets|Gramplets]]* [[Develop_an_Add-on_Rule|Develop an Add-on Rule]]* [[Develop_an_Add-on_Tool|Develop an Add-on Tool]]* [[Adapt_a_built-in_Report|Adapt a built-in Report]]
[[Category:Developers/General]]
[[Category:Reports]]
[[Category:Gramplets]]
[[Category:Addons]]