Markdown parsing for RLM - extracts hierarchical structure from markdown files.
Primary functions:
markdown->pages - Main API: convert markdown string to page-based formatmarkdown-file->pages - Convenience: reads file and calls markdown->pagesDesign:
Markdown parsing for RLM - extracts hierarchical structure from markdown files. Primary functions: - `markdown->pages` - Main API: convert markdown string to page-based format - `markdown-file->pages` - Convenience: reads file and calls markdown->pages Design: - Top-level headings (h1, or first heading level found) become 'pages' - Nested headings become nodes within each page - Code blocks are skipped when parsing headings - Each section includes text from heading to next heading - No LLM required - deterministic parsing
(extract-sections content headings)Extracts text content for each heading section.
Each section's text spans from its heading line to the line before the next heading.
Params:
content - String. Markdown content.
headings - Vector of heading maps from parse-headings.
Returns: Vector of heading maps with :text added (content of that section).
Extracts text content for each heading section. Each section's text spans from its heading line to the line before the next heading. Params: `content` - String. Markdown content. `headings` - Vector of heading maps from parse-headings. Returns: Vector of heading maps with :text added (content of that section).
(markdown->pages content)Converts markdown content to page-based format for RLM indexing.
Design:
Params:
content - String. Markdown content.
Returns: Vector of page maps: :page/index - Integer (0-indexed) :page/nodes - Vector of node maps (:page.node/type, :page.node/id, etc.)
Converts markdown content to page-based format for RLM indexing. Design: - Top-level headings (lowest level found, usually h1) become page boundaries - Each page contains all nested sections until the next top-level heading - Sections become :section nodes with :heading and :paragraph children Params: `content` - String. Markdown content. Returns: Vector of page maps: :page/index - Integer (0-indexed) :page/nodes - Vector of node maps (:page.node/type, :page.node/id, etc.)
(markdown-file->pages file-path)Converts a markdown file to page-based format.
Params:
file-path - String. Path to markdown file.
Returns: Vector of page maps (see markdown->pages).
Converts a markdown file to page-based format. Params: `file-path` - String. Path to markdown file. Returns: Vector of page maps (see markdown->pages).
(parse-headings content)Extracts all headings from markdown content.
Skips headings inside code blocks (...).
Params:
content - String. Markdown content.
Returns: Vector of heading maps with :title, :level, :line-num (1-based).
Extracts all headings from markdown content. Skips headings inside code blocks (``` ... ```). Params: `content` - String. Markdown content. Returns: Vector of heading maps with :title, :level, :line-num (1-based).
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |