mirror of
https://github.com/storytold/indd-utils.git
synced 2026-11-25 11:51:16 +01:00
Collect the root style attributes, Properties and child elements that are the same in every corpus IDML (tools/root_values.py) and write them on the root paragraph, character, object, cell and table styles. Values read from the INDD take precedence; values that first appear after DOM 7 are gated by InDesign version. Also write the default numbering list, and write a style only once when two style objects share a name.
2.7 KiB
2.7 KiB
indd-utils
Rust reader for INDD files (Adobe InDesign's native format) and converter
to IDML. Crate and command: indd. Repo: aiongg/indd-utils (private for
now). Licence: MIT.
Clean-room rules (read CLEANROOM.md)
- Never commit anything from
corpus/. It holds third-party sample files without redistribution rights. Only files listed intests/fixtures/README.mdmay be committed. - Every fact about the INDD format goes in
docs/format/with the evidence that supports it (which files, how many, what was compared). Code relies only on documented facts. - Do not use knowledge of InDesign internals from memory (InDesign SDK
class names, IDs, persistence details). If it can't be shown from the
corpus or a permitted reference in
CLEANROOM.md, it doesn't go in. - Do not install or run InDesign, and do not ask anyone to create INDD files for this project.
- No golden output files derived from third-party samples. Corpus tests compare against the sibling IDML at run time.
- Do not name the third-party corpus sources in committed files. The
provenance record is
corpus/SOURCES.md(local).
Layout
src/header.rs,src/container.rs: decoded layers (seedocs/format/).tests/fixtures.rs: smoke tests on committed open-licensed samples.tests/corpus.rs: tests over the localcorpus/; they skip if absent.tools/inventory.py: corpus inventory (python3 -I tools/inventory.py corpus/).tools/root_values.py [--write]: root style values that every corpus IDML has; regeneratessrc/idml/root_values.xml(seedocs/format/idml-values.md).- Analysis scratch scripts go in the session scratchpad, not the repo.
Anything worth keeping becomes an
inddsubcommand.
Corpus
corpus/ (git-ignored, ~3.4 GB): 358 INDD files (357 third-party, 1
privately held), 240 with a sibling IDML.
corpus/inventory.tsv lists version and pairing per file. Priority:
InDesign 18–21, little-endian. Pairs whose IDML DOMVersion is older than
the INDD version were probably re-saved after export; trust them less.
Commands
cargo test(all tests),cargo clippy --all-targets,cargo fmt.cargo run -q -- info <file>,indd convert in.indd out.idml,indd objects <file>,indd dump <file> <uid>....python3 -I tools/compare.py [--detail TAG --show N]: convert every corpus pair and compare with the reference IDML. This is the main measure of progress; run it after every change.- Schema validation:
tools/validate.sh out.idml <schemas> <jing>, orcompare.py --schemas <dir> --jing <dir>. The IDML RelaxNG schemas (generated by InDesign, published in the metanorma/idml repo) and Jing (Maven Central) are kept outside the repo, for example in the session scratchpad; do not commit them.