class documentation

This linker implements smart caching functionalities on top of public methods defined in _EpydocLinker.

The cache is implemented at the Tag (Stan) level, letting us do transformation over cached Tag instances and recycle already resolved URLs and adjust them to change formatting as requested by link_xref().

Class CacheEntry Undocumented
Exception NewDerivedEntry Undocumented
Method __init__ Undocumented
Method link_to Format a link to a Python identifier. This will resolve the identifier like Python itself would.
Method link_xref Format a cross-reference link to a Python identifier. This will resolve the identifier to any reasonable target, even if it has to look in places where Python itself would not.
Method _adjust_link Undocumented
Method _get_cache Undocumented
Method _lookup_cached_entry Undocumented
Method _lookup_cached_link_to Undocumented
Method _lookup_cached_link_xref Undocumented
Method _new_derived_entry Undocumented
Method _store_in_cache Undocumented
Type Alias _CacheType Undocumented
Class Variable _defaultCache Undocumented
Instance Variable _link_to_cache Undocumented
Instance Variable _link_xref_cache Undocumented

Inherited from _EpydocLinker:

Exception LookupFailed Encapsulate a link tag that is not actually a link because we count not resolve the name.
Method disable_same_page_optimazation By default, when linkng to an object on the same page, the linker will generate an URL that links to the anchor only, this will avoid reloading the page needlessly. But sometimes we're using a linker to present the content on another page...
Method look_for_intersphinx Return link for `name` based on intersphinx inventory.
Method look_for_name Undocumented
Method resolve_identifier Resolve a Python identifier. This will resolve the identifier like Python itself would.
Instance Variable obj Undocumented
Instance Variable same_page_optimization Undocumented
Instance Variable strict Undocumented
Static Method _create_intersphinx_link Create a link with the special 'intersphinx-link' CSS class.
Method _resolve_identifier_xref Resolve a crossreference link to a Python identifier. This will resolve the identifier to any reasonable target, even if it has to look in places where Python itself would not.
def __init__(self, obj, same_page_optimization=True): (source)

Undocumented

Parameters
obj:model.DocumentableUndocumented
same_page_optimization:boolUndocumented
def link_to(self, target, label): (source)

Format a link to a Python identifier. This will resolve the identifier like Python itself would.

Parameters
target:strThe name of the Python identifier that should be linked to.
label:FlattenableThe label to show for the link.
Returns
TagThe link, or just the label if the target was not found.
def link_xref(self, target, label, lineno): (source)

Format a cross-reference link to a Python identifier. This will resolve the identifier to any reasonable target, even if it has to look in places where Python itself would not.

Parameters
target:strThe name of the Python identifier that should be linked to.
label:FlattenableThe label to show for the link.
lineno:intThe line number within the docstring at which the crossreference is located.
Returns
TagThe link, or just the label if the target was not found. In either case, the returned top-level tag will be <code>.
def _adjust_link(self, link, use_same_page_optimization): (source)

Undocumented

Parameters
link:TagUndocumented
use_same_page_optimization:boolUndocumented
Returns
Optional[Tag]Undocumented
def _get_cache(self, cache_kind='link_to'): (source)

Undocumented

Parameters
cache_kind:Literal['link_to', 'link_xref']Undocumented
Returns
_CachedEpydocLinker._CacheTypeUndocumented
def _lookup_cached_entry(self, target, label, cache_kind='link_to'): (source)

Undocumented

Parameters
target:strUndocumented
label:FlattenableUndocumented
cache_kind:Literal['link_to', 'link_xref']Undocumented
Returns
Optional[_CachedEpydocLinker.CacheEntry]Undocumented
def _lookup_cached_link_to(self, target, label): (source)

Undocumented

Parameters
target:strUndocumented
label:FlattenableUndocumented
Returns
Optional[Tag]Undocumented
def _lookup_cached_link_xref(self, target, label, lineno): (source)

Undocumented

Parameters
target:strUndocumented
label:FlattenableUndocumented
lineno:intUndocumented
Returns
Optional[Tag]Undocumented
def _new_derived_entry(self, cached_entry, label, cache_kind='link_to'): (source)

Undocumented

Parameters
cached_entry:_CachedEpydocLinker.CacheEntryUndocumented
label:Optional[Flattenable]Undocumented
cache_kind:Literal['link_to', 'link_xref']Undocumented
Returns
_CachedEpydocLinker.CacheEntryUndocumented
def _store_in_cache(self, target, label, link, cache_kind='link_to', lookup_failed=False, warned_linenos=None): (source)

Undocumented

Parameters
target:strUndocumented
label:FlattenableUndocumented
link:TagUndocumented
cache_kind:Literal['link_to', 'link_xref']Undocumented
lookup_failed:boolUndocumented
warned_linenos:Optional[Set[int]]Undocumented
Returns
_CachedEpydocLinker.CacheEntryUndocumented
_CacheType = (source)

Undocumented

Value
Dict[str, Dict[bool, List['_CachedEpydocLinker.CacheEntry']]]
_defaultCache: _CacheType = (source)

Undocumented

Undocumented