Expand description
Quarto div and callout block detection utilities
This module provides detection for Quarto/Pandoc fenced div syntax which uses
::: markers to create structured content blocks.
Common patterns:
::: {.callout-note}- Callout block with type::: {.callout-warning}- Warning callout::: {#myid .class}- Generic div with id and class::: myclass- Simple div with class (shorthand):::- Closing marker
Callout types: callout-note, callout-warning, callout-tip,
callout-important, callout-caution
Structs§
- DivTracker
- Track div nesting state for a document
Functions§
- detect_
div_ block_ ranges - Detect Quarto div block ranges in content Returns a vector of byte ranges (start, end) for each div block
- extract_
citation_ key - Extract citation key from a citation string (removes @ prefix)
- extract_
classes - Extract class names from a Pandoc attribute block Returns classes like “callout-note”, “bordered”, etc.
- extract_
id - Extract the ID from a Pandoc attribute block
- find_
citation_ ranges - Find all citation ranges in content (byte ranges) Returns ranges for both bracketed [@key] and inline @key citations
- get_
div_ indent - Get the indentation level of a div marker
- has_
citations - Quick check if text might contain citations
- has_
pandoc_ attributes - Check if a line contains Pandoc-style attributes
- is_
callout_ open - Check if a line is a callout block opening
- is_
div_ close - Check if a line is a div closing marker (just
:::) - is_
div_ open - Check if a line is a div opening marker
- is_
in_ citation - Check if a byte position is within a citation
- is_
within_ div_ block_ ranges - Check if a byte position is within a div block