Use as e.g.
pandoc -f markdown -t markdown -F ./footnotify.py test --wrap=none
Transforms the file test
:
In a [recent blog post](http://blog.givewell.org/2016/07/19/update-givewells-web-traffic-money-moved-q1-2016/ "Tyler Heishman. “Update on GiveWell’s web traffic / money moved: Q1 2016”. July 19, 2016. GiveWell."), ...
into
In a recent blog post[^1], ...
[^1]: Tyler Heishman. “Update on GiveWell’s web traffic / money moved: Q1 2016”. July 19, 2016. GiveWell. <http://blog.givewell.org/2016/07/19/update-givewells-web-traffic-money-moved-q1-2016/>
This is mostly useful when converting from Markdown to LaTeX,
where by default Pandoc's LaTeX writer ignores the "title text" of a link (i.e.
the part of the link that is displayed when one hovers over the link in
a web browser; the penultimate word of this paragraph is an example of a
hyperlink with a title text).
I sometimes like to insert citation information in the title
text (as in the test
example above), so displaying it along
with the URL in a footnote makes sense. In other
words, this is a cheap way to obtain footnote citations when writing in Pandoc
Markdown, without having to deal with pandoc-citeproc
or any of that
BibTeX nonsense. Another benefit of this approach is that when converting from
Markdown to HTML, the links work as usual, in an intuitive way.