recon_gen.cli.docs

recon-gen docs — mkdocs handbook site for an L2 instance.

Six operations:

apply — build the site to site/ (wraps mkdocs build). serve — live-reload preview (wraps mkdocs serve). clean — rm -rf site/. test — pytest the docs gates (link sweep + persona neutrality). export — extract mkdocs source for hand-build (legacy export docs). screenshot — capture deployed dashboards to PNG (legacy export screenshots).

No --execute here — building a static site to a directory isn’t a destructive side effect. The “emit” and the “do it” are the same operation.

The --l2 flag is honored via the QS_DOCS_L2_INSTANCE env var that main.py reads at mkdocs-macros define-env time.

Functions

build_docs_site(l2_instance_path, output_dir, *)

Run mkdocs build (the bundled config) into output_dir.

parse_viewport(text)

Parse a WxH string into (width, height) integers.

recon_gen.cli.docs.build_docs_site(l2_instance_path, output_dir, *, strict=True, config=None)[source]

Run mkdocs build (the bundled config) into output_dir.

Returns the mkdocs exit code (0 = success). Threads the active L2 instance via QS_DOCS_L2_INSTANCE and sets cwd to the bundled config’s directory so mkdocs-macros’s include_dir: docs/_macros resolves (X.2.s.1 — mkdocs-macros joins include_dir against the process cwd, not the config-file dir). config overrides the config file (docs apply --portable passes its synthesized mkdocs.portable.yml); the default is the bundled mkdocs.yml. output_dir is resolved to absolute so cwd doesn’t affect where the site lands.

Shared by docs apply and by dashboards / studio (which builds the site into a tempdir and embeds it at /docs — X.2.i).

Return type:

int

Parameters:
  • l2_instance_path (str | None)

  • output_dir (str | Path)

  • strict (bool)

  • config (Path | None)

recon_gen.cli.docs.parse_viewport(text)[source]

Parse a WxH string into (width, height) integers.

Return type:

tuple[int, int]

Parameters:

text (str)