hoverxref.extension
Module Contents
Functions
|
Copy all assets after build finished successfully. |
|
Override domains respecting the one defined (if any). |
|
Disconnect |
|
Disconnect |
|
Override original |
|
Auto-configure default settings for known themes. |
|
Tell Sphinx to always include assets in all HTML pages. |
|
Log warning message if old configs are used. |
|
Setup |
Attributes
- hoverxref.extension.logger
- hoverxref.extension.CSS_CLASS_PREFIX = 'hxr-'
- hoverxref.extension.CSS_DEFAULT_CLASS
- hoverxref.extension.CSS_CLASSES
- hoverxref.extension.HOVERXREF_ASSETS_FILES = ['js/hoverxref.js_t']
- hoverxref.extension.TOOLTIP_ASSETS_FILES = ['js/tooltipster.bundle.min.js', 'css/tooltipster.custom.css_t',...
- hoverxref.extension.MODAL_ASSETS_FILES = ['js/micromodal.min.js', 'css/micromodal.css']
- hoverxref.extension.ASSETS_FILES
- hoverxref.extension.copy_asset_files(app, exception)
Copy all assets after build finished successfully.
Assets that are templates (ends with
_t
) are previously rendered using using all the configs starting withhoverxref_
as a context.
- hoverxref.extension.setup_domains(app, config)
Override domains respecting the one defined (if any).
We create a new class by inheriting the Sphinx Domain already defined and our own
HoverXRef...DomainMixin
that includes the logic for_hoverxref
attributes.
- hoverxref.extension.setup_sphinx_tabs(app, config)
Disconnect
update_context
function fromsphinx-tabs
.Sphinx Tabs removes the CSS/JS from pages that does not use the directive. Although, we need them to use inside the tooltip.
- hoverxref.extension.setup_intersphinx(app, config)
Disconnect
missing-reference
fromsphinx.ext.intershinx
.As there is no way to hook into the
missing_referece
function to add some extra data to the docutils node returned by this function, we disconnect the original listener and add our custom one.https://github.com/sphinx-doc/sphinx/blob/53c1dff/sphinx/ext/intersphinx.py
- hoverxref.extension.missing_reference(app, env, node, contnode)
Override original
missing_referece
to add data into the node.We call the original intersphinx extension and add hoverxref CSS classes plus the
data-url
to the node returned from it.Sphinx intersphinx downloads all the
objects.inv
and load each of them into a “named inventory” and also updates the “main inventory”. We check if reference is part of any of the “named invetories” the user defined inhoverxref_intersphinx
and we add hoverxref to the node only if the reference is on those inventories.See https://github.com/sphinx-doc/sphinx/blob/4d90277c/sphinx/ext/intersphinx.py#L244-L250
- hoverxref.extension.setup_theme(app, exception)
Auto-configure default settings for known themes.
Add a small custom CSS file for a specific theme and set hoverxref configs (if not overwritten by the user) with better defaults for these themes.
- hoverxref.extension.setup_assets_policy(app, exception)
Tell Sphinx to always include assets in all HTML pages.
- hoverxref.extension.deprecated_configs_warning(app, exception)
Log warning message if old configs are used.
- hoverxref.extension.setup(app)
Setup
hoverxref
Sphinx extension.