Typst + Pandoc
Markdown to PDF and EPUB.
typst-pandoc is a template and build workflow for writing books in Markdown. Pandoc brings the chapters together and converts them to Typst for PDF typesetting, while the same source can also produce an EPUB.

Structure in the source
Chapters live in separate files, ordered by their numeric prefixes. Metadata and bibliography files keep the title, authors, and references separate from the text. A Makefile builds both formats and can watch for changes during writing.
The Typst template
The Typst template supports drop caps, sidebars, margin notes, and custom headers and footers.
Browse the sample PDF or use the repository as a starting point for a book or longer technical document.