6

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?

mzjn
  • 48,958
  • 13
  • 128
  • 248
Himanshu Mishra
  • 8,510
  • 12
  • 37
  • 74
  • possible duplicate of [Have the same README both in Markdown and reStructuredText](http://stackoverflow.com/questions/10718767/have-the-same-readme-both-in-markdown-and-restructuredtext) – Chris Jun 20 '15 at 14:56

2 Answers2

13

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}

Himanshu Mishra
  • 8,510
  • 12
  • 37
  • 74
1

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.

G M
  • 20,759
  • 10
  • 81
  • 84