Bulk converts markdown (.md
) files to HTML (.html
) files and converts embedded markdown links to HTML links. Pandoc is required and must be in the path.
- Place
links-to-html.lua
andmd-to-html.sh
in the same directory as your markdown (.md
) source documents. - Edit the files to meet your needs.
- Run
md-to-html.sh
. HTML (.html
) files will be outputted to a subdirectory namedhtml
.
If you want to convert the resulting HTML collection to a single ebook, use ebook-convert
from https://github.com/kovidgoyal/calibre.
Assuming HTML files are in the html
directory and markdown files are in the present working directory:
$ cd html
$ ebook-convert index.html ebook.azw3 --title "$(head -1 ../index.md | cut -c 3-)"
This will create an ebook file named ebook.azw3
and use the first line of the source index.md
markdown file as the book's title.
- Install the Markdown All In One VS Code/Codium extension
- Open the Command Palette (Ctrl-Shift-P)
- Select
Markdown All In One: Print documents to HTML (select a source folder)