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

[Feature Request] Automatic Endnote Ordering #391

Open
AllanWang opened this issue Mar 11, 2019 · 7 comments
Open

[Feature Request] Automatic Endnote Ordering #391

AllanWang opened this issue Mar 11, 2019 · 7 comments
Labels
Needs Discussion We haven't decided what to do.

Comments

@AllanWang
Copy link

I'm willing to help with the implementation!

Endnotes are additional bits of explanations added at the end of documents. Typically, you'd tag the relevant sentence with an index:

sentence to be expanded [1]

and have it linked to the information:

1. explanation.

Indices should be in order, which gets annoying when done manually.
I was wondering if we could add a feature similar to TOC, where we can automatically organize and number endnotes.


Currently, my example is like so:

A tagged sentence ends with something of the format [[1](#cite-tag)]

and the end of my document contains something like:

# Endnote

| | |
|---|---|
| <a id="cite-tag">1</a> | explanation |

Formatting would basically involve finding all instances of \[\[([0-9]+)\]\(\#cite-([a-zA-Z]+)\)\]
as well as the table, and ordering based on the #cite-* occurrences.

To prevent unwanted endnote formatting, perhaps the table can have a comment such as <!-- endnote -->, much like TOC.

There are also other constraints such as the ability to use superscripts for endnotes or to display endnotes as a list vs a table.


Would you be interested in adding such a feature to this plugin?
If so, how do you feel about the customization, and in ensuring that people have a way to disable it if they have their own #cite-* ids?

@yzhang-gh
Copy link
Owner

I feel like there are already many different kinds of similar Markdown dialects. (e.g. Markdown Footnotes).

Personally, I would like not to "invent" a dialect again.

But if some of them are really popular/widely accepted (e.g. GitHub Flavored Markdown), I am happy to support them.

@yzhang-gh yzhang-gh added the Markdown dialect Neither GFM, nor extensions currently accepted. label Mar 11, 2019
@AllanWang
Copy link
Author

Yeah this isn't meant to be a new dialect. It's meant to support stuff like github flavoured markdown

@yzhang-gh
Copy link
Owner

For your case, a better way is to implement a markdown-it extension. (VSCode uses markdown-it to render Markdown)

@AllanWang
Copy link
Author

I wonder if this is related to rendering, since the goal is to avoid supporting any new notations.
Would this not be similar to TOC where we just parse and update the file?

@yzhang-gh yzhang-gh removed the Markdown dialect Neither GFM, nor extensions currently accepted. label Mar 11, 2019
@yzhang-gh
Copy link
Owner

Alright, I was misled by the title "endnote support". So what you expect is essentially "endnote sorting/organizing", right?

The problem is I don't think there are many people using this, even with the above footnote extension. It is annoying to write endnotes/footnotes with Markdown, not only because of manual sorting.

@AllanWang
Copy link
Author

Yeah my mistake. It's certainly annoying to organize manually, which is exactly why a script would help. I could also write a general python script for my personal use, but given that I use this extension, I figured it would be a useful addition to others.

In terms of interest, there are some posts about it:

github/markup#498
https://stackoverflow.com/questions/25579868/how-to-add-footnotes-to-github-flavoured-markdown

Ultimately it's still up to you whether or not you'd like to add the feature to this extension

@AllanWang AllanWang changed the title [Feature Request] Endnote support [Feature Request] Automatic Endnote Ordering Mar 11, 2019
@yzhang-gh
Copy link
Owner

Thanks for the suggestion. I will leave this open to see what other people think of.

@yzhang-gh yzhang-gh added the Needs Discussion We haven't decided what to do. label Mar 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Discussion We haven't decided what to do.
Projects
None yet
Development

No branches or pull requests

2 participants