Marki

Phillip England_

marki

A runtime for content-driven developers who just want to turn .md into .html. Run marki in the background, write your content, and use the generated html. Dead simple.

Installation

1go install github.com/phillip-england/marki@latest

Usage

 1run:
 2marki run <SRC> <OUT> <THEME> <FLAGS>
 3marki run ./indir ./outdir dracula
 4marki run ./indir ./outdir dracula --watch
 5marki run ./infile.md ./outfile.html dracula
 6marki run ./infile.md ./outfile.html dracula --watch
 7
 8# to avoid issues with commas, we use <<EOF to pipe multiple lines of input to marki
 9convert:
10	marki convert <THEME> <MARKDOWN_STR>
11	marki convert dracula <<EOF
12		# My Header
13		some text
14		EOF

Themes

Marki uses Goldmark for converting markdown into html.

Goldmark uses Chroma for syntax highlighting. All the available themes for chroma can be found in the .xml files listed here.

The first theme is abap.xml, so to use it with marki call:

1marki run <SRC> <OUT> abap --watch

Metadata

Use YAML-style frontmatter in your markdown to generate HTML <meta> tags for your content. For example, the following markdown:

1---
2metaDescription: "my description"
3---
4# Content
5some markdown content

will result in the following HTML:

1<meta name='metaDescription' content='my description'>
2<!-- MARKI SPLIT --><h1 id="content">Content</h1>
3<p>some markdown content</p>

You can then split off the HTML by splitting the string by <!-- MARKI SPLIT -->, making it easy to parse out meta content from UI content.