您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
此仓库已存档。您可以查看文件和克隆,但不能推送或创建工单/合并请求。
 
 
 
 
 
 

22 行
532 B

  1. from path import Path
  2. import sys
  3. import subprocess
  4. def main():
  5. template = Path("build.in.ninja").text()
  6. to_write = template
  7. for md_file in Path(".").files("*.md"):
  8. to_write += f"build {md_file.with_suffix('.pdf')}: pandoc ../{md_file}\n"
  9. build_path = Path("build")
  10. build_path.mkdir_p()
  11. out = build_path / "build.ninja"
  12. out.write_text(to_write)
  13. process = subprocess.run(["ninja", "-C", build_path])
  14. if process.returncode != 0:
  15. sys.exit(1)
  16. if __name__ == "__main__":
  17. main()