vdoc.models.plugins package
Submodules
vdoc.models.plugins.base module
Contains the base class for all plugins.
- class vdoc.models.plugins.base.Plugin(_case_sensitive=None, _nested_model_default_partial_update=None, _env_prefix=None, _env_file=PosixPath('.'), _env_file_encoding=None, _env_ignore_empty=None, _env_nested_delimiter=None, _env_nested_max_split=None, _env_parse_none_str=None, _env_parse_enums=None, _cli_prog_name=None, _cli_parse_args=None, _cli_settings_source=None, _cli_parse_none_str=None, _cli_hide_none_type=None, _cli_avoid_json=None, _cli_enforce_required=None, _cli_use_class_docs_for_groups=None, _cli_exit_on_error=None, _cli_prefix=None, _cli_flag_prefix_char=None, _cli_implicit_flags=None, _cli_ignore_unknown_args=None, _cli_kebab_case=None, _secrets_dir=None, **values)
Bases:
BaseSettings
,ABC
Plugin model for VDoc.
- abstract property active: bool
Check if the plugin is active.
- Returns:
True if the plugin is active, False otherwise.
- classmethod load_plugins()
Load all plugins.
- Raises:
Exception – If an plugin fails to load.
- Yields:
Generator[Plugin, None, None] – A generator of loaded plugin instances.
- Return type:
Generator
[Plugin
,None
,None
]
- model_config: ClassVar[SettingsConfigDict] = {'arbitrary_types_allowed': True, 'case_sensitive': False, 'cli_avoid_json': False, 'cli_enforce_required': False, 'cli_exit_on_error': True, 'cli_flag_prefix_char': '-', 'cli_hide_none_type': False, 'cli_ignore_unknown_args': False, 'cli_implicit_flags': False, 'cli_kebab_case': False, 'cli_parse_args': None, 'cli_parse_none_str': None, 'cli_prefix': '', 'cli_prog_name': None, 'cli_use_class_docs_for_groups': False, 'enable_decoding': True, 'env_file': None, 'env_file_encoding': None, 'env_ignore_empty': False, 'env_nested_delimiter': None, 'env_nested_max_split': None, 'env_parse_enums': None, 'env_parse_none_str': None, 'env_prefix': '', 'extra': 'forbid', 'json_file': None, 'json_file_encoding': None, 'nested_model_default_partial_update': False, 'protected_namespaces': ('model_validate', 'model_dump', 'settings_customise_sources'), 'secrets_dir': None, 'toml_file': None, 'validate_default': True, 'yaml_file': None, 'yaml_file_encoding': None}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context, /)
This function is meant to behave like a BaseModel method to initialise private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Parameters:
self (
BaseModel
) – The BaseModel instance.context (
Any
) – The context.
- Return type:
None
vdoc.models.plugins.orama module
Contains the orama plugin.
- class vdoc.models.plugins.orama.OramaDictionary(**data)
Bases:
BaseModel
Custom text dictionary for localization.
- class vdoc.models.plugins.orama.OramaPlugin(_case_sensitive=None, _nested_model_default_partial_update=None, _env_prefix=None, _env_file=PosixPath('.'), _env_file_encoding=None, _env_ignore_empty=None, _env_nested_delimiter=None, _env_nested_max_split=None, _env_parse_none_str=None, _env_parse_enums=None, _cli_prog_name=None, _cli_parse_args=None, _cli_settings_source=None, _cli_parse_none_str=None, _cli_hide_none_type=None, _cli_avoid_json=None, _cli_enforce_required=None, _cli_use_class_docs_for_groups=None, _cli_exit_on_error=None, _cli_prefix=None, _cli_flag_prefix_char=None, _cli_implicit_flags=None, _cli_ignore_unknown_args=None, _cli_kebab_case=None, _secrets_dir=None, **values)
Bases:
Plugin
Orama plugin model for vdoc.
- property active: bool
Check if the plugin is active.
- Returns:
True if the plugin is active, False otherwise.
-
dictionary:
OramaDictionary
|None
- model_config: ClassVar[SettingsConfigDict] = {'env_nested_delimiter': '__', 'env_parse_none_str': 'None', 'env_prefix': 'VDOC_PLUGINS_orama_'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context, /)
This function is meant to behave like a BaseModel method to initialise private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Parameters:
self (
BaseModel
) – The BaseModel instance.context (
Any
) – The context.
- Return type:
None
vdoc.models.plugins.theme module
Contains the theme plugin.
- class vdoc.models.plugins.theme.ThemePlugin(_case_sensitive=None, _nested_model_default_partial_update=None, _env_prefix=None, _env_file=PosixPath('.'), _env_file_encoding=None, _env_ignore_empty=None, _env_nested_delimiter=None, _env_nested_max_split=None, _env_parse_none_str=None, _env_parse_enums=None, _cli_prog_name=None, _cli_parse_args=None, _cli_settings_source=None, _cli_parse_none_str=None, _cli_hide_none_type=None, _cli_avoid_json=None, _cli_enforce_required=None, _cli_use_class_docs_for_groups=None, _cli_exit_on_error=None, _cli_prefix=None, _cli_flag_prefix_char=None, _cli_implicit_flags=None, _cli_ignore_unknown_args=None, _cli_kebab_case=None, _secrets_dir=None, **values)
Bases:
Plugin
Theme plugin model for vdoc.
- property active: bool
Check if the plugin is active.
- Returns:
True if the plugin is active, False otherwise.
-
dark:
ThemeSettings
-
light:
ThemeSettings
- model_config: ClassVar[SettingsConfigDict] = {'env_nested_delimiter': '__', 'env_parse_none_str': 'None', 'env_prefix': 'VDOC_PLUGINS_theme_'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context, /)
This function is meant to behave like a BaseModel method to initialise private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Parameters:
self (
BaseModel
) – The BaseModel instance.context (
Any
) – The context.
- Return type:
None
Module contents
Contains all plugins models.
Bases:
Plugin
Footer plugin model for vdoc.
Check if the plugin is active.
- Returns:
True if the plugin is active, False otherwise.
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
This function is meant to behave like a BaseModel method to initialise private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Parameters:
self (
BaseModel
) – The BaseModel instance.context (
Any
) – The context.
- Return type:
None
- class vdoc.models.plugins.OramaPlugin(_case_sensitive=None, _nested_model_default_partial_update=None, _env_prefix=None, _env_file=PosixPath('.'), _env_file_encoding=None, _env_ignore_empty=None, _env_nested_delimiter=None, _env_nested_max_split=None, _env_parse_none_str=None, _env_parse_enums=None, _cli_prog_name=None, _cli_parse_args=None, _cli_settings_source=None, _cli_parse_none_str=None, _cli_hide_none_type=None, _cli_avoid_json=None, _cli_enforce_required=None, _cli_use_class_docs_for_groups=None, _cli_exit_on_error=None, _cli_prefix=None, _cli_flag_prefix_char=None, _cli_implicit_flags=None, _cli_ignore_unknown_args=None, _cli_kebab_case=None, _secrets_dir=None, **values)
Bases:
Plugin
Orama plugin model for vdoc.
- property active: bool
Check if the plugin is active.
- Returns:
True if the plugin is active, False otherwise.
-
dictionary:
OramaDictionary
|None
- model_config: ClassVar[SettingsConfigDict] = {'env_nested_delimiter': '__', 'env_parse_none_str': 'None', 'env_prefix': 'VDOC_PLUGINS_orama_'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context, /)
This function is meant to behave like a BaseModel method to initialise private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Parameters:
self (
BaseModel
) – The BaseModel instance.context (
Any
) – The context.
- Return type:
None
- class vdoc.models.plugins.ThemePlugin(_case_sensitive=None, _nested_model_default_partial_update=None, _env_prefix=None, _env_file=PosixPath('.'), _env_file_encoding=None, _env_ignore_empty=None, _env_nested_delimiter=None, _env_nested_max_split=None, _env_parse_none_str=None, _env_parse_enums=None, _cli_prog_name=None, _cli_parse_args=None, _cli_settings_source=None, _cli_parse_none_str=None, _cli_hide_none_type=None, _cli_avoid_json=None, _cli_enforce_required=None, _cli_use_class_docs_for_groups=None, _cli_exit_on_error=None, _cli_prefix=None, _cli_flag_prefix_char=None, _cli_implicit_flags=None, _cli_ignore_unknown_args=None, _cli_kebab_case=None, _secrets_dir=None, **values)
Bases:
Plugin
Theme plugin model for vdoc.
- property active: bool
Check if the plugin is active.
- Returns:
True if the plugin is active, False otherwise.
-
dark:
ThemeSettings
-
light:
ThemeSettings
- model_config: ClassVar[SettingsConfigDict] = {'env_nested_delimiter': '__', 'env_parse_none_str': 'None', 'env_prefix': 'VDOC_PLUGINS_theme_'}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context, /)
This function is meant to behave like a BaseModel method to initialise private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Parameters:
self (
BaseModel
) – The BaseModel instance.context (
Any
) – The context.
- Return type:
None