Generated Table of Contents by inserting a {{ toc() }}
shortcode with a depth of 3:
This shortcode actually just inserts <!-- toc -->
which gets replaced by running the preprocess_post(resource=page)
macro on it, which calls generate_toc(toc, level, depth)
under-the-hood.
Mark the summary cutoff point by placing <div></div><!-- more -->
at the desired location.
Internal links get underlined with orange: Such as this link.
External links get underlined with blue: Such as this link.
Unordered list:
Ordered list:
Here's a simple footnote,1 and here's a longer one.2
This is the first footnote.
Multiline footnotes are not supported (#1282), and will end up wrapping everything in a code block outside the footnote <div>
.
Indent paragraphs to include them in the footnote.
`{ my code }`
Add as many paragraphs as you like.
Code blocks support the following annotations:
linenos
: Display line numbers columnhl_lines
: Highlight specific lines, e.g. hl_lines=1 3-5 9
linenostart
: Start line number, e.g. linenostart=20
hide_lines
: Hide specific lines, e.g. hide_lines=1-2
It's placed after the language, which will look like this:
```rust,linenos,hl_lines=1 3-5 9
println!("Hello, world!");
```
Plain, without line numbers:
// @ts-check
/** @type {import('next').NextConfig} */
;
module.exports = nextConfig;
With line numbers:
1 // @ts-check
2
3 /** @type {import('next').NextConfig} */
4 5 6 7 8 9 10 11 ;
12
13 module.exports = nextConfig;
With line numbers and highlighting:
1 // @ts-check
2
3 /** @type {import('next').NextConfig} */
4 5 6 7 8 9 10 11 ;
12
13 module.exports = nextConfig;
Without line numbers but with highlighting:
// @ts-check
/** @type {import('next').NextConfig} */
;
module.exports = nextConfig;
Loading code from a colocated file, and hiding specific lines:
trailingSlash: true,
experimental:
We're using leptos_i18n for localization in Leptos, which supports an API that's very close to the one we used in Next.js. We already pulled in the dependency when we updated our Cargo.toml
file earlier, so let's get the rest of it set up.
We'll create a ui-internal/messages/
folder where our locales will live....
Pulling in a colocated image:
Pulling in a colocated image with caption:
Showing multiple images:
For quick copying, use this one:
{{ images(paths=["logo.png", "logo.png"], captions=["logo1", "logo2"], widths=[400, 400]) }}
A simple table with a header, defaulting to centered alignment:
Header 2 | Header 3 | |
---|---|---|
Row 1 | Row 1 | Row 1 |
Row 2 | Row 2 | Row 2 |
Row 3 | Row 3 | Row 3 |
A table with different text alignment:
Longer header 1 | Longer header 2 | Longer header 3 |
---|---|---|
Row 1 | Row 1 | Row 1 |
Row 2 | Row 2 | Row 2 |
A left-aligned table (uses <left>...</left>
HTML tags):
Header 1 | Header 2 | Header 3 |
---|---|---|
Row 1 | Row 1 | Row 1 |
Row 2 | Row 2 | Row 2 |
A right-aligned table (uses <right>...</right>
HTML tags):
Header 1 | Header 2 | Header 3 |
---|---|---|
Row 1 | Row 1 | Row 1 |
Row 2 | Row 2 | Row 2 |
A simple table without header (empty headers hidden with CSS):
Row 1 | Row 1 | Row 1 |
Row 2 | Row 2 | Row 2 |
Row 3 | Row 3 | Row 3 |
This is a clever little trick of convoluted logic (lots of negation!) which checks:
thead
elementth
elements}
A single line quote:
This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet.
And a multi-line quote:
This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet.
And it can span multiple lines...
A callout: