Expand description
Grep-based inbound link discovery for server mode.
This module provides fast, on-demand discovery of pages that link to a given page by searching through all markdown files in the repository.
§Algorithm
The key challenge is that markdown links can be:
- Absolute:
/a/b/c/1 - Relative to current folder:
c/1,./c/1 - Relative with parent traversal:
../b/c/1,../../a/b/c/1
To efficiently find all links to a target page, we:
- Collect all unique folder paths in the repository
- For each folder, compute which patterns could represent a link to the target
- Build an Aho-Corasick automaton per folder for fast multi-pattern matching
- Scan each file using the automaton for its folder
- Only when a match is found, extract link details with regex
Bare [[Name]] wiki links do not name a path at all: the renderer resolves
them through mbr_core::wikilink_index::WikilinkIndex by title, alias, or
filename stem. Those names are therefore added to the pattern set as well
(gate + wiki regex only — never the inline/reference regexes, where a name
is not a URL).
Structs§
- Inbound
Link Cache - Cache for inbound link grep results.
Functions§
- find_
inbound_ links - Find all inbound links to a target page by grep-searching markdown files.