@johnls/markdown-book
v1.2.0
Published
A tool for collating Markdown books, whitepapers and essays
Readme
Markdown Book
A tool for making books, whitepapers, essays and other long documents out of a collection of Markdown files. It can:
- Collate multiple Markdown files into one document in the process
- Adjusting all heading depths
- Optionally adding section numbering
- Add an indented table of contents (TOC)
- Generate a PDF or just a bigger Markdown file
Installation
Install the tool with:
npm install markdown-bookor run it with:
npx markdown-bookUsing It
Create a JSON5 document containing:
{
title: "A Book About Nothing",
toc: true,
number: true,
files: ["./part1.md", "./part2.md", "./part3.md"],
}titlewill be the top level, single#, for the book.tociftruewill include a table of contents after the title.numberiftruewill insert a section number in all headings in the format 1.1.1, separated by a colon:.filesis an array of files relative to the.json5file.
The tool expects ATX headings (leading #'s). If you have Setext headings (- or = underlines) they will be ignored.
Any images that are references by local file paths will be adjusted to the new relative path to the image from the output .md file. URL image references will not be modified.
