docs
Build nbdev documentation with Octavo.
Place octavo.yml in a project's configured notebooks directory to select Octavo for nbdev-docs and nbdev-preview; nbdev-readme and nbdev-contributing always render via Octavo. Run nbdev-migrate-octavo to convert an existing Quarto-based nbdev project in place; see doc(octavo.migrate) for the full migration checklist.
OctavoProc
def OctavoProc(
local_libs=None, # Package names whose symbol links emit root-relative `/...` URLs for Octavo's `Linker`
strip_libs=None, # Package names stripped for bare symbol lookups (defaults to `local_libs`)
extra=None, # Optional live `{mod: {sym: (doc_path, py_path)}}` map for hand-written `.py` modules
):
Prepare notebook content, frontmatter, and local symbol links for Octavo.
OctavoProc.add_links
def add_links(
cell
):
OctavoProc.procs
def procs():
Processors for export
OctavoProc.nb_proc
def nb_proc(
nb
):
Get an NBProcessor with these processors
local_libraries
def local_libraries(
cfg
)->tuple[str, ...]:
Names of the project's declared nbdev symbol indexes in pyproject.toml.
octavo_config
def octavo_config(
root:str | pathlib._local.Path
)->dict:
Read octavo.yml from root, raising FileNotFoundError if absent.
octavo_docs
def octavo_docs(
path:str=None, # Path to the project or its notebooks
output:str=None, # Optional output directory override (defaults to `octavo.yml` or `cfg.doc_path`)
n_workers:int=4, # Parallel notebook preprocessing workers (0 or 1: serial)
):
Build nbdev documentation with Octavo and run post_docs.
octavo_preview
def octavo_preview(
path:str=None, # Path to the project or its notebooks
port:int=None, # HTTP port (defaults to 8000)
host:str=None, # Bind address (defaults to `localhost`)
no_browser:bool=False, # Do not open a browser
):
Serve Octavo documentation locally and rebuild via nbdev-docs when project files change.
doc_link
def doc_link(
target:str, # Link target to rewrite
base:str, # Hosted documentation base URL
nbdir:str='.', # Directory of the source notebook relative to `nbs_path`
)->str:
Convert a relative documentation link to its hosted URL.
octavo_readme
def octavo_readme(
path:str=None, # Path to the project or its notebooks
chk_time:bool=False, # Only build if the source notebook is newer
contributing:bool=False, # Render `CONTRIBUTING.md` instead of `README.md`
):
Render README.md or CONTRIBUTING.md from a notebook's stored outputs without Quarto.
repl_script_frontmatter_keys
def repl_script_frontmatter_keys(
s:str
)->str:
Normalize a render script's leading YAML docstring (subtitle/summary -> description) for Octavo.
write_octavo_yml
def write_octavo_yml(
path:str | pathlib._local.Path=None, # Project or notebooks path (defaults to current project)
)->pathlib._local.Path:
Write octavo.yml in nbs_path from pyproject.toml if it does not already exist.
nbdev_migrate_octavo
def nbdev_migrate_octavo(
path:str=None, # Documentation directory (defaults to configured `nbs_path`)
):
Migrate a Quarto-era nbdev project to Octavo in place.