FHIR Chat · Link to here · IG creation

Stream: IG creation

Topic: Link to here


view this post on Zulip Grahame Grieve (Feb 10 2021 at 02:30):

@Lloyd McKenzie the IG template is bringing up a 'link to here' link that's some hack of the heading text.

here's an example, courtesy of @John Moehrke : http://build.fhir.org/ig/IHE/ITI.MHD/branches/master/StructureDefinition-IHE.MHD.Minimal.DocumentReference-mappings.html#mappings-for-xds-and-mhd-mapping-xds

This is a reference to the section by the text of the header. the IG publisher doesn't know anything about this, and so if an editor right clicks on the link, and pastes that into their markdown somewhere, the IG publisher will complain, because there's no matching anchor.

The 'link to here' links used to use the anchors, not some made up text. So this is new so far as I know. Is the algorithm documented anywhere?

view this post on Zulip Lloyd McKenzie (Feb 10 2021 at 02:53):

The "hack of the heading text" sounds like what markdown creates as ids for headings (which is one of the many things I hate about markdown). Is this a markdown-authored IG? Are the ids no longer being assigned to markdown generated text? Is the same problem manifesting in other markdown-authored IGs? I haven't touched the templates in over half a year, though there have been a few pull requests from others. None that jump out as likely culprits though...

view this post on Zulip Grahame Grieve (Feb 10 2021 at 02:55):

something is generating the id on the fly, because the id is not in the html source. So it's not from markdown

view this post on Zulip Lloyd McKenzie (Feb 10 2021 at 02:59):

The process the template uses for HTML pages that don't have preceding <name/> elements is to embed a name that is the hierarchical section number. It definitely isn't driven by the section heading. @Jose Costa Teixeira, does the IHE template override this or do something different?

view this post on Zulip Jose Costa Teixeira (Feb 10 2021 at 07:27):

IHE template does not do anything on the pages

view this post on Zulip Jose Costa Teixeira (Feb 10 2021 at 07:37):

where is the "link to here"?

view this post on Zulip Jose Costa Teixeira (Feb 10 2021 at 08:02):

@Grahame Grieve image.png
if you mean this link, it is created in the java renderer

view this post on Zulip Jose Costa Teixeira (Feb 10 2021 at 08:12):

I think here: https://github.com/HL7/fhir-ig-publisher/blob/9930b5f632d94ef4bbfbf2b849a279823b4473d9/org.hl7.fhir.publisher.core/src/main/java/org/hl7/fhir/igtools/renderers/StructureDefinitionRenderer.java#L1282

view this post on Zulip Grahame Grieve (Feb 10 2021 at 20:31):

no, it's this link I'm talking about:

view this post on Zulip Grahame Grieve (Feb 10 2021 at 20:35):

image.png

view this post on Zulip Grahame Grieve (Feb 10 2021 at 20:35):

I can't get it to actually display, courtesy of using an apple keyboard without a print screen key.

view this post on Zulip Jose Costa Teixeira (Feb 10 2021 at 20:50):

this?

view this post on Zulip Jose Costa Teixeira (Feb 10 2021 at 20:50):

image.png

view this post on Zulip John Moehrke (Feb 10 2021 at 20:57):

yes, I found that in my structure definition mapping page, and pasted (without the root) into my markdown.

view this post on Zulip John Moehrke (Feb 10 2021 at 20:58):

see the top of this thread

view this post on Zulip Jose Costa Teixeira (Feb 10 2021 at 21:01):

so the issue is not the link appearing, but the fact that this url will cause an issue in the publisher?
http://build.fhir.org/ig/IHE/ITI.MHD/branches/master/index.html#organization-of-this-guide

view this post on Zulip John Moehrke (Feb 10 2021 at 21:02):

in my view, that is the problem. everything is functioning properly, but the IG build flags this as an error.

view this post on Zulip Grahame Grieve (Feb 10 2021 at 21:02):

how does it appear? It's not in the generated html

view this post on Zulip John Moehrke (Feb 10 2021 at 21:03):

magic?

view this post on Zulip Jose Costa Teixeira (Feb 10 2021 at 21:03):

it's here:

view this post on Zulip Jose Costa Teixeira (Feb 10 2021 at 21:04):

https://github.com/HL7/ig-template-base/blob/master/includes/fragment-pageend.html#L32:L38

view this post on Zulip Jose Costa Teixeira (Feb 10 2021 at 21:05):

(If I remember correctly.)
This is a function that generates anchors for every header

view this post on Zulip Jose Costa Teixeira (Feb 10 2021 at 21:06):

I'm trying to confirm by checking the library behind the links

view this post on Zulip Jose Costa Teixeira (Feb 10 2021 at 21:07):

this is the library
https://github.com/HL7/ig-template-base/blob/8747a729c635bb7ca8f3940a4a9902ffe9fe2acb/includes/fragment-pageend.html#L64-L66

view this post on Zulip Jose Costa Teixeira (Feb 10 2021 at 21:10):

( please someone confirm, I'm not friends with javascript)

view this post on Zulip Eric Haas (Feb 11 2021 at 00:38):

that kebab case id ( e.g. 'organization-of-this-guide') is a feature of Jekyll out of the box. among other things is allows for the page TOC generation. Docs here: https://jekyllrb.com/docs/configuration/markdown/

view this post on Zulip Eric Haas (Feb 11 2021 at 00:39):

and yes it fine works within a page but sadly across pages there is an issue with the ig-publisher validator.

view this post on Zulip Lloyd McKenzie (Feb 11 2021 at 01:12):

Fixed ids that don't change when you alter the phrasing of the title are better...

view this post on Zulip John Moehrke (Feb 11 2021 at 01:14):

I don't disagree @Lloyd McKenzie , but I am using what I got. it works, it is easy. Tell how to do it differently. I want to be able to point the narrative at the specific mapping.

view this post on Zulip John Moehrke (Feb 11 2021 at 01:14):

especially useful because my IG mapping is listed last on the page, not first.

view this post on Zulip Grahame Grieve (Feb 11 2021 at 01:31):

ok. sorted next release

view this post on Zulip Lloyd McKenzie (Feb 11 2021 at 01:40):

@John Moehrke It's not terribly easy to do in markdown.

view this post on Zulip Eric Haas (Feb 11 2021 at 20:09):

Grahame Grieve said:

ok. sorted next release

what exactly is sorted, can we use jekyll generated ids now as anchors without getting dinged by the validator?

view this post on Zulip Grahame Grieve (Feb 11 2021 at 20:18):

they're not jekyll generated. They are generated in the browser. But yes, you can use them


Last updated: Apr 12 2022 at 19:14 UTC