create_inventory
create_inventory(
project,
version,
items,
uri=lambda s: f'{s.canonical_path}.html',
dispname='-',
)Return a sphinx inventory file.
Parameters
project : str-
Name of the project (often the package name).
version : str-
Version of the project (often the package version).
items : 'list[dc.Object | dc.Alias]'-
A docstring parser to use.
uri : 'str | Callable[dc.Object, str]' = lambda s: f'{s.canonical_path}.html'-
Link relative to the docs where the items documentation lives.
dispname : 'str | Callable[dc.Object, str]' = '-'-
Name to be shown when a link to the item is made.
Examples
>>> f_obj = get_object("quartodoc", "create_inventory")
>>> inv = create_inventory("example", "0.0", [f_obj])
>>> inv
Inventory(project='example', version='0.0', source_type=<SourceTypes.Manual: 'manual'>)To preview the inventory, we can convert it to a dictionary:
>>> _to_clean_dict(inv)
{'project': 'example',
'version': '0.0',
'count': 1,
'items': [{'name': 'quartodoc.create_inventory',
'domain': 'py',
'role': 'function',
'priority': '1',
'uri': 'quartodoc.create_inventory.html',
'dispname': '-'}]}