accordproject / markdown-transform

Parse and transform markdown text, including TemplateMark markdown templates
Apache License 2.0
71 stars 49 forks source link

Support cross-referencing within the template text #350

Open OliverTod opened 3 years ago

OliverTod commented 3 years ago

Feature request: Based on the existing practice of using automatic cross references in MSword, it would be good to have a way to easily and dynamically cross reference within the contract text. This could be references to a heading (for example, the title of the document, a schedule or a clause), a specific numbered paragraph or even a span of text within a paragraph (though this is rare).

This may already be possible using html tags or the markdown syntax: [link title](link)

The main requirement is that the link title text should match the paragraph number of the text it references. That is, editing the text (ie adding or deleting lines so that the referenced paragraph number changes) should result in the link title changing also. The link is to the particular paragraph text and not the position of that text in the document.

We need to be cautious that adding this functionality will not disrupt the readability of the raw-markdown file. I am not sure that adding html tags will be an encouraging step for many people.

My initial thoughts are:

irmerk commented 3 years ago

The first thought I had when this was presented in the working group call was how markdown supports the format for links:

Sentence sentence [link1][linkReference1] sentence.

Paragraph sentence sentence.

[linkReference1]: www.something.com

And the [linkReference1]: www.something.com does not render. Maybe this could help us with creating and storing internal references @jeromesimeon?