MkDocs Usage¶
This guide explains how to install MkDocs locally, serve the documentation site, and regenerate action-specific pages.
Installation¶
- Ensure Python 3.11+ is available (
python3 --version). - Create a virtual environment at the repo root:
- Activate the virtual environment:
- Install MkDocs and the Material theme:
Serving the Site¶
- With the virtual environment activated, run:
- MkDocs serves the site at
http://127.0.0.1:8000/and watches for file changes. - Inside VS Code you can invoke the Serve MkDocs task, which runs the same command with the workspace as the working directory.
Regenerating Action Docs¶
Action reference pages (e.g., docs/actions/discord-notify.md) are generated from their corresponding actions/*/action.yml files using scripts/Modules/Utilities/Documentation/generate_action_docs.py.
- Make sure the virtual environment (or a Python 3 interpreter) is available.
- Run the generator, pointing it to the source action and desired Markdown output:
bash python3 scripts/Modules/Utilities/Documentation/generate_action_docs.py \ --action actions/discord-notify/action.yml \ --output docs/actions/discord-notify.md - The script overwrites the auto-generated header and inputs table while preserving any content outside the
<!-- AUTOGENERATED:ACTION-DOC -->markers (e.g., manual usage sections). - Re-run the command whenever
action.ymlchanges so the docs stay in sync.
Using the PowerShell Wrapper¶
Prefer the PowerShell cmdlet when you already have the d-flows modules imported (e.g., within CI scripts or VS Code tasks):
- Import the module:
Import-Module ".\scripts\Modules\Utilities\Emojis\Emojis.psd1" Import-Module ".\scripts\Modules\Utilities\Colors\Colors.psd1" Import-Module ".\scripts\Modules\Utilities\MessageUtils\MessageUtils.psd1" Import-Module ".\scripts\Modules\Utilities\RepositoryUtils\RepositoryUtils.psd1" Import-Module ".\scripts\Modules\Utilities\Documentation\ActionDocs.psd1" - Invoke the generator for a single action:
- Use
Invoke-AllActionDocsto regenerate every action documentation file in one go: - The cmdlets auto-detect the repository root, log progress with emojis, and surface errors if Python or the action file is missing. Use
-PythonExecutableto target a custom interpreter if needed.