Skip to content

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
    }
AssemblyNacara.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

Title: string
Description: string option
ShowToc: bool

Show the table of contents next to the content.

ShowPageNav: bool

Show previous and next links at the bottom.

ShowMenu: bool

Show the sidebar menu.

MenuFilter: bool option

Offer a box that filters the menu.

None leaves it to the theme, which offers one when the menu is long.

MenuMemory: bool

Carry the menu's folding from page to page.

Off, every page opens the menu the same way: the trail to itself, and nothing else.

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
pageThe page being described.
create (title: string) : DocPage

A page shown with everything the theme offers.

Parameter
titleIts 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
valueThe description, or None to leave the site's own in charge.
pageThe page being described.
description (value: string) (page: DocPage) : DocPage

What the page is about, for search results and social cards.

Parameter
valueOne sentence.
pageThe page being described.
mainAttributes (value: (string * string) list) (page: DocPage) : DocPage

Attributes to put on the page's <main>.

Parameter
valueEach attribute as its name and its value.
pageThe 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
pageThe page being described.
withMenuFilter (page: DocPage) : DocPage

Offer a box that filters the menu, however short the menu is.

Parameter
pageThe page being described.
withoutMenu (page: DocPage) : DocPage

No sidebar: the content takes the width.

Parameter
pageThe page being described.
withoutMenuFilter (page: DocPage) : DocPage

No filter box over the menu, however long the menu is.

Parameter
pageThe page being described.
withoutMenuMemory (page: DocPage) : DocPage

The menu forgets what a reader folded: every page opens it the same way.

For a section read by name rather than in order, such as a reference.

Parameter
pageThe page being described.
withoutPageNav (page: DocPage) : DocPage

No previous and next links at the bottom.

Parameter
pageThe page being described.
withoutToc (page: DocPage) : DocPage

No table of contents beside the content.

Parameter
pageThe page being described.