Difference between revisions of "Adapt a built-in Report"

From Gramps
Jump to: navigation, search
m (See also)
m (See also)
Line 1: Line 1:
 
{{Languages|Adapt_a_built-in_Report}}
 
{{Languages|Adapt_a_built-in_Report}}
 
{{man warn|1=&#x1F6A7; Work In Progress|2=This wikipage is an outline from a template being roughed in. Please don't edit '''''just yet'''''. Instead, contribute suggestions on the Discussion page. <br /><br />This page is not planned be linked to a public page until about 2 weeks after 8 April 2021. <br /><br />If this notice remains after that date, please feel welcome to remove this notice and consider the content 'fair game' for unlimited editing.}}
 
{{man warn|1=&#x1F6A7; Work In Progress|2=This wikipage is an outline from a template being roughed in. Please don't edit '''''just yet'''''. Instead, contribute suggestions on the Discussion page. <br /><br />This page is not planned be linked to a public page until about 2 weeks after 8 April 2021. <br /><br />If this notice remains after that date, please feel welcome to remove this notice and consider the content 'fair game' for unlimited editing.}}
 +
==Purpose==
 +
A question was posted to the Discourse forum wondering if there were tips somewhere for copying an internal Gramps report to a make an experimental add-on?
 +
 +
It seems like more people would be intrigued with the possibilities of tweaking reports without the risk of breaking a feature. Particularly one that they use often enough that tweaking it seemed like a good idea.
 +
 +
Making a duplicate add-on sidesteps putting the original at risk. However, there are differences between built-ins and 3rd party add-ons. It seemed like that might require at least converting the library paths and making a new <code>.gpr.py</code> registration file. What else?
 +
 +
==A reply privately shared==
 +
In a private message, GaryG privately replied and sent a few copies of reports generated that address the question.
 +
 +
In the sample cases, Gary had taken the Detailed Ancestor and Detailed Descendant stock reports and added the ability to include *all* images for everyone. The Detailed individual report had that functionality, but the ancestor/descendant did not.
 +
 +
 +
==ch-ch-ch-changes==
 +
The important changes
 +
# Change the Class names to be unique. Each report has 2 classes - one for the code and one for the report. In my cases, I added a trailing ‘i’.
 +
# Change the name of the report styles. This is necessary if you are using books, not absolutely required if not. For the Descendant report I changed the style prefix from DDR to DDRI, for instance. I didn’t change the Ancestor report.
 +
#  Update the <code>.gpr.py</code> registration file to point to the correct file and correct classes.
 +
 +
Attaching are 2 samples with the old (names ending with report.py) and the new code (names ending with reporti.py) as well as the revised <code>.gpr.py</code> files. The old code may have changed since I wrote the new code quite a while ago - so every diff may not be important.
 
== See also ==
 
== See also ==
 
* [[Gramps_{{man version}}_Wiki_Manual_-_Reports_-_part_2|substitution values for Reports]]
 
* [[Gramps_{{man version}}_Wiki_Manual_-_Reports_-_part_2|substitution values for Reports]]

Revision as of 03:19, 8 April 2021

Gnome-important.png
🚧 Work In Progress

This wikipage is an outline from a template being roughed in. Please don't edit just yet. Instead, contribute suggestions on the Discussion page.

This page is not planned be linked to a public page until about 2 weeks after 8 April 2021.

If this notice remains after that date, please feel welcome to remove this notice and consider the content 'fair game' for unlimited editing.

Purpose

A question was posted to the Discourse forum wondering if there were tips somewhere for copying an internal Gramps report to a make an experimental add-on?

It seems like more people would be intrigued with the possibilities of tweaking reports without the risk of breaking a feature. Particularly one that they use often enough that tweaking it seemed like a good idea.

Making a duplicate add-on sidesteps putting the original at risk. However, there are differences between built-ins and 3rd party add-ons. It seemed like that might require at least converting the library paths and making a new .gpr.py registration file. What else?

A reply privately shared

In a private message, GaryG privately replied and sent a few copies of reports generated that address the question.

In the sample cases, Gary had taken the Detailed Ancestor and Detailed Descendant stock reports and added the ability to include *all* images for everyone. The Detailed individual report had that functionality, but the ancestor/descendant did not.


ch-ch-ch-changes

The important changes

  1. Change the Class names to be unique. Each report has 2 classes - one for the code and one for the report. In my cases, I added a trailing ‘i’.
  2. Change the name of the report styles. This is necessary if you are using books, not absolutely required if not. For the Descendant report I changed the style prefix from DDR to DDRI, for instance. I didn’t change the Ancestor report.
  3. Update the .gpr.py registration file to point to the correct file and correct classes.

Attaching are 2 samples with the old (names ending with report.py) and the new code (names ending with reporti.py) as well as the revised .gpr.py files. The old code may have changed since I wrote the new code quite a while ago - so every diff may not be important.

See also

Sample Report Specifications


(Section)

Stub, english (default)

Gramps-notes.png

Please update or expand this section.


Gramps-notes.png

Ébauche

À compléter !

Si vous pouvez aider à la traduction ou l'adapter à la culture francophone.

N'hésitez pas à améliorer cette page.


Stub, french

Embeddable Snippets (Subsection)

Icons

Dashboard Dashboard
People People
Relationships Relationships
Family Family Families
Charts Charts
Events Events
Places Places
Geography Geography
Sources (v3.4.x) Sources
Citations Citations
Repositories Repositories
Media Media
Notes Notes
more of the standard icons

List object tools
STOCK_ADD STOCK_INDEX (used for share) STOCK_EDIT STOCK_REMOVE Symbol question.svg Symbol question.svg
Add Share Edit Remove Move
Upwards
Move
Downwards

Text formatting (Level 2 Subsection)

italic, bold, bold & italic

Images (Level 3 Subsection)
Fig. .1 A screenshot caption

Logo

Annotations of User Activities (Level 4 Subsection)
  • Commands you type at the command line
  • Filenames or Filenames
  • Replaceable text
  • Labels for buttons and other portions of the graphical interface
  • hint text for roll-over tooltip hints that identify elements of the graphical interface
  • Menu selections look like this: Menu ➡ Submenu ▶ Menu Item (always pad unicode symbols like these arrows with spaces so that robot translators see recognizable words)
  • Pop-up menu down arrowhead, (triangle) button
  • Buttons you can click
  • CTRL+D see Keybindings for a list of keyboard combinations used in Gramps.
  • Anything you type in
  • Checked - Selected Checkbox ☑ template
  • Unchecked - Checkbox that is ❏ unselected

Boxed annotations

Tango-Dialog-information.png
Title of Tip

Tips text.

Gramps-notes.png
Example Note

Notes text.

Gnome-important.png
WarningTitle/Heading

warning text