No project description provided
Project description
Slate
KISS, reliable, and accessible.
Slate is a lightweight Python CLI tool for converting Markdown to accessible static HTML pages, Gemtext, and Gophermaps. Designed for blogs, knowledge bases, and personal sites where simplicity is paramount.
Features
- Semantic HTML: Converts Markdown to accessible HTML5 with semantic tags.
- Multi-Format: Outputs to HTML, Gemini (Gemtext), and Gopher.
- Smart Updates: intelligently updates existing files without needing to re-specify arguments.
- Dynamic Links: Automatically converts
[!MD-PAGE]links to.htmlin the output, keeping your Markdown portable. - Customizable: Integrates with Jinja2 templates and outputs CSS-ready classes.
- Extensible: Easily add custom Markdown tokens via a registry system.
Quickstart
Install via pipx (recommended)
pipx install slate-md
Or, with pip:
pip install slate-md
Usage
Build a new page
slate build <input> <output> [flags]
input: Input Markdown file path.output: Output file path (e.g.,pages/post.html).-f, --format: Output format:html(default),gemini, orgopher.-T, --template: Jinja2 HTML template file (required forhtmloutput).-t, --title: Optional title override; otherwise the first H1 is used.-d, --description: Optional meta description for the template.
Update an existing page
Slate remembers the source file and template used to generate an HTML file.
slate update <output_file>
output_file: The existing HTML file to update.
You can still override the input or template if needed:
slate update output.html input.md -T new_template.html
Site Management (v0.2.0+)
Slate can now manage multi-page sites with auto-generated navigation and RSS feeds!
Create an index.md with categories:
---
categories: [blog, projects]
title: My Site
url: https://example.com
template: templates/default.html
---
Welcome to my site!
Create category root pages (blog.md, projects.md) and organize pages in directories:
your-site/
├── index.md
├── blog.md
├── blog/
│ ├── post1.md
│ └── post2.md
├── projects.md
└── projects/
└── my-project.md
Then rebuild your entire site:
slate rebuild
This will:
- Build all pages with auto-generated navigation
- Generate RSS feeds for blog categories
- Create table of contents from headings
- Apply consistent templates across your site
Frontmatter (v0.2.0+)
Add YAML frontmatter to your Markdown files:
---
title: My Blog Post
description: A great post about things
template: templates/blog.html
category: blog
type: blog # or "page"
date: 2024-12-01
author: Your Name
---
# Your content here
Frontmatter takes precedence over CLI arguments when both are present.
Dynamic Links
Slate supports "Dynamic Links" to keep your Markdown navigable on GitHub/Obsidian but working correctly on your site.
Use the [!MD-PAGE] token:
Check out my [!MD-PAGE] [Latest Post](posts/latest.md)
Slate converts this to:
Check out my <a href="posts/latest.html" class="content-link">Latest Post</a>
Template Variables
Your Jinja2 templates have access to these variables:
| Variable | Description |
|---|---|
{{ content }} |
The rendered content (HTML, Gemtext, or Gopher). |
{{ title }} |
The page title. |
{{ description }} |
The page description. |
{{ creation_date }} |
Original creation date (persisted in metadata). |
{{ creation_time }} |
Original creation time (persisted in metadata). |
{{ modify_date }} |
Last modification date. |
{{ modify_time }} |
Last modification time. |
{{ version }} |
Slate version. |
{{ nav_header }} |
v0.2.0+ Header navigation (links to categories). |
{{ nav_category }} |
v0.2.0+ Category navigation (links to pages). |
{{ category_name }} |
v0.2.0+ Current category name. |
{{ breadcrumbs }} |
v0.2.0+ Breadcrumb navigation. |
{{ toc }} |
v0.2.0+ Auto-generated table of contents. |
Why Slate?
Slate was created because many SSGs are needlessly complicated for me. Slate is a tiny tool that does one thing well: converts Markdown into accessible HTML (and other formats) using a template.
- No Config Files: Everything is CLI arguments or embedded metadata.
- Monolithic CSS: Designed to be used with a single CSS file.
- Hackable: The codebase is small and easy to extend. See
documentation/hackingfor details.
Documentation
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file slate_md-0.2.0.tar.gz.
File metadata
- Download URL: slate_md-0.2.0.tar.gz
- Upload date:
- Size: 36.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8579699060e4b3eebc4f1657fcfc808a22e1e4913e570e8e0e8a822fcf959ec
|
|
| MD5 |
44340725634243305fa85411f8d28f51
|
|
| BLAKE2b-256 |
e4a38c8048a5bb300b199ae1e8aca090216d5f94f37959cfd54f93213fb3b1e5
|
Provenance
The following attestation bundles were made for slate_md-0.2.0.tar.gz:
Publisher:
python-publish.yml on H41L33/slate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
slate_md-0.2.0.tar.gz -
Subject digest:
d8579699060e4b3eebc4f1657fcfc808a22e1e4913e570e8e0e8a822fcf959ec - Sigstore transparency entry: 735323445
- Sigstore integration time:
-
Permalink:
H41L33/slate@27c204b1fbc5a8193fbfd0e5ac8f64bf64fa6c83 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/H41L33
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@27c204b1fbc5a8193fbfd0e5ac8f64bf64fa6c83 -
Trigger Event:
release
-
Statement type:
File details
Details for the file slate_md-0.2.0-py3-none-any.whl.
File metadata
- Download URL: slate_md-0.2.0-py3-none-any.whl
- Upload date:
- Size: 38.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54da83281de1ec573c82bf7df8bb52c53258193ffb8758c093daf42588d8aad2
|
|
| MD5 |
c187b3b50201891341cb9d4ffc2e6807
|
|
| BLAKE2b-256 |
af4e39ac6acfcb43534947bb51a74c564999f5469b0d80fc42ea9d5942786b2b
|
Provenance
The following attestation bundles were made for slate_md-0.2.0-py3-none-any.whl:
Publisher:
python-publish.yml on H41L33/slate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
slate_md-0.2.0-py3-none-any.whl -
Subject digest:
54da83281de1ec573c82bf7df8bb52c53258193ffb8758c093daf42588d8aad2 - Sigstore transparency entry: 735323472
- Sigstore integration time:
-
Permalink:
H41L33/slate@27c204b1fbc5a8193fbfd0e5ac8f64bf64fa6c83 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/H41L33
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@27c204b1fbc5a8193fbfd0e5ac8f64bf64fa6c83 -
Trigger Event:
release
-
Statement type: