inventory
Module responsible for the objects inventory.
Inventory(items=None, project='project', version='0.0.0')
¤
Bases: dict
Inventory of collected and rendered objects.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
items |
Optional[List[InventoryItem]]
|
A list of items. |
None
|
project |
str
|
The project name. |
'project'
|
version |
str
|
The project version. |
'0.0.0'
|
Source code in mkdocstrings/inventory.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|
format_sphinx()
¤
Format this inventory as a Sphinx objects.inv
file.
Returns:
Type | Description |
---|---|
bytes
|
The inventory as bytes. |
Source code in mkdocstrings/inventory.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
|
parse_sphinx(in_file, *, domain_filter=())
classmethod
¤
Parse a Sphinx v2 inventory file and return an Inventory
from it.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
in_file |
BinaryIO
|
The binary file-like object to read from. |
required |
domain_filter |
Collection[str]
|
A collection of domain values to allow (and filter out all other ones). |
()
|
Returns:
Type | Description |
---|---|
Inventory
|
An |
Source code in mkdocstrings/inventory.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
|
register(*args, **kwargs)
¤
Create and register an item.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*args |
str
|
Arguments passed to InventoryItem. |
()
|
**kwargs |
str
|
Keyword arguments passed to InventoryItem. |
{}
|
Source code in mkdocstrings/inventory.py
83 84 85 86 87 88 89 90 91 |
|
InventoryItem(name, domain, role, uri, priority='1', dispname=None)
¤
Inventory item.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The item name. |
required |
domain |
str
|
The item domain, like 'python' or 'crystal'. |
required |
role |
str
|
The item role, like 'class' or 'method'. |
required |
uri |
str
|
The item URI. |
required |
priority |
str
|
The item priority. It can help for inventory suggestions. |
'1'
|
dispname |
Optional[str]
|
The item display name. |
None
|
Source code in mkdocstrings/inventory.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
|
format_sphinx()
¤
Format this item as a Sphinx inventory line.
Returns:
Type | Description |
---|---|
str
|
A line formatted for an |
Source code in mkdocstrings/inventory.py
35 36 37 38 39 40 41 42 43 44 45 46 47 |
|
parse_sphinx(line)
classmethod
¤
Parse a line from a Sphinx v2 inventory file and return an InventoryItem
from it.
Source code in mkdocstrings/inventory.py
51 52 53 54 55 56 57 58 59 60 61 62 |
|