Pregunta

Markdown and footnotes so far

I'm referring to Markdown: Syntax at daringfireball.net, which seems to be primary source for Markdown syntax.

Markdown is known to be based on already existing formatting in mails and newsgroups. In mails and newsgroup, I often see something like this for footnote and forwarded references:

Blah, blah [1] blah, blah.

[1] http://somesite.com/somepage.html#someanchor

Surprisingly, this very common format, is not part of the primary Markdown reference. It only knows something like:

Blah, blah [some title][id] blah, blah.

[id]: http://somesite.com/somepage.html#someanchor

And I have never seen any using this spontaneously in either a newsgroup or a mailing list, while the former is very common.

I could just find something called PHP Markdown Extra, which has something closer to the common spontaneous usage, while different enough:

Blah, blah [^id] blah, blah.

[id]: http://somesite.com/somepage.html#someanchor

Closer, but I still never seen anyone using this in a newsgroup or mail.

The question

I wonder why a so much common usage is not part of the primary markdown reference, and even not part of any variant I know. If someone knows some reason for this, I'm interested in knowing this reason. On the other hand, if I just missed something, like missing a markdown variant which is of very common use and includes the in practice most natural way of writing a footnote or forwarded reference (the first one introduced in this post), then I would like to know it.

¿Fue útil?

Solución 2

There're a few Markdown variations or 'flavours' out there that implement footnotes (besides Php Markdown Extra, which you mentioned). Those I'm aware of are Pandoc's Markdown, R Markdown, ScholarlyMarkdown, and MultiMarkdown.

I believe footnotes work this way in all of these variations:

This is some text with a footnote.[^] And another.[^]

[^]: Here is the first footnote.
[^]: Here is the second footnote.

Or inline:

This is some text with a footnote.^[Here is the first footnote.] And another ^[Here is the second footnote.]

They should both render this way:

This is some text with a footnote.1 And another.2


  1. Here is the first footnote. ↩
  2. Here is the second footnote. ↩

You can add links to footnotes too, for instance:

This is some text with a footnote and link.[^Here is an example of a footnote with a link at the end. [link](http://stackoverflow.com)]

Which should render like this:

This is some text with a footnote.1


  1. Here is an example of a footnote with a link at the end. link

Btw, if you use an editor such as Atom or VSCode, you may want to add the extension Markdown Preview Enhanced. As the name indicates, it allows previewing the rendered text as you type (it supports previewing and exporting with Pandoc).

Pandoc's documentation on the matter: https://pandoc.org/MANUAL.html#footnotes

Otros consejos

...why a so much common usage is not part of the primary markdown reference, and even not part of any variant I know.

It looks like some of it is available per How do I format my posts using Markdown or HTML?:

Links

Here's an inline link to [Google](http://www.google.com/). Here's a
reference-style link to [Google][1]. Here's a very readable link to
[Yahoo!][yahoo].

  [1]: http://www.google.com
  [yahoo]: http://www.yahoo.com/

Advanced Links

Links can have a title attribute, which will show up on hover. Title attributes can also be added; they are helpful if the link itself is not descriptive enough to tell users where they're going.

Here's a [poorly-named link](http://www.google.com/ "Google").
Never write "[click here][^2]".
Visit [us][web].

  [^2]: http://www.w3.org/QA/Tips/noClickHere
        (Advice against the phrase "click here")
  [web]: http://programmers.stackexchange.com/ "Programmers Stack Exchange"

Also see Markdown footnotes? at Meta. The page mentions Markdown With Footnotes.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top