sphinx_evita¶
Submodules¶
Package Contents¶
Functions¶
Implementation |
|
Add sphinx_evita/_static to resolve css files, logo etc. |
Data¶
API¶
- sphinx_evita.__version__¶
‘version(…)’
- sphinx_evita.LOGGER: Final[sphinx.util.logging.SphinxLoggerAdapter]¶
‘getLogger(…)’
- sphinx_evita.STATIC_PATH¶
None
- sphinx_evita.setup(app: sphinx.application.Sphinx) dict[str, Any]¶
Implementation
The main powerhorse of this extension is
sphinx_evita.setup(). It does the following:Connects the
sphinx_evita.init_static_path()function to thebuilder-initedevent. This ensures that static files (like CSS or JavaScript) are properly linked when the HTML page loads.Sets up three sub-extensions:
sphinx_evita.pdfembed: exposes thepdfembeddirective.sphinx_evita.directives: defines some more custom Sphinx directives for the extension.sphinx_evita.css: links extra CSS stylesheets.
Checks if the current project is an EVITA project using the
sphinx_evita.hooks.is_evita_project()function. If it is, it configures branding and theme settings by connecting thesphinx_evita.hooks.config_branding()andsphinx_evita.hooks.config_theme()functions to theconfig-initedevent. If not, it logs a warning. Which means that certainconf.pyvalues gets overwritten.
Finally it returns a dictionary with metadata about the extension, including its version and flags indicating that it is safe for parallel reading and writing.
Configuration
The extension also declares certain configuration values meant for Sphinx
conf.py,evita_pdfembed_html_tagwhich defaults to"iframe". This means that an<iframe ...></iframe>HTML tag will be used to embed the PDF. Alternative value is"object"tag which embeds using an<object></object>.
evita_eu_funding_badge: Add EU badge to the page footer. Supported values are"funded","co-funded",""(default, empty string). Original files from sourced from here. In the special case where it is detected to be an EVITA project bysphinx_evita.hooks.is_evita_project(), the badge will be set as"funded"automatically.
- sphinx_evita.init_static_path(app: sphinx.application.Sphinx)¶
Add sphinx_evita/_static to resolve css files, logo etc.