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

Spec does not address reference style links #9

Open
jeffayle opened this issue May 20, 2020 · 3 comments
Open

Spec does not address reference style links #9

jeffayle opened this issue May 20, 2020 · 3 comments

Comments

@jeffayle
Copy link

re: void-linux/void-docs#286

vmdfmt converts all reference links to inline links and removes link reference tables. The spec does not address reference links at all.

My proposal for the spec:

  • links may be written either inline or reference style
  • reference table must appear in one piece at the end of the document sorted in a particular order (OR link references must appear directly after the paragraph in which the reference is first used)
  • if a url appears in a reference table then all links to that url must be in reference style
  • no url can be listed in the reference table under more than one name
  • every url listed in the reference table must be linked to somewhere in the document

By modifying vmd/internal/renderer/renderer.go: func link() to do a reverse reference lookup. If the url has a reference name attached, write the link in reference format (either [x] or [link text][x]. At the end of the document, output the reference table (if it's not empty after removing unused entries) in a particular order (if we sort by url then all the man pages will get grouped together).

@bobertlo
Copy link
Owner

This was discussed. I don't have time to explore this support in blackfriday. My main concern is the functional nature of this. Ideally there wouldn't be any ambiguity between the input and output. It could be done but I was leaning towards not implementing this for some sort of purity. I had a more strict and simple view of this project in the beginning. I would be open to proposals, but I don't think I have time to look into this myself at the moment.

@bobertlo
Copy link
Owner

I would entertain/review a PR addressing this and work with you if you feel it meets the philosophical leaning of the project. I certainly don't have time to persue this myself, but if you could provide a spec of how you think this could function semantically and technically we can talk.

I had some ideas but honestly they are long gone :)

@bobertlo
Copy link
Owner

But it would have to be a clean solution both technically and in mind of the void docs since it is the only downstream. If I had a bunch of time it would be nice to hunt down or write a better markdown parser for this specific purpose but it's sort of moot. I would almost rather redo this with line endings by sentence (for diffs) but that is not a simple task. Compromises were made for technical and pragmatic reasons.

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

No branches or pull requests

2 participants