Redlines (redlines v0.6.0)
View SourceExtract and normalize tracked changes ("redlines") from documents.
This library provides a single normalized shape (Redlines.Change) across:
- DOCX track changes (
<w:ins>,<w:del>) - PDFs with embedded tracked-changes markup (via
pdf_redlines)
Summary
Functions
Extract tracked changes from a file path, inferring type from the extension.
Format tracked changes for LLM prompts.
Types
Functions
@spec extract( Path.t(), keyword() ) :: {:ok, Redlines.Result.t()} | {:error, term()}
Extract tracked changes from a file path, inferring type from the extension.
Options
:type- Override the inferred type (:pdfor:docx):pdf_opts- Options forwarded toPDFRedlines(only when extracting PDFs)
@spec format_for_llm( Redlines.Result.t() | [Redlines.Change.t()] | map() | list(), keyword() ) :: String.t()
Format tracked changes for LLM prompts.
Accepts:
Redlines.Result- a list of
Redlines.Change - a DOCX
track_changesmap (%{insertions: [...], deletions: [...]}) - a list of PDF redline structs/maps (anything with
:type,:deletion,:insertion,:location)