Flude is under construction. Features, commands, limits and behavior described here may be incomplete or change without notice.
Skip to content

Sidebar & Groups: The Complete sidebar.toml Reference ​

Audience: anyone authoring or maintaining a document directory (a folder with its own ude_doc_config.json) — the person who decides what a project's sidebar looks like and how its classes are grouped.

This page is the single consolidated reference for sidebar.toml. Target Settings covers a slice of this material in passing; this page is the full picture, and the one to trust if the other ever drifts.


Why this file exists ​

sidebar.toml carries two independent tables for a single document directory:

  • [[sidebar]] — the navigation entries (an array of tables).
  • [groups] — the folder taxonomy used to group classes/structs/enums/etc. inside that navigation.

Both are read by resolve_config() (orchestrator.py, via load_sidebar_toml()), and both are mandatory, with no cascade and no default at any tier. That is the one fact worth memorizing about this file: nothing here is optional, and nothing here falls back to a shared or engine-provided default.


An array of tables, each describing one sidebar entry. A minimal example:

toml
[[sidebar]]
type = "api_reference"
label = "API Reference (C++)"
url = "index.html"

[[sidebar]]
type = "static"
label = "License and Copyright"
url = "license_copyright.html"
source_file = "../../static_pages/license_copyright.html"

A type = "static" entry's source_file is resolved by the orchestrator into an absolute path and, at render time, read via BaseRenderer._load_static_file_from_path() (interfaces.py) — see Target Settings for the static_source_path search-path mechanics.

If [[sidebar]] is missing, empty, or sidebar = [], the build fails:

text
sidebar.toml in <dir> declares no [[sidebar]] entries. There is no default
navigation to fall back on — every document directory must define its own
[[sidebar]] table.

(orchestrator.py)


[groups] — folder taxonomy ​

[groups] controls which virtual folders classes, structs, enums, and similar entities are grouped into on the generated site. An example:

toml
[groups]
namespace_level = [
    "Classes",
    "Structures and Enums",
    "Functions",
    "Types",
]

GroupsConfig (config.py, model_config = ConfigDict(extra="forbid")) declares three fields:

python
namespace_level: List[str] = Field(default_factory=list)
index_category_overrides: Dict[str, str] = Field(default_factory=dict)
root_index_suffix: str = ""

namespace_level is the one the built-in renderers read. index_category_overrides and root_index_suffix are accepted for externally supplied renderers and ignored by the built-in ones.

There is no class_level key. Older material described a class_level key alongside namespace_level. That was never valid — the schema never declared it, and extra="forbid" rejects anything else, class_level included, exactly as hard as a genuine typo like namespac_level.

If [groups] is missing, or namespace_level is empty, the build fails — exactly the same treatment as [[sidebar]], no asymmetry:

text
sidebar.toml in <dir> declares no [groups] namespace_level entries. There is no
default taxonomy to fall back on — every document directory must define its
own [groups] table.

(orchestrator.py)

The error message for an unknown key ​

If you put an unrecognized key in [groups] (a typo, or a stray class_level), Pydantic validation fails and the engine raises:

text
UdeException: Invalid [groups] configuration: the permitted keys are 'namespace_level' (the only one the built-in renderers read), 'index_category_overrides' and 'root_index_suffix' (both for externally supplied renderers). Details: ...

Older versions of this message named class_level as a permitted key (tracked as ENG-01, fixed 2026-08-19) and, until 2026-11-21, said that only namespace_level is permitted; the current text lists the three keys the schema accepts.


The Macros group (C++) ​

A documented #define becomes a page of its own when the group Macros is listed in namespace_level:

toml
[groups]
namespace_level = [
    "Classes",
    "Functions",
    "Macros",
]
  • Opt-in. A sidebar.toml that does not list Macros renders exactly what it rendered before; the build logs one warning that documented macros were found and no page was written.
  • Only documented macros. A macro appears when a documentation comment sits above it (a /** ... */ block or /// lines) or after it on the same line (///<). Undocumented macros, include guards and macros in a branch that is not compiled (#ifdef not taken) are not listed. A comment stays attached over blank lines, #include lines and conditional directives, as Doxygen does it.
  • One page per macro. The page shows the macro as written (#define NAME(a, b) body), its description, the parameter table with the @param texts, the @return text and the file name and line where it is defined (the file name only, never the directory of the build machine).
  • No scope. A macro belongs to no namespace; the pages are listed in the global namespace group Macros. A macro named MIN and a function named min get different pages.
  • Defined twice. A macro defined in two places (platform branches, two headers) has one page, with the first description found.

No cascade, anywhere, for either table ​

Unlike almost every other configuration key in this system, [[sidebar]] and [groups] are not part of the global → SDK → doc-config deep-merge cascade described in Target Settings. There used to be a per-Lang×Output engine-tier default taxonomy; it was removed outright ([IMP-32.10]) along with its template fixtures: the engine's templates today contain no sidebar-taxonomy directory of any kind.

The document's own sidebar.toml is the only source for both tables, at every tier. As a direct consequence, groups and sidebar are forbidden keys in all three JSON config layers:

  • _reject_forbidden_sidebar_keys() (orchestrator.py) rejects either key found in the global config (:263), the SDK config (:297), or the doc config (:310).
  • GlobalConfig._reject_sidebar_keys() (config.py) rejects them again at the GlobalConfig level — alongside the removed sidebar_structures_dir key (see Global Settings).

Putting "groups": {...} or "sidebar": [...] in ude_global_config.json, ude_sdk_config.json, or ude_doc_config.json is a hard configuration error, not a legitimate override — there is nothing here for deep_merge() to combine.


Checklist for a new document directory ​

  1. Create sidebar.toml next to that document's ude_doc_config.json.
  2. Add at least one [[sidebar]] entry.
  3. Add a [groups] table with a non-empty namespace_level list.
  4. Do not add a class_level key, and do not add groups or sidebar to any of the three JSON config files.
  5. Re-run ude compile (or ude audit, if you just want to check the config resolves) — a missing, empty, or malformed sidebar.toml fails immediately, before any parsing happens.

(Paths below are repository-root-relative.)

  • user-docs/docs/target-settings.md — where [groups] fits among the other doc-config keys