Getting Started
Quick Start
Install rst-renderer and render your first RST document in five minutes
Quick Start
This guide walks through the fastest path from zero to rendered HTML. For a full bioinformatics pipeline report, continue to Bioinformatics Report Tutorial.
1. Install
Pick the package that matches your workflow:
# Library (HTML / React / Markdown)
pnpm add @seqyuan/rst-renderer
# CLI (terminal rendering + templates)
pnpm add -g @seqyuan/rst-cli
# Vite plugin (import .rst in frontend projects)
pnpm add -D @seqyuan/vite-plugin-rst
pnpm add @seqyuan/rst-renderer2. Write RST
Create hello.rst:
Hello rst-renderer
==================
This is **bold** and *italic* text.
Features
--------
- Parse reStructuredText into a unified AST
- Render to HTML, React, or Markdown
- Jinja2-compatible templates for reports3. Render to HTML
TypeScript (one-liner):
import { renderRst } from '@seqyuan/rst-renderer'
import fs from 'node:fs'
const rst = fs.readFileSync('hello.rst', 'utf-8')
const html = renderRst(rst)
console.log(html)CLI:
rst-render hello.rst -o hello.htmlOpen hello.html in a browser to see the result.
4. Choose Your Output Format
| Goal | Approach | Docs |
|---|---|---|
| Styled HTML report | renderRst() or CLI | HTML Rendering |
| React component tree | ReactRenderer | React Rendering |
| Markdown for another SSG | MarkdownRenderer or --md | Markdown Rendering |
Vite import | @seqyuan/vite-plugin-rst | Vite Plugin |
| Data-driven report | Jinja2 template + JSON | Template Engine |
5. Template-Driven Reports (Preview)
For reports that change per project, keep structure in a .rst.j2 template
and inject data at render time:
rst-render report.rst.j2 -t -d project.json -o report.htmlThe CLI also supports wildcard file discovery:
rst-render report.rst.j2 -t -d project.json \
--scan plots=upload/plots/*_umap.png \
-o report.html -s-s produces a standalone HTML file with CSS and images inlined —
ready to email to a client.
See the Bioinformatics Report Tutorial for a complete end-to-end example with Chinese content, QC tables, and plot galleries.
Next Steps
- RST Writing Rules — syntax supported by this project
- Gallery — live rendering previews
- CLI Tool — all flags and options