Skip to main content

make_relative_link

Function make_relative_link 

Source
pub(crate) fn make_relative_link(target_url: &str, current_path: &str) -> String
Expand description

Computes a relative link from current_path to target_url.

If the target is in the same file, returns just the #anchor part. Otherwise returns a relative path like ../syntax/items.html#anchor.