Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Cross-linking with any section #122

Closed
about-code opened this issue Dec 5, 2020 · 0 comments · Fixed by #134
Closed

Feat: Cross-linking with any section #122

about-code opened this issue Dec 5, 2020 · 0 comments · Fixed by #134
Labels
enhancement New feature or request
Milestone

Comments

@about-code
Copy link
Owner

about-code commented Dec 5, 2020

User Story

Currently links are only produced for headings in documents configured to be glossaries. As a writer I would like to have an option to treat every document like a glossary and every heading in a document like a term in order to automatically link words or phrases matching a headline.

Implicit Cross-Linking

Unambiguous heading phrases should be treated like a term and create a link by the same rules applying to terms of a glossary document.

Explicit Cross-Linking

Syntax

It should be possible to explictly declare a cross-link target (e.g. for ambiguous heading phrases) using a pandoc-style custom heading id and a markdown-compatible pandoc-style heading-id link syntax:

[link label](#custom-heading-id)

Semantics:

While the syntax should be identical to that of pandoc's its semantics should be extended such that #custom-heading-id will be considered unique within the whole body of documents being processed not only within the document it's been declared.

glossarify-md may modify such a link by the following rules:

  • Given #custom-heading-id is unique accross documents then a path to the file declaring #custom-heading-id should be prepended (see example below)
  • Given #custom-heading-id is not unique accross documents then local declaration should take precedence over external declaration.
  • Given #custom-heading-id is not unique accross documents and there is no local declaration, either, then it should not be modified.
[link label](./external.md#custom-heading-id)
@about-code about-code added the enhancement New feature or request label Dec 5, 2020
@about-code about-code added this to the v5.0.0 milestone Dec 20, 2020
about-code added a commit that referenced this issue Dec 21, 2020
BREAKING CHANGE: affects **v5.0.0-alpha.0** or **v5.0.0-alpha.1**, only. 
Renamed option `linking.terms` to `linking.mentions`. Please rename the
option in your config file.

fix: Being more robust if no glossary file is available.
chore(docs): Show preferred --init command for installation method
chore(upgrade): Make sure to only upgrade to versions compatible with default schema

test: New baseline.
about-code added a commit that referenced this issue Jan 9, 2021
Previously an URL at the syntactic position of a link label could
result in the colons after the URL proctocol scheme being escaped
by a backslash:
~~~
[https\://github.com//issues/122][1]
~~~

An update of mdast-util-to-markdown (0.6.1 -> 0.6.2) fixes this.
New output is:
~~~
[#122]
~~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant