oxipdf-ir 0.1.0

Intermediate representation types for the oxipdf PDF engine
Documentation
//! Semantic roles for IR nodes.
//!
//! Semantic roles provide optional structural meaning beyond the content
//! variant. They inform accessibility metadata and can influence
//! fragmentation heuristics (e.g., keeping a heading with its first paragraph).

/// An optional semantic role attached to an IR node.
///
/// These roles are hints — they do not change layout behavior but may
/// influence fragmentation decisions and PDF structure metadata.
///
/// `Ord` is implemented to support use as `BTreeMap` keys in the theme
/// system, which maps roles to resolved styles.
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[non_exhaustive]
pub enum SemanticRole {
    /// Document root.
    Document,
    /// A major section or chapter.
    Section,
    /// A heading (level 1–6).
    Heading { level: u8 },
    /// A paragraph of text.
    Paragraph,
    /// An ordered or unordered list container.
    List,
    /// An individual list item.
    ListItem,
    /// A table container.
    Table,
    /// A table header group.
    TableHeader,
    /// A table body group.
    TableBody,
    /// A table row.
    TableRow,
    /// A table cell.
    TableCell,
    /// A figure (image, diagram, chart).
    Figure,
    /// A figure caption.
    Caption,
    /// A block quotation.
    BlockQuote,
    /// A code block.
    CodeBlock,
    /// A navigation element (e.g., table of contents).
    Navigation,
    /// A footnote.
    Footnote,
    /// A page header/footer region.
    PageDecoration,
}