markdown-it-footnote icon indicating copy to clipboard operation
markdown-it-footnote copied to clipboard

Add Options for rendering footnotes

Open mathertel opened this issue 2 years ago • 5 comments

By setting the backref option to false the backlinks in footnodes are not rendered and the links to the footnode do not contain sub-ids. This is especially useful on documents that reuse the same footnote annotation very often.

mathertel avatar Mar 02 '22 17:03 mathertel

This PR contains a lot of formatting garbadge. I don't see real changes. Please remove everything, not related to your proposal.

puzrin avatar Mar 02 '22 18:03 puzrin

right, there are not much changes.

  • readme changes
  • default options (compatible)
  • enabling some parameters (self) to get access to the rules
  • conditional rendering: e.g. if (slf.rules.footnote_options.backref) { ...

You can switch off whitespace-only changes caused by inline tabs and comment alignment: https://github.com/markdown-it/markdown-it-footnote/pull/46/files?diff=unified&w=1

Do you have a formatting rules file of any defined formatting I can apply ?

mathertel avatar Mar 02 '22 19:03 mathertel

IMO result of proposed option can be solved by simple renderer functions override. We try to keep options as minimal as possible for such case, to keep api clean.

puzrin avatar Mar 02 '22 21:03 puzrin

I try to keep things simple for consumers too.

However I do not agree because overwriting 3 functions for effectively adding 3 if statements is somehow complex instead of giving an optional option.

Your opinion as a gatekeeper counts (as mine counts on my open source projects).

mathertel avatar Mar 03 '22 06:03 mathertel

I understand your intent, but it's global policy for all repos in this org. If something can be done via plugins - it should be done via plugins instead of options request. You can make a separate package to patch renderers, as alternative.

puzrin avatar Mar 03 '22 16:03 puzrin