Skip to content

Commit dc4dd3c

Browse files
committed
docs(tools/build-docs): render plugin DOCUMENTATION blocks into the MkDocs site
The Linuxfabrik LFOps documentation site only covered roles and the top- level project pages. Modules, lookup plugins and filter plugins had to be discovered via `ansible-doc` on a checkout. This commit extends `tools/build-docs` so every Python file under `plugins/{modules,lookup, filter}/` that carries an Ansible-style `DOCUMENTATION` block is rendered into Markdown and added to the site navigation. Implementation * AST-based extraction of the DOCUMENTATION (parsed YAML), EXAMPLES (raw string), and RETURN (parsed YAML) module-level constants. * Markdown renderer that emits a header, synopsis, optional version-added, requirements list, parameters table (with suboptions folded into the description column), examples code block, return values table, notes, and authors. * Per-kind output directory: `docs/modules/`, `docs/lookup/`, `docs/filter/`, with stale `.md` files cleaned up before each rebuild. * Name-collision handling: pages keep their bare name in the nav unless a plugin name is shared across more than one kind (e.g. `bitwarden_item` exists both as a module and as a lookup plugin); collisions get a ` (lookup)` / ` (filter)` suffix in the nav label. Navigation The nav is reorganised so the project meta pages (Home, Compatibility, Playbooks, STIGs, Security, Contributing) live under a single "Linuxfabrik LFOps" section, with "Roles" and "Modules" as the two technical sibling sections below. The site Home page is now a symlink to the repository's `README.md` (badges, hero block, the full table of contents, all included), so the docs site landing page matches the GitHub README without manual sync. Drive-by `plugins/modules/uptimerobot_monitor.py` carried two description bullets of the form "For C(type=keyw): C(exist) alerts ...". The colon ended the YAML key prematurely, so its DOCUMENTATION did not parse. Reworded to "For C(type=keyw), C(exist) alerts ..." (and the analogous spot for sub_type), and the page renders. `.gitignore` gains the four new auto-generated paths (`/docs/index.md`, `/docs/modules/`, `/docs/lookup/`, `/docs/filter/`); the previously hand-curated `docs/index.md` is removed from tracking.
1 parent 0574427 commit dc4dd3c

4 files changed

Lines changed: 330 additions & 47 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ particle/.vagrant
1414
/docs/CODE_OF_CONDUCT.md
1515
/docs/compatibility.md
1616
/docs/contributing.md
17+
/docs/filter/
18+
/docs/index.md
19+
/docs/lookup/
20+
/docs/modules/
1721
/docs/playbooks.md
1822
/docs/roles/
1923
/docs/security.md

docs/index.md

Lines changed: 0 additions & 28 deletions
This file was deleted.

plugins/modules/uptimerobot_monitor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@
7171
required: false
7272
sub_type:
7373
description:
74-
- For C(type=port): which protocol/port preset to use. C(custom)
75-
means "use the explicit C(port) value".
74+
- For C(type=port), which protocol/port preset to use. C(custom)
75+
means 'use the explicit C(port) value'.
7676
type: str
7777
choices: ['custom', 'ftp', 'http', 'https', 'imap', 'pop3', 'smtp']
7878
required: false
@@ -83,7 +83,7 @@
8383
required: false
8484
keyword_type:
8585
description:
86-
- For C(type=keyw): C(exist) alerts when the keyword is found,
86+
- For C(type=keyw), C(exist) alerts when the keyword is found,
8787
C(notex) alerts when it is missing.
8888
type: str
8989
choices: ['exist', 'notex']

0 commit comments

Comments
 (0)