···11----
22-outline: deep
33----
44-55-# Runtime API Examples
66-77-This page demonstrates usage of some of the runtime APIs provided by VitePress.
88-99-The main `useData()` API can be used to access site, theme, and page data for the current page. It works in both `.md` and `.vue` files:
1010-1111-```md
1212-<script setup>
1313-import { useData } from 'vitepress'
1414-1515-const { theme, page, frontmatter } = useData()
1616-</script>
1717-1818-## Results
1919-2020-### Theme Data
2121-<pre>{{ theme }}</pre>
2222-2323-### Page Data
2424-<pre>{{ page }}</pre>
2525-2626-### Page Frontmatter
2727-<pre>{{ frontmatter }}</pre>
2828-```
2929-3030-<script setup>
3131-import { useData } from 'vitepress'
3232-3333-const { site, theme, page, frontmatter } = useData()
3434-</script>
3535-3636-## Results
3737-3838-### Theme Data
3939-<pre>{{ theme }}</pre>
4040-4141-### Page Data
4242-<pre>{{ page }}</pre>
4343-4444-### Page Frontmatter
4545-<pre>{{ frontmatter }}</pre>
4646-4747-## More
4848-4949-Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata).
+16-13
docs/css/volt-css.md
···99### Core Principles
10101111- **Classless**: Style semantic HTML elements directly.
1212-- Optimized line lengths, modular type scale, and generous whitespace optimized for reading
1313-- Automatic light and dark modes via `prefers-color-scheme` to respect user preferences with carefully calibrated color palettes for both modes.
1414-- **Accessibility**: WCAG AA contrast ratios, keyboard navigation support, and semantic HTML patterns
1515-- Mobile-first (ish) design that adapts gracefully from phones to wide desktop monitors without compromising readability.
1212+- **Accessible**: WCAG AA contrast ratios, keyboard navigation support, and semantic HTML patterns
1313+1414+- Optimized line lengths, modular type scale, and whitespace optimized for reading
1515+- Automatic light and dark modes via `prefers-color-scheme`
1616+- Mobile-first (ish) design that doesn't compromise readability
16171718## Inspiration
1819···38393940### Tufte-Style Sidenotes
40414141-Inspired by Edward Tufte's beautiful book design, margin notes can be added using simple `<small>` elements within paragraphs.
4242+Inspired by Edward Tufte's design principles, margin notes can be added using simple `<small>` elements within paragraphs.
42434344**Desktop**: Notes appear in the right margin
4445**Mobile**: Notes appear inline with subtle styling
···7980}
8081```
81828282-Both themes use carefully selected colors with proper contrast ratios for accessibility.
8383-8483## Usage
85848685### Basic Setup
···124123 <cite>Author Name</cite>
125124 </blockquote>
126125127127- <pre><code>// Code blocks use monospace fonts
128128-const example = "syntax highlighting not included";</code></pre>
126126+ <pre>
127127+ <code>
128128+ // Code blocks use monospace fonts
129129+ const example = "syntax highlighting not included";
130130+ </code>
131131+ </pre>
129132130133 <table>
131134 <thead>
···151154152155### Forms
153156154154-Forms get styling with focus states, required field indicators, and proper spacing:
157157+Forms get styling with focus states, required field indicators, and spacing between controls:
155158156159```html
157160<form>
···285288286289- All color combinations meet WCAG AA standards (4.5:1 for normal text, 3:1 for large text)
287290- Clear, visible focus states for keyboard navigation
288288-- Encourages proper heading hierarchy, landmark regions, and form labels
291291+- Encourages logical heading hierarchy, landmark regions, and form labels
289292- Works on all devices and respects user font size preferences
290293- No animations that could trigger vestibular disorders
291294···295298296299For maximum performance:
297300298298-1. Serve with proper compression (gzip or brotli)
299299-2. Set appropriate cache headers
301301+1. Serve with compression (gzip or brotli)
302302+2. Set cache headers
3003033. Consider inlining in `<style>` tags for above-the-fold content on single-page sites
301304302305## Design Decisions
+4-4
docs/index.md
···55hero:
66 name: "Volt.js"
77 text: "A reactive, hypermedia framework."
88- tagline: My great project tagline
88+ tagline: A reactive, hypermedia framework.
99 actions:
1010 - theme: brand
1111- text: Markdown Examples
1212- link: /markdown-examples
1111+ text: Overview
1212+ link: /overview
1313 - theme: alt
1414- text: API Examples
1414+ text: API Reference
1515 link: /api-examples
16161717features:
-85
docs/markdown-examples.md
···11-# Markdown Extension Examples
22-33-This page demonstrates some of the built-in markdown extensions provided by VitePress.
44-55-## Syntax Highlighting
66-77-VitePress provides Syntax Highlighting powered by [Shiki](https://github.com/shikijs/shiki), with additional features like line-highlighting:
88-99-**Input**
1010-1111-````md
1212-```js{4}
1313-export default {
1414- data () {
1515- return {
1616- msg: 'Highlighted!'
1717- }
1818- }
1919-}
2020-```
2121-````
2222-2323-**Output**
2424-2525-```js{4}
2626-export default {
2727- data () {
2828- return {
2929- msg: 'Highlighted!'
3030- }
3131- }
3232-}
3333-```
3434-3535-## Custom Containers
3636-3737-**Input**
3838-3939-```md
4040-::: info
4141-This is an info box.
4242-:::
4343-4444-::: tip
4545-This is a tip.
4646-:::
4747-4848-::: warning
4949-This is a warning.
5050-:::
5151-5252-::: danger
5353-This is a dangerous warning.
5454-:::
5555-5656-::: details
5757-This is a details block.
5858-:::
5959-```
6060-6161-**Output**
6262-6363-::: info
6464-This is an info box.
6565-:::
6666-6767-::: tip
6868-This is a tip.
6969-:::
7070-7171-::: warning
7272-This is a warning.
7373-:::
7474-7575-::: danger
7676-This is a dangerous warning.
7777-:::
7878-7979-::: details
8080-This is a details block.
8181-:::
8282-8383-## More
8484-8585-Check out the documentation for the [full list of markdown extensions](https://vitepress.dev/guide/markdown).