betty.extension.cotton_candy package¶
Submodules¶
Module contents¶
Provide Betty’s default theme.
- class betty.extension.cotton_candy.CottonCandy[source]¶
Bases:
Theme
,CssProvider
,ConfigurableExtension
[CottonCandyConfiguration
],Generator
,GuiBuilder
,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._local.Path [source]¶
Return the path on disk where the extension’s assets are located.
This may be anywhere in your Python package.
- Return type:
pathlib._local.Path
- classmethod comes_after() set[type[betty.app.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.app.extension.Extension]] [source]¶
The extensions this one depends on, and comes after.
- Return type:
- classmethod description() betty.locale.Str [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.
- gui_build() PyQt6.QtWidgets.QWidget [source]¶
Build this extension’s Graphical User Interface component.
- Return type:
PyQt6.QtWidgets.QWidget
- classmethod label() betty.locale.Str [source]¶
Get the human-readable extension label.
- Return type:
- property logo: Path¶
The path to the logo file.
- 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:
- class betty.extension.cotton_candy.CottonCandyConfiguration[source]¶
Bases:
Configuration
Provide configuration for the
betty.extension.cotton_candy.CottonCandy
extension.- Parameters:
featured_entities (Sequence[EntityReference[UserFacingEntity & Entity]] | None)
primary_inactive_color (str)
primary_active_color (str)
link_inactive_color (str)
link_active_color (str)
logo (Path | None)
- DEFAULT_LINK_ACTIVE_COLOR = '#2a615a'¶
- DEFAULT_LINK_INACTIVE_COLOR = '#149988'¶
- DEFAULT_PRIMARY_ACTIVE_COLOR = '#ff69b4'¶
- DEFAULT_PRIMARY_INACTIVE_COLOR = '#ffc0cb'¶
- __init__(*, featured_entities: Sequence[EntityReference[UserFacingEntity & Entity]] | None = None, primary_inactive_color: str = '#ffc0cb', primary_active_color: str = '#ff69b4', link_inactive_color: str = '#149988', link_active_color: str = '#2a615a', logo: Path | None = None)[source]¶
- Parameters:
featured_entities (Sequence[EntityReference[UserFacingEntity & Entity]] | None)
primary_inactive_color (str)
primary_active_color (str)
link_inactive_color (str)
link_active_color (str)
logo (Path | None)
- dump() bool | int | float | str | None | Sequence[bool | int | float | str | None | Sequence[Dump] | Mapping[str, Dump]] | Mapping[str, bool | int | float | str | None | Sequence[Dump] | Mapping[str, Dump]] | type[betty.serde.dump.Void] [source]¶
Dump this instance to a portable format.
- Return type:
typing.Union
[bool
,int
,float
,str
,None
,typing.Sequence
[typing.Union
[bool
,int
,float
,str
,None
,typing.Sequence
[Dump],typing.Mapping
[str
, Dump]]],typing.Mapping
[str
,typing.Union
[bool
,int
,float
,str
,None
,typing.Sequence
[Dump],typing.Mapping
[str
, Dump]]],type
[betty.serde.dump.Void
]]
- property featured_entities: EntityReferenceSequence[UserFacingEntity & Entity]¶
The entities featured on the front page.
- property link_active_color: _ColorConfiguration¶
The color for active hyperlinks.
- property link_inactive_color: _ColorConfiguration¶
The color for inactive hyperlinks.
- classmethod load(dump: bool | int | float | str | None | Sequence[Dump] | Mapping[str, Dump], configuration: Self | None = None) Self [source]¶
Load dumped configuration into a new configuration instance.
- Parameters:
dump (
typing.Union
[bool
,int
,float
,str
,None
,typing.Sequence
[Dump],typing.Mapping
[str
, Dump]])configuration (
typing.Optional
[typing.Self
])
- Return type:
typing.Self
- property primary_active_color: _ColorConfiguration¶
The color for active primary/CTA elements.
- property primary_inactive_color: _ColorConfiguration¶
The color for inactive primary/CTA elements.
- betty.extension.cotton_candy.person_descendant_families(person: betty.model.ancestry.Person) Iterable[tuple[collections.abc.Sequence[betty.model.ancestry.Person], collections.abc.Sequence[betty.model.ancestry.Person]]] [source]¶
Gather a person’s families they are a parent in.
- Parameters:
person (
betty.model.ancestry.Person
)- Return type:
typing.Iterable
[tuple
[collections.abc.Sequence
[betty.model.ancestry.Person
],collections.abc.Sequence
[betty.model.ancestry.Person
]]]
- betty.extension.cotton_candy.person_timeline_events(person: betty.model.ancestry.Person, lifetime_threshold: int) Iterable[betty.model.ancestry.Event] [source]¶
Gather all events for a person’s timeline.
- Parameters:
person (
betty.model.ancestry.Person
)lifetime_threshold (
int
)
- Return type: