Convert markdown to reStructuredtest?

1.9k views Asked by At

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?

2

There are 2 answers

0
Himanshu Mishra On BEST ANSWER

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}

0
G M On

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.