feat: add support for .wps and .et
Summary
Adds .wps (WPS Writer / Microsoft Works text) and .et (WPS Spreadsheet)
to the recognized extensions, routing them to the existing Doc and Excel
parsers respectively.
Modern WPS Office exports these as OLE2 compound files carrying the same
content streams their Microsoft counterparts mandate — WordDocument for
.wps, Workbook/Book for .et. anydoc's content-based detection
(from_bytes) already recognizes them by stream name; this change only
extends extension-based detection (from_extension / from_path) so files
named .wps or .et convert correctly without a rename.
Changes
src/lib.rs— register"wps" => Format::Docand"et" => Format::Excel
inFormat::from_extension; update theFormat::DocandFormat::Excel
doc comments to note the shared-stream WPS wrappers.README.md— list.wpsunder Word and.etunder Excel in the
supported-formats table.
No new parser, no new Format variant: both extensions reuse the existing
binary Word (formats/doc) and spreadsheet (formats/sheet via calamine)
frontends.
Why no binding changes
The Node / wasm / Python Format enums are public API surface. Since .wps
and .et reuse the existing Doc/Excel parsers, format_from_extension("wps")
correctly returns the existing Doc / Xlsx variant already exposed. Adding
new enum values would break JS/Python callers that branch on these strings,
so they are intentionally left unchanged.
Scope
Covers modern WPS Office / Microsoft Works .wps and modern WPS .et — the
OLE2-based variants with standard content streams. Legacy WPS 2000-era private
binary containers (no standard streams) are out of scope and degrade safely:
detection returns None/Unsupported rather than panicking.
Verification
cargo fmt --check✅cargo clippy -p anydoc --all-targets -- -D warnings✅cargo test -p anydoc— 208 unit + 8 snapshot + 1 robustness, all green ✅- Confirmed
Format::from_extensionreturnsDocforwps/WPSand
Excelforet/ET(case-insensitive); existing mappings unchanged.
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.