Best way to automatically number sections

John MacFarlane jgm at berkeley.edu
Thu Oct 27 15:45:32 EDT 2011


This may work for you:

pandoc --number-sections -t html | pandoc -f html -t markdown

John

+++ David Sanson [Oct 27 11 10:29 ]:

> Pandoc has a `--number-sections` flag that enables automatic section

> numbering in various output formats. If you are using TextMate and the

> [Pandoc.tmbundle], you can use the bundle editor to add that flag to

> the conversion commands.

>

> But if you are looking to automatically add numbering to the markdown

> source itself, e.g., transforming

>

> ~~~

> # this

>

> ## this

> ~~~

>

> into

>

> ~~~

> # 1. this

>

> ## 1.1. this

> ~~~

>

> then I don't know of any easy way to do that.

>

> Best,

> David

>

> [Pandoc.tmbundle]: https://github.com/dsanson/Pandoc.tmbundle

>

> On Thu, Oct 27, 2011 at 6:14 AM, Andromac <andromac at mac.com> wrote:

> > Hi list

> >

> > Would anyone suggest the most simple approach to automatically number sections and sub-sections ?

> >

> > I usually use more than one tool to edit my Markdown files, including Byword, Textmate, etc.

> >

> > Thanks in advance

> > Christian Trotobas

> > _______________________________________________

> > Markdown-Discuss mailing list

> > Markdown-Discuss at six.pairlist.net

> > http://six.pairlist.net/mailman/listinfo/markdown-discuss

> >

>

>

>

> --

> David Sanson

> Assistant Professor of Philosophy, Ohio State University

> http://davidsanson.com

> _______________________________________________

> Markdown-Discuss mailing list

> Markdown-Discuss at six.pairlist.net

> http://six.pairlist.net/mailman/listinfo/markdown-discuss



More information about the Markdown-Discuss mailing list