scitex_msword.highlights

Visual-mark / highlight utilities for python-docx Documents.

This module is used by the BOOST v16 dogfooding workflow to visualize:

  • additions by the operator (turquoise highlight, by convention)

  • modifications to operator-supplied content (magenta highlight)

plus a generic extract_highlights() to inspect what colors are present in a document and which runs carry them.

Color names mirror Word’s WD_COLOR_INDEX enum (case-insensitive): turquoise, pink, yellow, green, blue, red, gray_25, gray_50, black, white, dark_red, dark_yellow, dark_blue, teal, violet, and auto.

For convenience the following BOOST-v16 aliases are also accepted:

  • magenta -> pink (Word’s bright-pink highlight)

  • purple -> violet

  • cyan -> turquoise

Functions

clear_highlights(document[, colors])

Remove highlights from all runs (optionally only for the listed colors).

extract_highlights(document[, by_color])

Extract highlighted runs from a document, grouped by color.

mark_additions(document, runs[, color])

Highlight the runs that the operator (or agent) added to the document.

mark_modifications(document, runs[, color])

Highlight the runs that the operator (or agent) modified in the document.