Blocks that read a document
v0.0.1
Four blocks of the document kit read a document from the page's URL and draw one part of it: doc-section draws a page, doc-sidebar the contents, doc-toc the headings of the page being read, and doc-switcher the document's versions. Each is a CMS component installed per site. This reference lists their attributes, defaults and behavior. See Show documents on your site for pages built from them.
doc-section
Draws one page of a document: the trail above it, its title, when it last changed, its text, its notes, and links to the pages either side. With nothing asked, it draws the version's front page, or the document's landing. The landing is an overview: the document's tile, its version and number of pages, its name and summary, the first pages as numbered cards, and every page under the heading it is filed under. The block reads in step with the request, so the page's text is in the HTTP response.
| Attribute | Type | Default | What it does |
|---|---|---|---|
show_breadcrumb | boolean | true | Draws the trail of parent pages above the title. |
crumb_current | boolean | false | Ends the trail with the page itself, so a page at the top of its document has a trail too. |
show_version | boolean | true | Draws the version the page was last changed in, on the line above its title. |
show_updated | boolean | true | Draws when the page last changed and the version being read, as in Updated Oct 14, 2026 · v1.2.0. |
show_notes | boolean | true | Draws the page's notes after its text. |
show_pager | boolean | true | Draws the links to the pages either side. |
start_count | integer | 3 | How many pages the landing draws as numbered cards at its top, each with the start of its text, in reading order, from 0 to 6. 0 draws none. |
code_lines | integer | 16 | A code block of more lines is cut at this many, with a button that shows all of it. Allowed: 0 (never cut), 8, 12, 16, 20, 24, 32. |
tab_param | any | "tab" | The URL key a tab added by a plugin travels under. ?tab=props opens a tab named props. |
pending_wait | integer | 120000 | How many milliseconds a tab whose data a plugin is still fetching waits before it says the data could not be had. |
The words doc-section says are attributes too:
| Attribute | Default | Where it appears |
|---|---|---|
updated_text | "Updated %{date}" | Before the version in the updated line. %{date} is the date in the page's language. |
previous_text | "Previous" | The step back. |
next_text | "Next" | The step forward. |
idle_text | "Choose a document." | When the URL names no document. |
missing_text | "That page is not published." | When the document or the page a link names is not there. |
empty_text | "This document has no published pages yet." | When the version has nothing approved. |
pages_text | "%{count} pages" | The page count on the landing. %{count} is the number. |
one_page_text | "%{count} page" | The page count of a document with one page. |
copy_text | "Copy" | The copy button of each code block. |
copied_text | "Copied" | The same button for a moment after it copied, and what a screen reader hears. |
copy_label | "Copy code" | The copy button's name for a screen reader. |
expand_text | "Show all %{count} lines" | The button under a cut code block. %{count} is its number of lines. |
collapse_text | "Show less" | That button once the whole block is shown. |
docs_tab_text | "Documentation" | The tab holding the page's own text, drawn when a plugin adds tabs. |
tabs_label | "Sections of this page" | The tab bar's name for a screen reader. |
The page's text and notes pass through the same HTML cleaning as the text is stored through, then draw the components placed in them. Each code block is drawn in a window with its language and a copy button. A placed doc-callout, doc-example or doc-section-cards is drawn there. See Callouts, examples and the version placeholder. A plugin adds facts and tabs through the document:page:extras event. See Plugin events.
doc-toc
Draws what is on the page being read, its headings and its notes, as links to anchors in the page. On a document's landing, which has no text, it draws nothing.
| Attribute | Type | Default | What it does |
|---|---|---|---|
heading | string | "On this page" | The words above the list. Empty, none are drawn. |
show_headings | boolean | true | Lists the headings inside the page's own text. |
show_notes | boolean | true | Lists the notes of the page. |
min_entries | integer | 2 | How many entries it takes before the list is drawn, from 1 to 20. Under that, nothing is drawn. |
loading_text | string | "Loading this page's contents…" | What a screen reader hears while the read runs. |
error_text | string | "This page's contents could not be listed." | When the read fails. |
retry_text | string | "Try again" | The way out of a failed read. |
doc-switcher
Draws a document's versions in a menu, each leading to the same page in that version. A version that does not have the page, or whose copy of it the reader may not open, leads to the document's front page. The closed menu names the version being read, and the list marks each version that is not stable with its status. When the version being read is not the latest, a line beside the menu says so and links to the latest. The block has no language switch: the site's header lists the languages the page is written in. On the sample pages, the bar under the header draws it. See Page frame: languages and the section bar.
| Attribute | Type | Default | What it does |
|---|---|---|---|
show_banner | boolean | true | Draws the line beside the menu that tells a reader the version being read is not the latest. |
version_text | string | "Version" | What the version menu is called. Empty, it shows the version number alone, as v0.0.6. |
latest_text | string | "latest" | The badge on the newest version, and the word after the version in the closed menu while the newest is being read. |
banner_text | string | "You are reading an older version of this document." | What a reader on an older version is told. |
banner_link_text | string | "Read the latest" | The link out of an older version. |
loading_text | string | "Loading the other versions…" | What a screen reader hears while the read runs. |
error_text | string | "The other versions could not be loaded." | When the read fails. |
retry_text | string | "Try again" | The way out of a failed read. |