Coverage for src/somesy/mkdocs/models.py: 100%
12 statements
« prev ^ index » next coverage.py v7.6.0, created at 2024-07-29 07:42 +0000
« prev ^ index » next coverage.py v7.6.0, created at 2024-07-29 07:42 +0000
1"""Pyproject models."""
3from typing import Optional
5from pydantic import (
6 BaseModel,
7 Field,
8)
9from typing_extensions import Annotated
11from somesy.core.types import HttpUrlStr
14class MkDocsConfig(BaseModel):
15 """MkDocs configuration model."""
17 model_config = dict(use_enum_values=True)
19 site_name: Annotated[
20 str,
21 Field(pattern=r"^[A-Za-z0-9]+([_-][A-Za-z0-9]+)*$", description="Site name"),
22 ]
23 site_description: Annotated[
24 Optional[str], Field(description="Site description")
25 ] = None
26 site_author: Annotated[Optional[str], Field(description="Site authors")] = None
27 site_url: Annotated[Optional[HttpUrlStr], Field(description="Site homepage")] = None
28 repo_url: Annotated[
29 Optional[HttpUrlStr], Field(description="Package repository")
30 ] = None
31 repo_name: Annotated[Optional[str], Field(description="Repository name")] = None