Footnotes in Markdown
Did you know - WordPress Markdown supports footnotes0? There is some documentation but I thought I'd write a slightly more comprehensive guide.
The code is pretty simple. Write [^1]
where you want your first footnote link to appear. Then, later in the document, write [^1]: The text of the note
.
It doesn't matter what number you put inside the [^…]
, WordPress automatically generates a sequential number when displaying the links. For example, this one is [^3]
1
In order to keep your thoughts straight while writing and editing, you can give your footnotes names - like [^fn about names]
2. If you want, you can also use emoji3. When you click that link, the emoji should appear in your URl bar.
Similarly, you can write the footnote text next to where you want the link to appear. Something like:
Something like[^5]
[^5]: See!
should work fine4.
Sadly5, there's no such thing as a <footnote>
element6 in HTML
WordPress automagically puts the footnotes at the end of your page in this structure:
HTML<div class="footnotes">
<hr>
<ol>
<li id="fn-1234-1"> ... <a href="#fnref-1234-1">↩</a></li>
...
This means you can style the div
and hr
7. The number after fn-
is the WordPress post ID.
There are a few other things to be aware of8, but they're pretty easy to use. No plugins required, no expensive themes. Just cool in-built functionality.
Enjoy!
-
Footnotes are hyperlinks which direct the user to some explanatory text. WordPress also automatically includes a link back to the text you were reading. ↩︎
-
But to you, should look like 2. Magic! ↩︎
-
The footnote link can contain spaces. Which is nifty. ↩︎
-
Emoji? You've never heard of Emoji?! ↩︎
-
See! ↩︎
-
Well, it makes me sad... ↩︎
-
Nor elephant ↩︎
-
As I have so beautifully done here. ↩︎
-
While they can't be recursive, a footnote can have its own footnote10 - if you think that would be useful. ↩︎
-
Just like Terry Pratchett! ↩︎
Neil Brown said on twitter.com:
This is how I do image attributions on my blogs.
Marcus Noble said on twitter.com:
I wish GitHub markdown supported this. ☹️