origen.web.shorthand
¶
Submodules¶
Functions¶
add_defs()
: Dynamically adds namespaced definitions and generates the appropriate output files.anchor_to()
: Although in this phase we could generate RST, we don’t actually know the contextcheck_consistency()
: Targets here bypass Sphinx’s ref/doc/whatever checkers and could potentially allowcheck_link()
: Checks if the given link points to somewherehref_to()
: Generates an href for the target. The exact nature is determined by the HREF type.link_to()
: Inserts ashorthand-link-to
role with the given target and txtset_default_output_dir()
: Undocumented.setup()
: Callback for Sphinx to setup the extension.templating_context()
: Undocumented.update_unchecked_targets()
: Undocumented.
-
origen.web.shorthand.
add_defs
(defs, *, namespace=None)¶ Dynamically adds namespaced definitions and generates the appropriate output files.
Defintions added here must be namespaced. Adding to the project definitions is not supported.
-
origen.web.shorthand.
anchor_to
(target, txt)¶ Although in this phase we could generate RST, we don’t actually know the context in which this method is used. Mostly likely, this will actually be invoked from an
.. raw
block or the like. To skip over needing the context, or trying to figure out what the ‘typical’ usage should be, we’re just going to jump straight to HTML. We’ll cache the targets and ensure they’re valid during the consistency check phase.
-
origen.web.shorthand.
check_consistency
(app, env)¶ Targets here bypass Sphinx’s ref/doc/whatever checkers and could potentially allow for bad targets to make its way into the resulting pages. Other methods will note these potential targets and they’ll be checked here after all the documents have been read.
Only ‘refs’, ‘docs’, or ‘statics’ should make there way here - unless others are added in the future.
-
origen.web.shorthand.
check_link
(link, *, warning_prefix=None)¶ Checks if the given link points to somewhere
-
origen.web.shorthand.
href_to
(target, *, docname=None)¶ Generates an href for the target. The exact nature is determined by the HREF type.
‘ref’ - target is ‘cleaned’. E.g: ‘dir/my_label:header’ -> ‘<relative_path>/my_label#header’
‘doc/static’ - target is re-targetted as a relative path from the callin document.
‘absolute_links’ - just returns the target
-
origen.web.shorthand.
link_to
(target, txt=None, **opts)¶ Inserts a
shorthand-link-to
role with the given target and txt
-
origen.web.shorthand.
set_default_output_dir
(dirname)¶
-
origen.web.shorthand.
setup
(sphinx)¶ Callback for Sphinx to setup the extension.
-
origen.web.shorthand.
templating_context
(app)¶
-
origen.web.shorthand.
update_unchecked_targets
(target)¶