SnakeBridge.Docs.ManifestBuilder (SnakeBridge v0.16.0)

Copy Markdown View Source

Builds docs surface manifests from published documentation artifacts.

Primary input is a Sphinx objects.inv inventory (Intersphinx format). Optionally, an HTML page can be used to derive a curated "summary" profile by extracting fully-qualified object references and intersecting them with the inventory.

Summary

Functions

Extracts candidate module names from Sphinx/MkDocs-style nav links.

Returns a set of fully-qualified references found in HTML.

Filters a set/list of Python module names to a maximum depth relative to library_root.

Builds a manifest from a parsed Sphinx inventory.

Merges two profiles by unioning modules and objects.

Builds a summary profile by extracting object references from HTML and intersecting with a full profile built from inventory.

Types

kind()

@type kind() :: String.t()

manifest()

@type manifest() :: map()

object_entry()

@type object_entry() :: map()

profile()

@type profile() :: map()

profile_name()

@type profile_name() :: String.t()

Functions

extract_modules_from_html_nav(html, library_root)

@spec extract_modules_from_html_nav(String.t(), String.t()) :: MapSet.t(String.t())

Extracts candidate module names from Sphinx/MkDocs-style nav links.

Many documentation sites render module pages as paths like:

  • examplelib/beam_search/examplelib.beam_search
  • examplelib/v1/worker/gpu/examplelib.v1.worker.gpu

extract_references_from_html(html, library_root)

@spec extract_references_from_html(String.t(), String.t()) :: MapSet.t(String.t())

Returns a set of fully-qualified references found in HTML.

filter_modules_by_depth(modules, library_root, depth)

@spec filter_modules_by_depth(Enumerable.t(), String.t(), pos_integer()) ::
  MapSet.t(String.t())

Filters a set/list of Python module names to a maximum depth relative to library_root.

Depth is measured in dot-separated segments after the root:

  • examplelib.config → depth 1
  • examplelib.multimodal.inputs → depth 2

from_inventory(map, library_root, opts \\ [])

@spec from_inventory(SnakeBridge.Docs.SphinxInventory.t(), String.t(), keyword()) ::
  profile()

Builds a manifest from a parsed Sphinx inventory.

merge_profiles(map1, map2)

@spec merge_profiles(profile(), profile()) :: profile()

Merges two profiles by unioning modules and objects.

Objects are deduplicated by {name, kind}.

summary_from_html(full_profile, html, library_root)

@spec summary_from_html(profile(), String.t(), String.t()) :: profile()

Builds a summary profile by extracting object references from HTML and intersecting with a full profile built from inventory.