Structs§
- Case
Conversion - A reusable case-conversion descriptor.
- Line
- A numbered logical line.
- Line
Number - A 1-based line number.
- Line
Stats - Aggregate line counts derived from text.
- Markdown
Code Fence - A fenced code block extracted from Markdown.
- Markdown
Heading - A Markdown ATX heading.
- Markdown
Image - A Markdown inline image.
- Markdown
Link - A Markdown inline link.
- Markdown
Outline - A simple heading outline for a Markdown document.
- Slug
- A validated default-separator slug.
- Slug
Options - Configures conservative slug shaping.
- Token
- A token with its kind and byte span.
- Token
Span - A byte span in the original input string.
- Tokenizer
Options - Small configuration for future tokenizer extensions.
- Word
- A normalized word token.
- Word
Stats - Aggregate counts derived from text.
Enums§
- Case
Error - Errors returned by
CaseConversion. - Line
Ending - Supported line-ending shapes.
- Slug
Separator - Supported separators for generated slugs.
- Text
Case - Describes a detected or requested text case.
- Token
Kind - The category assigned to a token.
Functions§
- contains_
word - Returns
truewhen the input contains the target as a full normalized word. - dedent_
lines - Removes the common indentation shared by non-empty lines.
- detect_
case - Detects the most practical case shape for the input.
- ends_
with_ word - Returns
truewhen the last normalized word matches the target. - extract_
code_ fences - Extracts fenced code blocks delimited by triple backticks or triple tildes.
- extract_
frontmatter - Extracts top-of-document frontmatter contents without the boundary lines.
- extract_
headings - Extracts ATX headings while ignoring content inside fenced code blocks.
- extract_
images - Extracts inline images while ignoring fenced code blocks.
- extract_
links - Extracts inline links while ignoring fenced code blocks.
- extract_
outline - Extracts a lightweight document outline from headings.
- has_
frontmatter - Returns
truewhen the document starts with YAML-like or TOML-like frontmatter. - heading_
to_ anchor - Converts heading text into a practical GitHub-style anchor.
- indent_
lines - Prefixes each logical line with the provided indent string.
- is_
blockquote - Returns
truewhen a line starts with a Markdown blockquote marker. - is_
horizontal_ rule - Returns
truewhen a line looks like a Markdown horizontal rule. - is_
ordered_ list_ item - Returns
truewhen a line starts with an ordered list marker. - is_slug
- Returns
truewhen the input is already a normalized default slug. - is_
unordered_ list_ item - Returns
truewhen a line starts with an unordered list marker. - line_
count - Counts logical lines, ignoring a trailing empty line created only by a final line ending.
- lines_
with_ numbers - Returns numbered logical lines.
- markdown_
to_ plain_ text - Converts Markdown into lightweight plain text.
- non_
empty_ line_ count - Counts logical lines whose trimmed content is not empty.
- normalize_
line_ endings - Normalizes line endings to the requested target.
- normalize_
slug - Normalizes a candidate slug using the default separator.
- normalize_
word - Normalizes a word-like value by lowercasing letters and dropping non-word punctuation.
- slug_
words - Returns the normalized slug segments.
- slugify
- Converts free-form text into a default slug.
- starts_
with_ word - Returns
truewhen the first normalized word matches the target. - strip_
frontmatter - Returns the document without a leading frontmatter block.
- to_
camel_ case - Converts input into
camelCase. - to_
constant_ case - Converts input into
CONSTANT_CASE. - to_
kebab_ case - Converts input into
kebab-case. - to_
pascal_ case - Converts input into
PascalCase. - to_
snake_ case - Converts input into
snake_case. - to_
title_ case - Converts input into title case separated by spaces.
- token_
count - Counts conservative word tokens.
- tokenize_
chars - Splits input into Unicode scalar values.
- tokenize_
sentences - Extracts conservative sentence tokens.
- tokenize_
whitespace - Splits input on contiguous whitespace.
- tokenize_
words - Extracts conservative word tokens.
- trim_
lines - Trims each logical line independently and preserves the input line-ending style when possible.
- truncate_
slug - Truncates a slug without leaving trailing separators when possible.
- unique_
words - Returns distinct normalized words in first-seen order.
- word_
count - Counts normalized words in the input.
- words
- Extracts normalized words from the input.