Support for Pandoc's (Haskell Core's) Table of Contents Write Option #64
Unanswered
simonvincenthk
asked this question in
Q&A
Replies: 1 comment
-
Hi @simonvincenthk! The code import pandoc
md = """
# Header 1
## Header 1.1
### Header 1.2
"""
doc = pandoc.read(md)
md_out = pandoc.write(doc, format="markdown", options=["-s", "--toc"])
print(md_out) should output - [Header 1](#header-1)
- [Header 1.1](#header-1.1)
- [Header 1.2](#header-1.2)
Header 1
========
Header 1.1
----------
### Header 1.2 (except that ATM, I am running into #65 for some recent versions of pandoc(/Haskell) ; with 2.9.x I think that you should be fine) What error do you get? Best regards, Sébastien |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'd like to use
pandoc
's (the haskell core's)--table-of-contents=true
/--toc=true
general writer option to automatically generate a table of contents when writing aPandoc
object to a markdown file.Every time I pass
--table-of-contents=true
or--toc=true
as anoption
to the.write()
method, I get an error.Accordingly, I'm wondering if this option is supported and if I need to do anything special to use it?
I'm using
pandoc
(haskell core) version 2.19.2, andpandoc
(python wrapper) version 2.3Best regards, Simon
Beta Was this translation helpful? Give feedback.
All reactions