LinkResolver

Trait LinkResolver 

Source
pub trait LinkResolver {
    // Required methods
    fn link_registry(&self) -> Option<&LinkRegistry>;
    fn process_docs(&self, item: &Item, current_file: &str) -> Option<String>;
    fn create_link(&self, id: Id, current_file: &str) -> Option<String>;
}
Expand description

Link creation and documentation processing.

Handles intra-doc link resolution and markdown link generation.

Required Methods§

Get the link registry for single-crate mode.

Returns None in multi-crate mode where UnifiedLinkRegistry is used instead.

Source

fn process_docs(&self, item: &Item, current_file: &str) -> Option<String>

Process documentation string with intra-doc link resolution.

Transforms [`Type`] style links in doc comments into proper markdown links. Also strips duplicate titles and reference definitions.

§Arguments
  • item - The item whose docs to process (provides docs and links map)
  • current_file - Path of the current file (for relative link calculation)

Create a markdown link to an item.

§Arguments
  • id - The item ID to link to
  • current_file - Path of the current file (for relative link calculation)
§Returns

A markdown link like [Name](path/to/item.md), or None if the item cannot be linked.

Implementors§