I am writing a large Markdown document and would like to place a table of contents of sorts at the beginning that will provide links to various locations in the document. Ho
In pandoc, if you use the option --toc in producing html, a table of contents will be produced with links to the sections, and back to the table of contents from the section headings. It is similar with the other formats pandoc writes, like LaTeX, rtf, rst, etc. So with the command
pandoc --toc happiness.txt -o happiness.html
this bit of markdown:
% True Happiness
Introduction
------------
Many have posed the question of true happiness. In this blog post we propose to
solve it.
First Attempts
--------------
The earliest attempts at attaining true happiness of course aimed at pleasure.
Soon, though, the downside of pleasure was revealed.
will yield this as the body of the html:
True Happiness
Introduction
Many have posed the question of true happiness. In this blog post we propose to solve it.
First Attempts
The earliest attempts at attaining true happiness of course aimed at pleasure. Soon, though, the downside of pleasure was revealed.