Interactive components
Progressive enhancement without a JavaScript framework.
Interactive components are static HTML first. The default theme adds a small, dependency-free script for state, network requests, and presentation.
Tutorials
Publish a site
Run mpress check.
Run mpress build --strict.
Upload the generated site/ directory.
Source
@tutorial{title="Publish a site"}
### Check the content
Run `mpress check`.
### Build strictly
Run `mpress build --strict`.
### Deploy the output
Upload the generated `site/` directory.
@endProgress is stored locally and the reset button clears it.
Audience filtering
The selector is added automatically when a page contains audience blocks.
Developers can extend the Markdown processing pipeline in Go.
Writers only need Markdown, HTML, and the preview command.
Source
@audience{role="developer"}
Developers can extend the Markdown processing pipeline in Go.
@end
@audience{role="writer"}
Writers only need Markdown, HTML, and the preview command.
@endConditional content
Conditional blocks read a URL parameter, then remember it locally. Visit this
page with ?framework=go to select the second block.
This is the default, framework-neutral guidance.
This guidance is selected for Go users.
Source
@if{param="framework" value="plain" default="true"}
This is the default, framework-neutral guidance.
@end
@if{param="framework" value="go"}
This guidance is selected for Go users.
@endReactive values
Project seats: …
Source
@input{name="projects" type="range" min="1" max="20" value="4" label="Projects"}
@end
@input{name="seats" type="number" value="3" label="Editors"}
@end
@computed{expr="projects * seats" deps="projects,seats" label="Project seats" format="%d"}
@endAPI playground
The playground sends a real browser request only when the reader presses the button. This example targets the local preview server and is safe to inspect.
/search-index.json
Inspect the generated search index.
Headers
Source
@api-playground{method="GET" path="/search-index.json" baseUrl="http://127.0.0.1:4174"}
Inspect the generated search index.
@endVariants
@variant{name="react"} is resolved during the build rather than in the
browser. Set the active variant in the build configuration to publish one set
of product-specific content from a shared source.