Cloud-Awesome / markdown-maker

Lightweight library to assist creation of .md files (in GitHub and/or DocFX flavours)
MIT License
0 stars 0 forks source link

Add MdFootNote for GitHub footnotes #11

Open Cloud-Awesome opened 3 years ago

Cloud-Awesome commented 3 years ago

e.g.

// This can be included in an MdParagraph instance
var footnote = new MdFootNote{
    Reference: "1", // produces [^1] in markdown
    Footnote: new MdParagraph("This is the text, that can include other children such as MdLink, etc. etc.")
};

N.B. An MdDocument instance will need a private dictionary of all footnotes, not just the usual .MarkDown getter used in other classes, that they can be processed at the end of the document.

Don't think this is supported outside of GitHub (yet?). Should it be included in a GitHub-specific namespace?

Cloud-Awesome commented 3 years ago

Re. Having it as a separate namespace, I'm going to go with not splitting it out.[^1]

[^1]: For reference... https://github.blog/changelog/2021-09-30-footnotes-now-supported-in-markdown-fields/

My docfx-templates repo will implement them and either way, it's the only GFM item I'm aware of that isn't (yet) implemented elsewhere.

Do, however, put an XML comment on there so consumers are aware.

Cloud-Awesome commented 2 years ago

I can see numbering/naming the references themselves could cause issues... And at least it's a wasted effort... Given that the plan is to add them to a doc-level dictionary could it be auto-numbered instead?

PoC up an example input to test usage before implementation ;)