create_inventory
create_inventory(project, version, items, uri=lambda s: f'{s.canonical_path}.html', dispname='-')
Return a sphinx inventory file.
Parameters
Name | Type | Description | Default |
---|---|---|---|
project |
str | Name of the project (often the package name). | required |
version |
str | Version of the project (often the package version). | required |
items |
‘list[dc.Object | dc.Alias]’ | A docstring parser to use. | required |
uri |
‘str | Callable[dc.Object, str]’ | Link relative to the docs where the items documentation lives. | lambda s: f'{s.canonical_path}.html' |
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
='example', version='0.0', source_type=<SourceTypes.Manual: 'manual'>) Inventory(project
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': '-'}]}