semiliterate is a standalone extraction engine and CLI for building markdown
documentation from semiliterate source files. It preserves the extraction
behavior from mkdocs-simple-plugin without depending on MkDocs.
pip install -e .
semiliterate build --source . --out .build-docs
Options:
--config PATH: load YAML config--source PATH: source tree root--out PATH: output tree--include-mode copy|symlink|skip: how included files are materialized--dry-run: scan and report without writing files-v, --verbose: enable info loggingThe YAML config is intentionally close to the previous plugin config:
folders:
- src
- examples
ignore:
- .git/**
- node_modules/**
- _site/**
include:
- "*.md"
- "*.png"
semiliterate:
- pattern: ".*"
terminate: "^\\W*md-ignore"
extract:
- start: "^\\s*\"\"\"\\W?md\\b"
stop: "^\\s*\"\"\"\\s*$"
If you want to keep the built-in defaults and add a few more file types,
use include_extra and ignore_extra:
include_extra:
- "*.csv"
- "*.webp"
ignore_extra:
- "_build/**"
include and ignore still replace the defaults if you set them directly.
from semiliterate import ExtractionPattern
from semiliterate import Semiliterate
from semiliterate import build_docs
build_docs(source=".", out=".build-docs")
Useful exports:
SemiliterateExtractionPatternSimpleScannerbuild_docsload_configmkdocs-simple-plugin..mkdocsignore, include matching, hidden-file handling, and destination file
naming follow the original implementation.Given a source file:
"""md
# Title
Some docs.
"""
Running:
semiliterate build --source . --out .build-docs
creates:
.build-docs/<source-file-basename>.md