大きなマークダウン単一ファイルを複数の HTML に変換する

大きなマークダウン単一ファイルを複数の HTML に変換する

サイト(複数の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ファイル適切なデフォルトのフォーマットです。

関連情報