How to add hyperlinks to date events in tree reports?

Using Gramps 5.1.3 on Linux.

Ancestor/relative events with dates like birth, marriage, death are sourced to (permalinked) URLs of publicly available in church registers, census records, and the like, in Gramps. Such URLs are stored as event notes.

In generating ancestry or descendant (pdf) reports I’d like the source URLs to be hyperlinked to the dates. The intent is when I share the pdf reports the report recipient can simply click on the dates and quickly view the relevant source material.

What’s the easiest way to achieve this? (I’m sufficiently well versed in python)

The sample reports where I found hyperlinks being generated only had Web file formats as output options. None of those offered PDF as an output option. Then I “Printed” a webpage to PDF and that did not preserve the hotlinks. The first thing to check is whether any of the PDF writing libraries used by Gramps are capable of being passed hyperlinks by existing reports with hyperlinks. That should be done before figuring out how to conjure hotlinks onto a field from your method of storing the URL.

But aside from that, the way you are associating URLs with data within the Gramps database seems a bit odd. Notes are free-form text and that seems like a fragile way to store URLs.

I do something similar except that I use Citations where the Page is the URL.

Some sources will have standard Permalink prefix strings. (Although the “Permanence” is questionable. One online source has changed the prefix 3 times in the last 5 years.) For ongoing maintenance reasons, I wanted to be able to edit the Prefix once instead of in every Citation. (Note that tools like the Isotammi PropertyEditor exist and would allow a mass Search & Replace. But updating dozens of Citations with a RegEx or Pattern search creates more potential failure points than directly editing a single record. And the mass updates also tweak the “Last Modified” timestamp on all those Citations. Which limits some of the Sorting value for those Citations.)

So, in these cases, my Source has the Prefix stored as an Attribute and the Citation Page stores their internal UID (Unique Identifier).

As an example, WikiTree as a (less than reliable) Source has a Prefix of “WikiTree: The Free Family Tree” and Sir Alec Guinness has a page UID of “De_Cuffe-1”. This concatenates to : “https://www.wikitree.com/wiki/De_Cuffe-1

I don’t want to stray afar from my original point of how to hyperlink URLs to dates in tree reports. Gramps can generate OpenDocument reports, which should be fully capable of containing hyperlinks. I don’t think that requires much programming logic, although I can be wrong on that.

I acknowledge there are various places and strategies where store source URLs in Gramps. In the “event editor” there is the “reference information” block, and there in the notes you can have a type “citation” where an URL is embedded.

If I read you correctly, the you store your citation URLs in the Event “Source Citation” block, but I believe that would be more appropriate for “XYZ Parish, Volume IX, folio 123” and the only way URLs can be embedded there is through notes.

If you run some tests, I think you fill find that at least some gramps reports (e.g. detailed descendant report) will export the link when you generate the report first to odt and then export the report to pdf (I reformat all my reports in LibreOffice before export to pdf so I can use standard preset styles, and various standard headers & footers).

As far as I can tell, it works even when the link is within the description of an event, not just within a note attached to the event and hyperlinked using the gramps link editor.

BUT, you may find that some of these links, while there is still an underlying hotlink, do not appear to the end user as being hotlinked. If they mouse over the URL for long enough, it does show the link, but its display on screen is sometimes indistinguishable from surrounding text.

I have not yet completed testing as to why the behaviour seems to be inconsistent, but I suspect gramps, or else the pdf export library used by LibreOffice, needs a whitespace before and after the URL to be able to reliably format it as different from surrounding text.

I think the main issue with some hotlinks not being formatted on the page so they look like hotlinks mainly affects those entered directly in the description field, and usually not those hotlinked within attached notes.

There is also the problem that your end user may be using yet another pdf viewer, which further complicates diagnosing what they may or may not see.

But I work on the principle that I hope my end users will be smart enough (if required) to copy and paste the (indistinguishable) URL text from my pdf, then paste it into their brower anyway!

Adrian,

Thanks for your response. Based on your response I placed URLs in the Event description fields, and generating a detailed descendant report to odt. The URLs did appear in that report successfully next to event dates.

That said, I’d appreciate if you can provide any pointers to help me figure out how to implement similar functionality in the graphical descendant/ancestor trees. The graphical trees, as currently implemented, do not contain any URLs/hyperlinks even if the Event descriptions fields are populated.

The graphical trees are a bit more conceptually more familiar to the target “lay” audience not involved in genealogical research than the Henry/D’Aboville/Register numbered detailed reports.

Thanks!