woodglue.apps.llm_docs¶
LLM-friendly documentation generation and Tornado handlers.
LLM-friendly documentation generation for woodglue namespaces.
Generates three artifact types:
- llms.txt: index of all methods with one-line teasers
- Per-method markdown: full docs with parameters, return types, referenced models
- OpenAPI 3.0.3 spec: standard API spec
LlmsTxtHandler
¶
Bases: _AuthDocHandler
GET /docs/llms.txt
Source code in src/woodglue/apps/llm_docs.py
MethodDocHandler
¶
Bases: _AuthDocHandler
GET /docs/methods/{prefix}.{module}/{name}.md
URL uses '/' in place of ':' for cleaner paths. The handler reverses this to look up the method by its nsref (which uses ':').
Source code in src/woodglue/apps/llm_docs.py
OpenApiHandler
¶
Bases: _AuthDocHandler
GET /docs/openapi.json
Source code in src/woodglue/apps/llm_docs.py
walk_namespace(ns)
¶
Return (nsref, node) pairs for every NamespaceNode in ns.
build_method_index(namespaces)
¶
Build a flat lookup: {prefix: {leaf_name: node}}.
Only includes methods tagged with "api" from namespaces where
expose_api is True. This resolves the nested namespace structure
into a simple two-level dict suitable for both RPC dispatch and
documentation generation.
Source code in src/woodglue/apps/llm_docs.py
generate_llms_txt(method_index)
¶
Generate an llms.txt index listing all methods in the method index.
Source code in src/woodglue/apps/llm_docs.py
generate_method_markdown(prefix, method_name, node)
¶
Generate full markdown documentation for a single method.
Source code in src/woodglue/apps/llm_docs.py
generate_openapi_spec(method_index)
¶
Build an OpenAPI 3.0.3 spec dict from the method index.