yera.apps.builtin.guide.offline_docs
Build the Yera guide's fallback docs from the installed package.
When the online docs (the yera-labs.io MCP server) can't be reached, the guide
uses these tools instead. They have the same names and arguments as the MCP
server's (search_docs, list_pages, get_page) and return the same
kind of Markdown, built from the installed yera's own docstrings, so they match
the installed version exactly. They cover:
- the API reference: every
yr.*name, - the CLI reference: every
yeracommand, - the implementation reference: every module, with its public classes and functions.
Tutorials and how-to guides aren't part of the package, so they're online only.
Docstrings are read with ast, never by importing the modules: yr.llm and
yr.mcp load the user's profile when touched, and importing everything
would be slow. (The CLI is the exception: its commands are only known once its
cyclopts app is built.) Pages aren't rendered: a Google-style docstring is
already structured text a model reads well.
Search ranks pages the same way as the MCP server (functions/mcp.js in the
website repo); keep the two in step.
Symbols
function_list
function_list() → strRender every yr name for the guide's overview.
Returns
Markdown listing each public name with its signature and summary.
implementation_pages
implementation_pages() → list[_Page]Build an implementation page for every documented module.
Returns
Module pages containing their docstrings and public API members.
OfflineDocsError
ExceptionA request the offline docs can't answer, e.g. a page that doesn't exist.