A markdown-based templating tool. Write .textplate.md files with special text:: links, then run textplate press to resolve all references into plain markdown.
git clone <repo-url> && cd textplate
uv syncSource files are just plain text or markdown — nothing special about them:
# greeting.txt
Hello from a reusable snippet!
To pull a specific section from a markdown file, reference it by heading (GitHub-style slug):
# notes.md
## Intro
This part can be referenced by name.
## Other Stuff
This won't be included.Create a template (doc.textplate.md):
# My Document
[](text::./greeting.txt)
[](text::./notes.md#intro)Press it:
uv run textplate press doc.textplate.md # writes doc.md
uv run textplate press doc.textplate.md --stdout # prints to stdoutOr watch it and re-press automatically:
uv run textplate watch doc.textplate.md --every 5s[](text::./path/to/file.txt) # inline entire file
[](text::./path/to/file.md#section) # inline section body (heading excluded)
[](text::./path/to/file.md#section!) # inline section with its headingtext::prefix marks a template reference#fragmentuses GitHub-style heading slugs (lowercase, spaces→hyphens)- A section includes everything under a heading until the next heading of the same or higher level
- By default the heading line is excluded; append
!to include it (#intro!) - Output naming:
foo.textplate.md→foo.md. Otherwisefoo.md→foo.filled.md. - Strict mode: if any reference can't be resolved, the command fails with no partial output.
uv run pytestSee demo/ for a working example:
uv run textplate press demo/docs.textplate.md --stdout