RustPress
RustPress is a Rust-first static documentation generator. It reads a
rustpress.toml file, renders Markdown from docs/, writes static HTML into
dist/, and serves the generated site for development or preview.
The project is currently an MVP, focused on a small but complete documentation workflow.
Features
- Markdown rendering with tables, task lists, strikethrough, footnotes, heading attributes, and stable heading anchors.
- Mermaid fenced code blocks rendered in the browser.
- Built-in documentation theme with responsive navigation, sidebar, table of contents, local search, subtle grid background, and Light/Dark switching.
- Global search shortcut: press
Shifttwice to open search. - Multilingual docs using locale-prefixed routes.
- Local search index for English and CJK content.
- Front-end access mask for demo or lightweight viewing flows.
Access masking is a UI overlay only. It does not encrypt static files, remove HTML content, or provide server-side authentication.
Requirements
- Rust 1.93 or newer
Quick Start
Install the CLI from this checkout:
After the first crates.io release is published, you can use cargo install rust-press instead.
Create a new documentation project:
When working from this repository, pass the generated config path explicitly:
You can also run the CLI without installing it:
Commands
initcreatesrustpress.toml, starter Markdown pages, andpublic/.gitkeep.buildrenders the static site into the configuredout_dir.devbuilds, serves the site, watches Markdown/config changes, and injects a small live reload script.previewserves the already built static output.
Configuration
Minimal rustpress.toml:
= "My Docs"
= "docs"
= "dist"
= "/"
[[]]
= "Guide"
= "/guide/cli/"
= "guide"
[[]]
= "CLI"
= "/guide/cli/"
[[]]
= "Guide"
= "/guide/cli/"
[[]]
= "CLI"
= "/guide/cli/"
[]
= "default"
= "light"
= true
= "https://github.com/your-org/your-repo"
[]
= true
= true
= true
= true
[]
= true
= ["zh", "en"]
= false
[]
= true
= "mask"
= "demo123"
= "Enter password"
Markdown frontmatter:
---
title: Page Title
layout: doc
sidebar: true
search: true
access: public
---
access can be public or masked. Set search: false to exclude a page from
the generated search index.
Repository Layout
crates/rust-press CLI entry point
crates/rustpress-core Config, routing, site build pipeline
crates/rustpress-dev Dev and preview servers
crates/rustpress-md Markdown parsing and HTML rendering
crates/rustpress-search Search index builder
crates/rustpress-theme Static theme HTML, CSS, and JavaScript
docs/ Documentation source for this repository
Development
Run the local docs server:
Run tests:
Format code:
Publishing
The crates.io install package is rust-press; it installs the rust-press
binary. Internal crates must be published first because Cargo resolves packaged
path dependencies from crates.io.
Publish order:
Before publishing, run cargo test and then cargo publish --dry-run -p <crate>
in the same order. Pushing a tag such as v0.1.10 builds GitHub Releases
archives for Linux, macOS, and Windows.
License
RustPress is licensed under the MIT License. See LICENSE.