buildmd - Build markdown files to html with templates and metadata
Find a file
2025-06-06 12:00:22 -04:00
.run Add build script 2025-05-27 09:45:47 -04:00
demo Add basic support for callouts 2025-06-06 11:50:21 -04:00
src Fix default style to prevent callouts overflowing 2025-06-06 12:00:22 -04:00
.gitignore Add build script 2025-05-27 09:45:47 -04:00
biome.json Initial commit 2025-05-24 13:19:39 -04:00
bun.lock Add basic support for callouts 2025-06-06 11:50:21 -04:00
LICENSE Update readme, add license 2025-05-27 09:38:42 -04:00
package.json Add basic support for callouts 2025-06-06 11:50:21 -04:00
README.md Clean up readme 2025-06-04 19:10:47 -04:00
tsconfig.json Initial commit 2025-05-24 13:19:39 -04:00

buildmd

Build markdown files to html

Usage

buildmd - Build markdown files to html with templates and metadata

Usage:
  buildmd file.md
  buildmd file.md -o output.html
  buildmd ./src/*.md --outdir public
  echo "some markdown" | buildmd

Options:
  --outfile, -o <file>    Output path
  --outdir,  -d <dir>     Output directory
  --stdout                Force output to stdout
  --template, -t <file>   Template path (default: _template.html)
  --stylesheet, -s <file> Stylesheet path (default: _style.css)
  --title, -T <string>    Document title override
  --help, -h              Show this help message

Templates

buildmd uses HTML files as templates. Instances of %key% are replaced with value of key from the built document.

You can provide a template path with the --template or -t flag. If no template flag is provided, buildmd will look for a _template.html file in the current directory. If no template file is found, a simple default template will be used.

Stylesheets

buildmd supports custom stylesheets. You can specify a stylesheet with the --stylesheet or -s flag.

If no stylesheet is specified, buildmd will look for a _style.css file in the current directory.

If no stylesheet is found, a default stylesheet will be used.

Data

The following keys are always available in the template data:

  • title: The title of the document
  • content: The rendered markdown content
  • stylesheet: The document css styles
  • timestamp: An ISO string representing when the build occurred
  • datetime A localized string representing when the build occurred

Additionally, any data defined in YAML frontmatter in the markdown file will be available in the template. Properties defined in frontmatter take precedence over the default metadata.