david-swift f97222f65d Write docs for Duckling #4
Add template for localization
2025-04-11 16:51:27 +02:00

1.8 KiB

+++ weight = 3 title = "Docs" [extra] section = 1 +++

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:

page_template = "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:

[extra]
sections = [
  "Usage", # Section 1
  "Extra"  # Section 2
]

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). Use 0 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.