tools/
tools/ holds user-facing tools built on MrDocs.
libs/ is the opposite, because it holds libraries the project depends on.
Most tools link the MrDocs library and use its public API.
Others are scripts that drive the mrdocs executable, or files that users of the installed package consume.
Either way, tools serve the project’s users, unlike utils/, which holds developer and build tooling the project never ships.
Layout of a tool
tools/<tool>/ is one tool, and its layout depends on its kind:
| Kind | Layout |
|---|---|
C++ tool |
The root layout, with a |
Script tool |
Just its files, with no build step. |
Neither a program nor a script, such as the CMake helper |
Just the files it installs. |
CPP_PROJECTS in utils/lint/check_layout.py lists the C tools that follow the root layout, and today that is `tools/mrdocs/`.
A tool in C joins the list, and the layout check then applies at every depth.
A stray directory in tools/mrdocs/ fails:
layout: tools/mrdocs/scripts/: not a directory the root layout allows in a C++ tool
A C++ tool consumes the library through the public API (<mrdocs/…>).
Reaching into the private headers is a smell, and the fix is to promote the API or refactor.
Content that belongs elsewhere
| Content | Where it goes |
|---|---|
Scripts and CMake files for contributors, CI and the build |
|
Libraries the project depends on |
|
Code of the library itself, including anything the tool needs from |
|
Projects that show how to run a tool |
|
Contents by tool
| Directory | Purpose |
|---|---|
|
The command-line documentation generator, the |
|
The CMake helper that a program linking MrDocs calls, and the script it runs. |
|
A Python tool that drives an AI agent and the |
Build integration
The root build adds tools/ unconditionally.
Each tool connects to the build in its own way:
| Tool | Wiring |
|---|---|
|
The same file defines With |
|
No |
|
Not in the build. It is a script you run from the source tree. |