![大きなマークダウン単一ファイルを複数の HTML に変換する](https://rvso.com/image/1413941/%E5%A4%A7%E3%81%8D%E3%81%AA%E3%83%9E%E3%83%BC%E3%82%AF%E3%83%80%E3%82%A6%E3%83%B3%E5%8D%98%E4%B8%80%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%82%92%E8%A4%87%E6%95%B0%E3%81%AE%20HTML%20%E3%81%AB%E5%A4%89%E6%8F%9B%E3%81%99%E3%82%8B.png)
サイト(複数のHTML)を生成できるツールまたは静的サイトジェネレータが必要です。個性的個別のセクション (Markdown ヘッダー) に基づく Markdown ファイル。
例えば、私のマークダウン:
# Title
## Lesson 1
[...text and content...]
## Lesson 2
[...text and content...]
結果サイトが生成されました:
- main.html
|
|--- lesson1.html (with link "next")
|
|--- lesson2.html (with link "prev" and "next")
|
私が使うパンドック(TOC 機能は非常に便利です) うまく機能しますが、これは pandoc では不可能だと思います。助けてください。
答え1
ファイルを epub 形式に変換します。これにより、ドキュメントを個別のファイルに分割できるようになります。
pandoc -f markdown -t epub -o myfilename.epub markdown.md
次に、epub ファイルを解凍します。結果として得られる .xhtml ファイルは、\text フォルダーの下に保存されます。
興味深いオプション:
--epub-chapter-level=3 // Header level where file is split
--epub-subdirectory=. // name of the folder with content inside the epub archive
--toc-depth=4 // generate table of contents with this number of header levels
--css=.\pandoc.css // apply CSS styles
チェックこの.cssファイル適切なデフォルトのフォーマットです。