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.
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.
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).