대용량 마크다운 단일 파일을 여러 HTML로 변환

대용량 마크다운 단일 파일을 여러 HTML로 변환

사이트(다중 HTML)를 생성할 수 있는 도구나 정적 사이트 생성기가 필요합니다.고유한별도의 섹션(Markdown 헤더)을 기반으로 하는 Markdown 파일입니다.

예를 들어, 내markdown.md:

# 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 파일멋진 기본 형식을 위해.

관련 정보