MODULE

MKAPI.CORE.LINKER

This module provides functions that relate to link.

Functions
  • get_link(obj, include_module) (str) Returns Markdown link for object, if possible.</>
  • link(name, href) (str) Reutrns Markdown link with a mark that indicates this link was created by MkApi.</>
  • replace_link(obj, markdown) (str) Returns a replaced link with object full name.</>
  • resolve_link(markdown, abs_src_path, abs_api_paths) (str) Reutrns resolved link.</>
  • resolve_object(html) (dict(str: any)) Reutrns an object context dictionary.</>
function

mkapi.core.linker.resolve_object(html) → dict(str: any)

Reutrns an object context dictionary.

Parameters
  • html (str) HTML source.
Examples
>>> resolve_object("<p><a href='a'>p</a><a href='b'>n</a></p>")
{'heading_id': '', 'level': 0, 'prefix_url': 'a', 'name_url': 'b'}
>>> resolve_object("<h2 id='i'><a href='a'>p</a><a href='b'>n</a></h2>")
{'heading_id': 'i', 'level': 2, 'prefix_url': 'a', 'name_url': 'b'}