sh 此脚本将完整的reStructuredText文件转换为Markdown文件。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 此脚本将完整的reStructuredText文件转换为Markdown文件。相关的知识,希望对你有一定的参考价值。

# This script converts a directory full of reStructuredText files into Markdown files.
# It uses pandoc to do the conversion.
#
# 1. Copy this script into the directory containing the .rst files
# 2. Run 'sh rst-to-md.sh'
# 3. Markdown files will be outputted with same filename as the original reStructuredText files

FILES=*.rst
for f in $FILES
do
  filename="${f%.*}"
  echo "Converting $f to $filename.md"
  # Remove -s flag to generate fragment file instead (i.e. no header or footer)
  `pandoc -s $f -t md -o $filename.md`
  # Uncomment to delete the source .rst files.
  # rm $f
done

以上是关于sh 此脚本将完整的reStructuredText文件转换为Markdown文件。的主要内容,如果未能解决你的问题,请参考以下文章