Expand description
Markdown document parsing and rendering.
This module handles:
- Parsing markdown with comrak
- Extracting document structure (headings, links, images)
- Rendering to styled lines for display
Structs§
- Document
- A parsed and rendered markdown document.
- Heading
Ref - Reference to a heading in the document.
- Image
Ref - Reference to an image in the document.
- Inline
Color - RGB color for inline styling.
- Inline
Span - A styled inline span.
- Inline
Style - Inline style flags for a text span.
- LinkRef
- Reference to a link in the document.
- Rendered
Line - A single rendered line with styling information.
Enums§
- Line
Type - Type of a rendered line, used for styling.
Functions§
- format_
hex_ dump - Format raw bytes as a hex dump in the classic
hexdump -Cstyle. - format_
single_ hex_ line - Format a single 16-byte chunk as one hex dump line.
- image_
markdown - Generate markdown content that displays an image file inline.
- is_
binary - Returns true if the byte slice appears to be binary (non-text) content.
- is_
editable_ file - Returns true if the file is a known text-editable format.
- is_
image_ file - Returns true if the file extension is a recognized image format.
- parse
- Parse markdown source into a
Document. - parse_
with_ image_ heights - Parse markdown with known image heights (in terminal rows).
- parse_
with_ layout - Parse markdown with layout width and image heights.
- prepare_
content - Prepare file content for rendering based on its extension.
- prepare_
content_ from_ bytes - Prepare file content from raw bytes, detecting binary vs text.
- prepare_
document_ from_ bytes - Prepare a
Documentdirectly from raw file bytes.