Convert markdown to reStructuredtest?
Asked Answered
E

2

7

How can I convert a file named index.md into a reStructuredText fileindex.rst without manual editing or anything?

How about vice-verse?

What is the general syntax of such changes?

Eleen answered 20/6, 2015 at 10:34 Comment(1)
possible duplicate of Have the same README both in Markdown and reStructuredTextTurbary
E
16

pandoc --from=markdown --to=rst --output=index.rst index.md

For the reverse you can try pretty much the same thing

pandoc --from=rst --to=markdown --output=README.md README.rst

The general syntax is

pandoc --from={type} --to={type} --output={filename} {input-filename}

Eleen answered 20/6, 2015 at 10:34 Comment(0)
S
2

There is a quicker syntax if you have the right file extensions:

pandoc -s README.md -o README.rst

Where -s stands for source and -o for output.

Scurrility answered 10/12, 2022 at 8:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.