myMake.sh 692 B

12345678910111213141516171819202122232425
  1. #!/usr/bin/env bash
  2. md_list=`find source -iname '*.md'`
  3. for md_item in ${md_list}
  4. do
  5. echo "============== process" ${md_item} "=============="
  6. target_file=$(echo ${md_item}| cut -d'.' -f 1 )
  7. target_file_dir=$(dirname ${target_file} )
  8. target_file_name=$(basename ${target_file})
  9. target_file_name=${target_file_dir}/src/${target_file_name}
  10. target_file=${target_file_name}".rst"
  11. if [ -f ${target_file} ]
  12. then
  13. echo rm ${target_file}
  14. rm ${target_file}
  15. fi
  16. echo pandoc --from=markdown --to=rst --output=${target_file} ${md_item}
  17. pandoc -V lang=zh_CN --from=markdown_github --to=rst --output=${target_file} ${md_item}
  18. done
  19. make html