DocPage
type DocPage =
{
Title: string
Description: string option
ShowToc: bool
ShowPageNav: bool
ShowMenu: bool
MenuFilter: bool option
MenuMemory: bool
ShowTitle: bool
ShowEditLink: bool
Styled: bool
MainAttributes: (string * string) list
}
| |
|---|
| Assembly | Nacara.Theme.Default |
What the theme needs to know about the page it is rendering.
Kept separate from the front-matter type so a site can define its own front matter and still use the theme: it maps its type onto this record, and nothing else changes.
Fields
Description: string option
ShowToc: bool
Show the table of contents next to the content.
ShowPageNav: bool
Show previous and next links at the bottom.
ShowTitle: bool
Whether the theme writes the page's title above the content.
ShowEditLink: bool
Whether the theme offers the link that edits the page at its source.
Styled: bool
Whether the theme lays the content out.
Off, the page is a canvas: its title, the prose styles and the edit link are left out, and the content is placed as it was written.
MainAttributes: (string * string) list
Attributes to put on the page's <main>, name and value.
id, class and tabindex are the theme's own and cannot be set here.
Functions and values
bare (page: DocPage) : DocPage
A canvas: the navbar and the footer, and the content laid out by the page.
| Parameter | |
|---|
page | The page being described. |
create (title: string) : DocPage
A page shown with everything the theme offers.
| Parameter | |
|---|
title | Its heading, its entry in the menu, and its <title>. |
describedBy (value: string option) (page: DocPage) : DocPage
The same, from front matter that may or may not carry one.
| Parameter | |
|---|
value | The description, or None to leave the site's own in charge. |
page | The page being described. |
description (value: string) (page: DocPage) : DocPage
What the page is about, for search results and social cards.
| Parameter | |
|---|
value | One sentence. |
page | The page being described. |
mainAttributes (value: (string * string) list) (page: DocPage) : DocPage
Attributes to put on the page's <main>.
| Parameter | |
|---|
value | Each attribute as its name and its value. |
page | The page being described. |
splash (page: DocPage) : DocPage
The theme's styling and spacing, with no menu and no table of contents.
Wider than the reading measure, at --nacara-splash-width.
| Parameter | |
|---|
page | The page being described. |
withoutPageNav (page: DocPage) : DocPage
No previous and next links at the bottom.
| Parameter | |
|---|
page | The page being described. |
withoutToc (page: DocPage) : DocPage
No table of contents beside the content.
| Parameter | |
|---|
page | The page being described. |