Inventory

pyhugodoc.inventory.InventoryItem

Inventory item.

__init__ (special)

Signature: __init__(self, name: str, domain: str, role: str, uri: str, priority: str = '1', dispname: Optional[str] = None)

Initialize the object.

Parameters:

  • name (str): The item name.
  • domain (str): The item domain, like ‘python’ or ‘crystal’.
  • role (str): The item role, like ‘class’ or ‘method’.
  • uri (str): The item URI.
  • priority (str): The item priority. It can help for inventory suggestions.
  • dispname (Optional[str]): The item display name.

format_sphinx

Signature: format_sphinx(self) -> str

Format this item as a Sphinx inventory line.

Returns:

  • str: A line formatted for an objects.inv file.

parse_sphinx (classmethod)

Signature: parse_sphinx(line: str) -> InventoryItem

Parse a line from a Sphinx v2 inventory file and return an InventoryItem from it.

sphinx_item_regex

pyhugodoc.inventory.Inventory

Inventory of collected and rendered objects.

__init__ (special)

Signature: __init__(self, items: Optional[List[pyhugodoc.inventory.InventoryItem]] = None, project: str = 'project', version: str = '0.0.0')

Initialize the object.

Parameters:

  • items (Optional[List[pyhugodoc.inventory.InventoryItem]]): A list of items.
  • project (str): The project name.
  • version (str): The project version.

format_sphinx

Signature: format_sphinx(self) -> bytes

Format this inventory as a Sphinx objects.inv file.

Returns:

  • bytes: The inventory as bytes.

parse_sphinx (classmethod)

Signature: parse_sphinx(in_file: BinaryIO, *, domain_filter: Collection[str] = ()) -> Inventory

Parse a Sphinx v2 inventory file and return an Inventory from it.

Parameters:

  • in_file (BinaryIO): The binary file-like object to read from.
  • domain_filter (Collection[str]): A collection of domain values to allow (and filter out all other ones).

Returns:

  • Inventory: An Inventory containing the collected InventoryItems.

register

Signature: register(self, args, kwargs)

Create and register an item.

Parameters:

  • *args : Arguments passed to [InventoryItem][mkdocstrings.inventory.InventoryItem].
  • **kwargs : Keyword arguments passed to [InventoryItem][mkdocstrings.inventory.InventoryItem].