Docs
2 minutes read
Document a tool using the built-in documentation feature.
To create a documentation page, start with a Zola section. Set the following front matter variable:
= "documentation_page.html"
Then, add pages. Use the sections
front matter variable in the section and the section
front matter variable in the individual pages to group multiple pages to a docs section.
Options
Section
Use the default Zola section front matter variables to configure the docs. Duckling provides the following additional variable:
sections
: The sections available in the documentation.
Use the following syntax:
[]
= [
"Usage", # Section 1
"Markdown", # Section 2
"Advanced" # Section 3
]
Page
In addition to the default front matter variables for pages, Duckling provides some additional variables that can be set under [extra]
:
section
: Assign the page to the section with the given index. The sections are defined in the Zola section (the_index.md
). Use0
to place it above all the sections,1
for the first section, etc.
The following options are available in the [extra.comments]
section:
host
: The Mastodon server on which the post was posted.user
: The username of the poster.id
: ID of the post; the one in the URL.
Example
The code for Duckling’s docs can be used as a reference or as a starting point. It is available in the project’s source code.