Skip to main content

Module parser

Module parser 

Source
Expand description

Markdown text processing utilities.

Ported from files.md (server/txt/mod.rs) by Artem Zakirullin. Provides string similarity, link extraction, and text normalization.

Constants§

MIN_SEARCH_SIMILARITY
Minimum similarity score (0-100) for fuzzy name search.

Functions§

emoji_prefix
Add emoji prefix to string, stripping known prefixes first.
extract_headings
Extract all headings (## Title) from content.
extract_markdown_links
Extract all markdown links [text](path) from content.
extract_wikilinks
Extract all wikilinks [[target]] / [[target|alias]] from content.
first_word
Get the first word from a string.
has_image
Check if text contains a markdown image.
is_multiline
Check if text has multiple lines.
lcfirst
First character lowercase (Unicode-aware).
levenshtein
Compute Levenshtein edit distance between two strings.
norm_new_lines
Normalize CRLF and CR to LF.
resolve_wikilink
Resolve a wikilink target to a canonical note path.
rewrite_link_targets
Rewrite markdown-link targets matching old_target to new_target.
rewrite_wikilink_targets
Rewrite [[target]] / [[target|alias]] wikilinks whose target points at old_path so they point at new_path, preserving the user’s original form (bare stem stays bare, path-without-ext stays that way, aliases are kept verbatim).
similar
Calculate similarity between two strings (0.0 – 100.0) using Levenshtein distance.
split_text_into_chunks
Split text into chunks of at most max_len characters.
strip_chat_timestamp
Strip a leading `HH:MM` timestamp from chat entries.
substr
Unicode-safe substring.
today_chat_header
오늘 날짜의 Chat.md 헤더 문자열 (예: “#### 20 May, Tuesday”).
today_journal_path
오늘 날짜의 저널 파일 경로 (예: “journal/2026.05 May.md”).
truncate
Truncate a string to max_len, appending “…” if truncated.
ucfirst
First character uppercase (Unicode-aware).

Type Aliases§

StemIndex
Map of lowercase filename stem → candidate full paths. Built by the knowledge base from the filesystem; consumed by resolve_wikilink.