pandoc プログラム仕様
Pandoc専用:MarkdownのWord/PowerPoint/HTML変換とテンプレート生成。 - AI処理は一切ありません(tkai_lib不要) - 例:
# テンプレート生成 python pandoc_convert.py --make_template docx --template template_textbook.docx python pandoc_convert.py --make_template pptx --template template_slide.pptx
# 変換 python pandoc_convert.py --convert docx --infile lecture_textbook.md --template template_textbook.docx python pandoc_convert.py --convert pptx --infile lecture_slide.md --template template_slide.pptx python pandoc_convert.py --convert html --infile lecture_textbook.md --mathml python pandoc_convert.py --convert html --infile lecture_textbook.md --css custom_style.css
- converter.pandoc.convert_md(infile_md, target, pandoc_path, outfile=None, template=None, toc=False, css=None, mathml=False, no_yaml=False, verbose=False, smart_conversion=False)[ソース]
Library API for md -> docx/pptx/html
- converter.pandoc.convert_with_pandoc(pandoc_path: str, target: str, infile_md: str, outfile: str, template: str = None, css: str = None, no_yaml: bool = False, args=None)[ソース]
- converter.pandoc.correct_markdown_pandoc_error(md_text: str, base_dir: Path = None) str[ソース]
pandoc がエラーを出す典型的な Markdown の問題を自動修正する。 - YAML と誤判定される --- の前後に空行を追加(ただし本物の YAML は保持) - 存在しない画像・リンクを無害化(コード化) - $$ inline $$ のような1行ブロック数式を、pandoc が確実に読めるブロック形式に正規化 - 生成AIがよく出す $[ ... ]$ を $$ ... $$ に変換
- converter.pandoc.find_pandoc() str | None[ソース]
pandoc 実行ファイルのパスを探す。 優先順位: 1. 環境変数 pandoc_path 2. 環境変数 tkProg_path に基づく既定配置
Windows: {tkProg_path}/tkApp_Win/pandoc/pandoc.exe
Linux: {tkProg_path}/tkApp_Linux/pandoc/pandoc
3. PATH 環境変数から探す 見つからなければ None を返す。