Generate Static Websites from Directories of Markdown Files.
- Convert single files from Markdown to HTML
- Commonmark specification compliance
- Watch Mode that detects File changes and recompiles those Markdown files
- Capability to add custom HTML-Headers and -Footers
- Linking file against a CSS style sheet
- Convert nested directory structure of Markdown files to interlinked HTML-Pages
-
Updating relative links to other Markdown files to point to their respective HTML output
-
Linking all files against a single CSS style sheet
-
To install mdmake from source, first set up a Rust tool chain including Cargo.
Simply clone, then build and install the project!
git clone https://github.com/markichnich/mdmake --depth=1 &&
cargo install --path mdmake
or alternatively
git clone https://github.com/markichnich/mdmake --depth=1 &&
cd mdmake && cargo build --release && sudo cp target/release/mdmake /usr/bin
First, set up a directory hierarchy of Markdown files within a folder.
Unless specified, mdmake
tries to use ./src
as the source folder.
src
โโโ index.md
โโโ food
โ โโโ fried_rice.md
โ โโโ spaghetti_carbonara.md
โโโ gardening
โโโ cacti.md
Then execute mdmake
.
When not specifying an output folder. ./out
will be used.
โโโ index.md
โโโ food
โ โโโ fried_rice.md
โ โโโ spaghetti_carbonara.md
โโโ gardening
โโโ cacti.md
out
โโโ index.html
โโโ food
โ โโโ fried_rice.html
โ โโโ spaghetti_carbonara.html
โโโ gardening
โโโ cacti.html
Additionally,
mdmake
will look forstyle.css
,header.html
andfooter.html
in the input directory.
- If a style sheet is found, it will be copied to the output directory and all HTML files will be linked against it automatically.
- If a header/footer if found, it will be prepended/appended to the HTML bodies of the output files.
You can also manually specify the input- and output directories, as well as style sheet-, header- and footer files.
Generate static websites from a directory of markdown files.
Usage: mdmake [OPTIONS] [COMMAND]
Commands:
watch, -w Watch for changes and automatically recompile.
help Print this message or the help of the given subcommand(s)
Options:
-i, --input [<DIRECTORY>] The project root of the markdown files.
-o, --output [<DIRECTORY>] The destination for the compiled webpage.
--style [<FILE>] The CSS-stylesheet to use for all html files.
--header [<FILE>] The HTML-header to prepend to all HTML-Bodies.
--footer [<FILE>] The HTML-footer to append to all HTML-Bodies.
-h, --help Print help
-V, --version Print version
- Inspiration from
ssg
by Roman Zolotarev