翻译 RST(reStructuredText) 和转换为 MD(Markdown)

准备

安装 restbuilder

https://pythonhosted.org/sphinxcontrib-restbuilder/

安装 pandoc

https://pandoc.org/installing.html

操作

  1. 生成 rst 文件:
    make -e SPHINXOPTS="-D language='zh_CN'" rst

  2. 转换 rst 到 md 文件

#!/usr/bin/env bash

export pandoc="pandoc +RTS -V0 -RTS"

cd _build/rst 
FILES="*.rst"
for f in $FILES
do
  filename="${f%.*}"
  echo "Converting '$f' to '$filename.md'"
  $pandoc "$f" -f rst -t markdown -o "$filename.md"
done