src/content/docs/developer-guide/website.mdx
ratatui.rs is built with Astro and
Starlight.
The source is available from the ratatui/ratatui-website GitHub repository.
If you would like to contribute, you can make a fork and clone the repository. Make sure you run the
following git lfs commands before making a PR.
git lfs install
git lfs pull
To build and run the site locally:
npm install
npm run dev
Feel free to make contributions and submit a PR if you'd like to improve the documentation.
/concepts/backends/comparison/ instead of ../../backends/comparison/).Starlight supports the full range of Markdown syntax in .md files as well as meta information for
titles and descriptions in YAML frontmatter.
See starlight for more information on how to author content in markdown.
The website uses custom components and features to make it easier to generate high quality documentation that is more maintainable.
Use the LinkBadge component:
import LinkBadge from "/src/components/LinkBadge.astro";
<LinkBadge text="default" href="" variant="default" />
<LinkBadge text="outline" href="" variant="outline" />
<LinkBadge text="note" href="" variant="note" />
<LinkBadge text="danger" href="" variant="danger" />
<LinkBadge text="success" href="" variant="success" />
<LinkBadge text="caution" href="" variant="caution" />
<LinkBadge text="tip" href="" variant="tip" />
This renders as:
import LinkBadge from "/src/components/LinkBadge.astro";
<LinkBadge text="default" href="" variant="default" /> <LinkBadge text="outline" href="" variant="outline" /> <LinkBadge text="note" href="" variant="note" /> <LinkBadge text="danger" href="" variant="danger" /> <LinkBadge text="success" href="" variant="success" /> <LinkBadge text="caution" href="" variant="caution" /> <LinkBadge text="tip" href="" variant="tip" />Use the remark-include-code plugin to include code from a test file:
```rust
{{#include @code/tutorials/hello-ratatui/src/main.rs}}
```
This renders as:
{{#include @code/tutorials/hello-ratatui/src/main.rs}}
Draw diagrams with svgbob:
```svgbob
,-------------.
|Get Key Event|
`-----+-------'
|
|
,-----v------.
|Update State|
`-----+------'
|
|
,---v----.
| Render |
`--------'
```
This renders as:
,-------------.
|Get Key Event|
`-----+-------'
|
|
,-----v------.
|Update State|
`-----+------'
|
|
,---v----.
| Render |
`--------'
Draw diagrams with mermaidjs:
```mermaid
sequenceDiagram
participant User
participant TUI Application
User->>TUI Application: Input/Event/Message
TUI Application->>TUI Application: Update (based on Model and Message)
TUI Application->>TUI Application: Render View (from Model)
TUI Application-->>User: Display UI
```
This renders as:
sequenceDiagram
participant User
participant TUI Application
User->>TUI Application: Input/Event/Message
TUI Application->>TUI Application: Update (based on Model and Message)
TUI Application->>TUI Application: Render View (from Model)
TUI Application-->>User: Display UI