class Theme(object)
A theme contains templates for use with the JinjaRDF site builder.
Attributes:
package str - the full dotted path of the theme’s package, e.g. ‘foo.bar.basetheme’name str - A human-readable name of the theme. Default is the theme’s subpackage,
e.g. ‘basetheme’.template_path str - The template path relative to the theme’s package.
Defaults to ‘templates’.asset_path str - The asset path relative to the theme’s package.
Defaults to ‘assets’.config_path str - The config path relative to the theme’s package.
Defaults to ‘config’.file_paths dict - A dict to get self.template_path and self.asset_path
by name (either self.file_paths['templates'] or self.file_paths['assets']).def __init__(package: str,
name: str = None,
template_path: str = 'templates',
asset_path: str = 'assets',
config_path: str = 'config')
Initialize the theme
Arguments:
package str - the full dotted path of the theme’s package, e.g. ‘foo.bar.basetheme’name str - Optional human-readable theme name. If None, then theme.name
will be the name of the theme’s subpackage (e.g. ‘basetheme’).
Defaults to None.template_path str, optional - The template path relative to the theme’s package.
Defaults to ‘templates’.asset_path str, optional - The asset path relative to the theme’s package.
Defaults to ‘assets’.def resolve_package() -> Traversable
Take self.package and resolve to its location as a Traversable,
regardless of having been installed in editable mode or not.
Returns:
Traversable - The location of the package, e.g. as a Path or
a MultiplexedPath.def copy_templates(target_folder: str) -> list
Copy the theme’s templates to a subfolder in the site generator’s template folder.
Arguments:
target_folder str - the site generator’s template folderReturns:
list - the names of the copied templatesdef copy_assets(target_folder: str) -> list
Copy the theme’s assets to a subfolder in the site generator’s asset folder.
Arguments:
target_folder str - the site generator’s asset folderReturns:
list - the names of the copied assetsdef copy_config(target_folder: str) -> list
Copy the theme’s config to a subfolder in the site generator’s config folder.
Arguments:
target_folder str - the site generator’s config folderReturns:
list - the list of the copied config files