betty.extension package¶
Subpackages¶
- betty.extension.cotton_candy package
- Submodules
- Module contents
CottonCandy
CottonCandy.assets_directory_path()
CottonCandy.comes_after()
CottonCandy.default_configuration()
CottonCandy.depends_on()
CottonCandy.description()
CottonCandy.filters
CottonCandy.generate()
CottonCandy.globals
CottonCandy.label()
CottonCandy.logo
CottonCandy.name()
CottonCandy.public_css_paths
CottonCandy.webpack_entry_point_cache_keys()
CottonCandy.webpack_entry_point_directory_path()
CottonCandyConfiguration
CottonCandyConfiguration.DEFAULT_LINK_ACTIVE_COLOR
CottonCandyConfiguration.DEFAULT_LINK_INACTIVE_COLOR
CottonCandyConfiguration.DEFAULT_PRIMARY_ACTIVE_COLOR
CottonCandyConfiguration.DEFAULT_PRIMARY_INACTIVE_COLOR
CottonCandyConfiguration.__init__()
CottonCandyConfiguration.dump()
CottonCandyConfiguration.featured_entities
CottonCandyConfiguration.link_active_color
CottonCandyConfiguration.link_inactive_color
CottonCandyConfiguration.load()
CottonCandyConfiguration.logo
CottonCandyConfiguration.primary_active_color
CottonCandyConfiguration.primary_inactive_color
associated_files()
person_descendant_families()
person_timeline_events()
- betty.extension.demo package
- betty.extension.deriver package
- betty.extension.gramps package
- betty.extension.http_api_doc package
- betty.extension.maps package
- betty.extension.nginx package
- betty.extension.privatizer package
- betty.extension.trees package
- betty.extension.webpack package
- betty.extension.wikipedia package
Module contents¶
Provide the built-in extensions.
- class betty.extension.CottonCandy[source]¶
Bases:
Theme
,CssProvider
,ConfigurableExtension
[CottonCandyConfiguration
],Generator
,Jinja2Provider
,WebpackEntryPointProvider
Provide Betty’s default front-end theme.
- Parameters:
args (
typing.Any
)configuration (
typing.Optional
[typing.TypeVar
(_ConfigurationT
, bound=betty.config.Configuration
)])kwargs (
typing.Any
)
- classmethod assets_directory_path() pathlib.Path [source]¶
Return the path on disk where the extension’s assets are located.
This may be anywhere in your Python package.
- Return type:
- classmethod comes_after() set[type[betty.project.extension.Extension]] [source]¶
The extensions that this one comes after.
The other extensions may or may not be enabled.
- Return type:
- classmethod default_configuration() betty.extension.cotton_candy.CottonCandyConfiguration [source]¶
Get this extension’s default configuration.
- classmethod depends_on() set[type[betty.project.extension.Extension]] [source]¶
The extensions this one depends on, and comes after.
- Return type:
- classmethod description() betty.locale.localizable.Localizable [source]¶
Get the human-readable extension description.
- Return type:
- property filters: dict[str, Callable[[...], Any]]¶
Jinja2 filters provided by this extension.
Keys are filter names, and values are the filters themselves.
- async generate(job_context: betty.generate.GenerationContext) None [source]¶
Generate (part of) a project’s site.
- Parameters:
job_context (
betty.generate.GenerationContext
)- Return type:
- property globals: dict[str, Any]¶
Jinja2 globals provided by this extension.
Keys are the globals’ names, and values are the globals’ values.
- classmethod label() betty.locale.localizable.Localizable [source]¶
Get the human-readable extension label.
- Return type:
- property public_css_paths: list[str]¶
The public URL paths to the CSS files to include in each HTML page.
- webpack_entry_point_cache_keys() collections.abc.Sequence[str] [source]¶
Get the keys that make a Webpack build for this provider unique.
Providers that can be cached regardless may
return ()
.- Return type:
- classmethod webpack_entry_point_directory_path() pathlib.Path [source]¶
Get the path to the directory with the entry point assets.
The directory must include at least a
package.json
andmain.ts
.- Return type:
- class betty.extension.Demo[source]¶
-
Provide demonstration site functionality.
- Parameters:
project (
betty.project.Project
)args (
typing.Any
)kwargs (
typing.Any
)
- classmethod depends_on() set[type[betty.project.extension.Extension]] [source]¶
The extensions this one depends on, and comes after.
- Return type:
- class betty.extension.Deriver[source]¶
Bases:
UserFacingExtension
,PostLoader
Expand an ancestry by deriving additional data from existing data.
- Parameters:
project (
betty.project.Project
)args (
typing.Any
)kwargs (
typing.Any
)
- classmethod comes_before() set[type[betty.project.extension.Extension]] [source]¶
The extensions that this one comes before.
The other extensions may or may not be enabled.
- Return type:
- classmethod description() betty.locale.localizable.Localizable [source]¶
Get the human-readable extension description.
- Return type:
- classmethod label() betty.locale.localizable.Localizable [source]¶
Get the human-readable extension label.
- Return type:
- async post_load() None [source]¶
Act on the ancestry having been loaded.
This method is called immediately after
betty.load.Loader.load()
.- Return type:
- class betty.extension.Gramps[source]¶
Bases:
ConfigurableExtension
[GrampsConfiguration
],UserFacingExtension
,Loader
Integrate Betty with Gramps.
- Parameters:
args (
typing.Any
)configuration (
typing.Optional
[typing.TypeVar
(_ConfigurationT
, bound=betty.config.Configuration
)])kwargs (
typing.Any
)
- classmethod default_configuration() betty.extension.gramps.config.GrampsConfiguration [source]¶
Get this extension’s default configuration.
- Return type:
- classmethod description() betty.locale.localizable.Localizable [source]¶
Get the human-readable extension description.
- Return type:
- classmethod label() betty.locale.localizable.Localizable [source]¶
Get the human-readable extension label.
- Return type:
- class betty.extension.HttpApiDoc[source]¶
Bases:
UserFacingExtension
,WebpackEntryPointProvider
Provide user-friendly HTTP API documentation.
- Parameters:
project (
betty.project.Project
)args (
typing.Any
)kwargs (
typing.Any
)
- classmethod assets_directory_path() pathlib.Path [source]¶
Return the path on disk where the extension’s assets are located.
This may be anywhere in your Python package.
- Return type:
- classmethod depends_on() set[type[betty.project.extension.Extension]] [source]¶
The extensions this one depends on, and comes after.
- Return type:
- classmethod description() betty.locale.localizable.Localizable [source]¶
Get the human-readable extension description.
- Return type:
- classmethod label() betty.locale.localizable.Localizable [source]¶
Get the human-readable extension label.
- Return type:
- webpack_entry_point_cache_keys() collections.abc.Sequence[str] [source]¶
Get the keys that make a Webpack build for this provider unique.
Providers that can be cached regardless may
return ()
.- Return type:
- classmethod webpack_entry_point_directory_path() pathlib.Path [source]¶
Get the path to the directory with the entry point assets.
The directory must include at least a
package.json
andmain.ts
.- Return type:
- class betty.extension.Maps[source]¶
Bases:
UserFacingExtension
,WebpackEntryPointProvider
Provide interactive maps for use on web pages.
- Parameters:
project (
betty.project.Project
)args (
typing.Any
)kwargs (
typing.Any
)
- classmethod assets_directory_path() pathlib.Path [source]¶
Return the path on disk where the extension’s assets are located.
This may be anywhere in your Python package.
- Return type:
- classmethod depends_on() set[type[betty.project.extension.Extension]] [source]¶
The extensions this one depends on, and comes after.
- Return type:
- classmethod description() betty.locale.localizable.Localizable [source]¶
Get the human-readable extension description.
- Return type:
- classmethod label() betty.locale.localizable.Localizable [source]¶
Get the human-readable extension label.
- Return type:
- webpack_entry_point_cache_keys() collections.abc.Sequence[str] [source]¶
Get the keys that make a Webpack build for this provider unique.
Providers that can be cached regardless may
return ()
.- Return type:
- classmethod webpack_entry_point_directory_path() pathlib.Path [source]¶
Get the path to the directory with the entry point assets.
The directory must include at least a
package.json
andmain.ts
.- Return type:
- class betty.extension.Nginx[source]¶
Bases:
ConfigurableExtension
[NginxConfiguration
],UserFacingExtension
,Generator
Integrate Betty with nginx (and Docker).
- Parameters:
args (
typing.Any
)configuration (
typing.Optional
[typing.TypeVar
(_ConfigurationT
, bound=betty.config.Configuration
)])kwargs (
typing.Any
)
- classmethod assets_directory_path() pathlib.Path | None [source]¶
Return the path on disk where the extension’s assets are located.
This may be anywhere in your Python package.
- Return type:
- classmethod default_configuration() betty.extension.nginx.config.NginxConfiguration [source]¶
Get this extension’s default configuration.
- Return type:
- classmethod description() betty.locale.localizable.Localizable [source]¶
Get the human-readable extension description.
- Return type:
- async generate(job_context: betty.generate.GenerationContext) None [source]¶
Generate (part of) a project’s site.
- Parameters:
job_context (
betty.generate.GenerationContext
)- Return type:
- classmethod label() betty.locale.localizable.Localizable [source]¶
Get the human-readable extension label.
- Return type:
- class betty.extension.Privatizer[source]¶
Bases:
UserFacingExtension
,PostLoader
Extend the Betty Application with privatization features.
- Parameters:
project (
betty.project.Project
)args (
typing.Any
)kwargs (
typing.Any
)
- classmethod description() betty.locale.localizable.Localizable [source]¶
Get the human-readable extension description.
- Return type:
- classmethod label() betty.locale.localizable.Localizable [source]¶
Get the human-readable extension label.
- Return type:
- async post_load() None [source]¶
Act on the ancestry having been loaded.
This method is called immediately after
betty.load.Loader.load()
.- Return type:
- class betty.extension.Trees[source]¶
Bases:
UserFacingExtension
,WebpackEntryPointProvider
Provide interactive family trees for use in web pages.
- Parameters:
project (
betty.project.Project
)args (
typing.Any
)kwargs (
typing.Any
)
- classmethod assets_directory_path() pathlib.Path [source]¶
Return the path on disk where the extension’s assets are located.
This may be anywhere in your Python package.
- Return type:
- classmethod depends_on() set[type[betty.project.extension.Extension]] [source]¶
The extensions this one depends on, and comes after.
- Return type:
- classmethod description() betty.locale.localizable.Localizable [source]¶
Get the human-readable extension description.
- Return type:
- classmethod label() betty.locale.localizable.Localizable [source]¶
Get the human-readable extension label.
- Return type:
- webpack_entry_point_cache_keys() collections.abc.Sequence[str] [source]¶
Get the keys that make a Webpack build for this provider unique.
Providers that can be cached regardless may
return ()
.- Return type:
- classmethod webpack_entry_point_directory_path() pathlib.Path [source]¶
Get the path to the directory with the entry point assets.
The directory must include at least a
package.json
andmain.ts
.- Return type:
- class betty.extension.Webpack[source]¶
Bases:
Extension
,CssProvider
,Jinja2Provider
,Generator
Integrate Betty with Webpack.
- Parameters:
project (
betty.project.Project
)args (
typing.Any
)kwargs (
typing.Any
)
- classmethod assets_directory_path() pathlib.Path [source]¶
Return the path on disk where the extension’s assets are located.
This may be anywhere in your Python package.
- Return type:
- build_requirement() betty.requirement.Requirement [source]¶
Get the requirement that must be satisfied for Webpack builds to be available.
- Return type:
- classmethod enable_requirement() betty.requirement.Requirement [source]¶
Define the requirement for this extension to be enabled.
This defaults to the extension’s dependencies.
- Return type:
- property filters: dict[str, Callable[[...], Any]]¶
Jinja2 filters provided by this extension.
Keys are filter names, and values are the filters themselves.
- async generate(job_context: betty.generate.GenerationContext) None [source]¶
Generate (part of) a project’s site.
- Parameters:
job_context (
betty.generate.GenerationContext
)- Return type:
- new_context_vars() dict[str, Any] [source]¶
Create new variables for a new
jinja2.runtime.Context
.Keys are the variable names, and values are variable values.
- Return type:
- async prebuild(job_context: betty.job.Context) None [source]¶
Prebuild the Webpack assets.
- Parameters:
job_context (
betty.job.Context
)- Return type:
- class betty.extension.Wikipedia[source]¶
Bases:
ConfigurableExtension
[WikipediaConfiguration
],UserFacingExtension
,Jinja2Provider
,PostLoader
Integrates Betty with Wikipedia.
- Parameters:
args (
typing.Any
)kwargs (
typing.Any
)
- __init__(*args: Any, **kwargs: Any)[source]¶
- Parameters:
args (
typing.Any
)kwargs (
typing.Any
)
- classmethod assets_directory_path() pathlib.Path | None [source]¶
Return the path on disk where the extension’s assets are located.
This may be anywhere in your Python package.
- Return type:
- classmethod default_configuration() betty.extension.wikipedia.config.WikipediaConfiguration [source]¶
Get this extension’s default configuration.
- classmethod description() betty.locale.localizable.Localizable [source]¶
Get the human-readable extension description.
- Return type:
- property filters: dict[str, Callable[[...], Any]]¶
Jinja2 filters provided by this extension.
Keys are filter names, and values are the filters themselves.
- classmethod label() betty.locale.localizable.Localizable [source]¶
Get the human-readable extension label.
- Return type:
- async post_load() None [source]¶
Act on the ancestry having been loaded.
This method is called immediately after
betty.load.Loader.load()
.- Return type: