pydata_sphinx_theme.logo#
customize events for logo management.
we use one event to copy over custom logo images to _static and another even to link them in the html context
Functions#
|
Copy logo image to the _static directory. |
Return theme options for the application w/ a fallback if they don't exist. |
|
|
Wraps the Sphinx logger to allow warning suppression. |
|
Set up relative paths to logos in our HTML templates. |
Module Contents#
- pydata_sphinx_theme.logo.copy_logo_images(app, exception=None)[source]#
Copy logo image to the _static directory.
If logo image paths are given, copy them to the _static folder Then we can link to them directly in an html_page_context event.
- Parameters:
- Return type:
None
- pydata_sphinx_theme.logo.get_theme_options_dict(app)[source]#
Return theme options for the application w/ a fallback if they don’t exist.
The “top-level” mapping (the one we should usually check first, and modify if desired) is
app.builder.theme_options
. It is created by Sphinx as a copy ofapp.config.html_theme_options
(containing user-configs from theirconf.py
); sometimes that copy never occurs though which is why we check both.- Parameters:
- Return type:
Dict[str, Any]
- pydata_sphinx_theme.logo.maybe_warn(app, msg, *args, **kwargs)[source]#
Wraps the Sphinx logger to allow warning suppression.
- Parameters:
- pydata_sphinx_theme.logo.setup_logo_path(app, pagename, templatename, context, doctree)[source]#
Set up relative paths to logos in our HTML templates.
In Sphinx, the context[“logo”] is a path to the html_logo image now in the output _static folder.
If logo[“image_light”] and logo[“image_dark”] are given, we must modify them to follow the same pattern. They have already been copied to the output folder in the update_config event.
- Parameters:
pagename (str)
templatename (str)
context (dict)
doctree (docutils.nodes.Node)
- Return type:
None