vdoc.models package | vdoc 0.19.0 documentation

Skip to content

# vdoc.models package

## Subpackages

- vdoc.models.plugins package
  - Submodules
  - vdoc.models.plugins.base module
    - `Plugin`
  - vdoc.models.plugins.footer module
    - `FooterLink`
    - `FooterLinkGroup`
    - `FooterPlugin`
  - vdoc.models.plugins.orama module
    - `OramaDictionary`
    - `OramaPlugin`
  - vdoc.models.plugins.theme module
    - `ThemePlugin`
    - `ThemeSettings`
  - Module contents
    - `FooterPlugin`
    - `OramaPlugin`
    - `ThemePlugin`

## Submodules

## vdoc.models.project module

Contains all project model definitions.

class vdoc.models.project.Project(**data)

  Bases: `BaseModel`

  Pydantic model for a project.

  property category_id: int | None

    Returns the category ID of the project if configured, otherwise None.

    Returns:

      The optional project category ID.

    Return type:

      int | None

  property display_name: str

    Returns the display name of the project if configured, otherwise the project name.

    Returns:

      The project display name.

    Return type:

      str

  classmethod get_version_and_docs_path(name, version)

    Returns the validated version and the path containing the documentation.

    Parameters:

      - name (`str`) – The project name.

      - version (`str`) – The project version. If `latest`, the path to the newest version will be returned.

    Raises:

      - ProjectNotFound – If the project doesn’t exist.

      - InvalidVersion – If the version is of an invalid format.

      - ProjectVersionNotFound – If the project doesn’t have the requested version.

    Return type:

      `tuple`[`str`, `Path`]

    Returns:

      The validated version and the path containing the documentation.

  property latest: str

    Returns the latest version available of the project.

    Returns:

      _description_

  classmethod list(search_path=None)

    Returns a list of all projects.

    Parameters:

      search_path (`Path` | `None`) – Optional search path. If None, the docs_dir of the settings will be used.

    Return type:

      `list`[`Project`]

    Returns:

      A a list of all projects.

  model_config: ClassVar[ConfigDict] = {}

    Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

  name: str
  classmethod validate_project_exists(value)

    Validates the project’s existence.

    Parameters:

      value (`str`) – The project name.

    Raises:

      ProjectNotFound – If the project doesn’t exist.

    Return type:

      `str`

    Returns:

      The validated project name.

  property versions: Dict[Version, str]

    Returns a list of all available project versions.

    Raises:

      ProjectNotFound – If the project doesn’t exist.

    Returns:

      A list of all versions of the project.

## vdoc.models.project_category module

Contains the project category model.

class vdoc.models.project_category.ProjectCategory(**data)

  Bases: `BaseModel`

  Pydantic model for a project category.

  id: `Annotated`[`int`]
  model_config: ClassVar[ConfigDict] = {}

    Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

  name: `str`

## Module contents

Contains all models.

vdoc.methods.cli package
vdoc.models.plugins package