Skip to content

Use reference links in Markdown. #1025

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

Closed

Conversation

jaydenseric
Copy link
Contributor

This can dramatically reduces the volume of markdown. Fixes #948.

This approach might be problematic when inserting markdown under a readme heading if the readme already has link references with conflicting IDs.

One option might be to use a customizable prefix for the numeric link IDs to act as a namespace. Perhaps using the insertion heading string by default?

For the record, I did try remark-defsplit but chose not to use it:

  • It does not consolidate link references at the end of the markdown, but at the end of the first section in which they are used. This seemed fragmented and messy.
  • Although the string references are more readable, they are longer than using numbers.
  • If we solve the namespacing issue with a prefix, the string id's will be confusing since they are meant to display the subdomains and domain of the link URL.

What seems like a good idea for an alternative, is a Remark plugin that creates references based on short hashes of the URI being referenced. That way, you only need to worry that the bookmark IDs being linked are document-unique, which is something that needs to happen regardless.

Fixes documentationjs#948.

This approach might be problematic when inserting markdown under a readme heading if the readme already has link references with conflicting ID’s.
@tmcw
Copy link
Member

tmcw commented Mar 2, 2018

Merged in #1031 which fixes tests & disables this in readme mode. Thanks!

@tmcw tmcw closed this Mar 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use reference links for type docs
2 participants