Working with EAFs programmatically
git
To avoid dealing with formatting changes, .eaf files are "normalized" before they are added to the index - they are re-formatted to a canonical XML form.
This implemented in
Python script “eaf-normalize.py” that normalizes EAF files. It reads XML as text from stdin, normalizes it, and outputs to stdout. In the VIHI_LENA repo, I saved it into the repo root so that it is available to any clone.
Define clean filter “eaf-normalize” in the repo-local config. The command below will work only if the Python script is saved in the repository root. If you put it somewhere else, modify what is inside double quotes to resolve to wherever you put the script.
Add “eaf-normalize” as the filter for EAF files in “.gitattributes”.
Last updated