Skip to main content

Module quarto_divs

Module quarto_divs 

Source
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