Skip to content

IDPF & Readium CFI Engine

EPUB Canonical Fragment Identifiers (CFI) provide a standardized mechanism for referencing locations inside eBook content.

use ebook_rs::cfi::Cfi;
let cfi = Cfi::parse("epubcfi(/6/4[chap01]!/4/2/10:15)")?;
let dom_selector = cfi.resolve_dom_path(html_content)?;
  • Parsing, validation, formatting, and mathematical range ordering.
  • DOM path resolver converting CFI coordinates into browser DOM element offsets.
  • Full compliance with the Readium Unified Locator Model.\n