Defined in: lib/HTMLSerializer__LinkResolver.js
String | lookup() |
String | linkify(String) |
String | renderLink(Object, Object) |
Linkify all internal links found in a block of text.
docstring | String The block of text possibly containing internal links. |
String The text with all the internal links that were successfully resolved replaced with markdown-formatted links. |
Example
LinkResolver.linkify('See [Module]() for more info.');
// => "See [ModuleTitle](/internal/path/to/module) for more info."
Look up an item and generate a URL to it, if found.
params.path | String The index path. |
params.contextNode | T.Node The node we're resolving from. |
link | Object |
link.href | String |
link.title | String |
params | Object |
params.contextNode | T.Node |
params.strict | Boolean Will warn when enabled and the link could not be resolved. Defaults to: |
params.format | String One of "html" or "markdown". |
descriptor | Object |
descriptor.source | String The source string that generated this link. This must be present so that we can use it if the link could not be resolved, in which case we'll use it as a text for a "broken" anchor that will be highlighted in the UI. |
descriptor.path | String The index path to resolve. |
descriptor.text | String Will be used as the anchor's text. If not specified, we'll use the document's title in its place. |
descriptor.title | String Will be used as the anchor's [title] attribute (a tooltip). If not specified, we'll use the document's summary in its place. |
String |
Made with ♥ using megadoc.