Manage document StyleSets: list bundled StyleSets, import .dotx files, or
apply StyleSets to documents.
1. Subcommands
| Subcommand | Description |
|---|---|
|
List all bundled StyleSets |
|
Import |
|
Apply a StyleSet to a document |
|
Extract styles from a DOCX into a YAML StyleSet |
2. list
Display all StyleSets bundled with Uniword.
uniword styleset list
uniword styleset list --verbose
--verbose shows the style name, and counts of paragraph, character,
and table styles for each entry.
3. import
Import Office .dotx StyleSet files to YAML format for faster loading
and human readability.
uniword styleset import
uniword styleset import --source stylesets/ --output data/stylesets
--source sets the input directory (default: references/word-package/style-sets).
--output sets the output directory (default: data/stylesets).
4. apply
Apply a bundled or file-based StyleSet to a document.
# Apply a bundled StyleSet by name
uniword styleset apply input.docx output.docx --name distinctive
# Apply with verbose output
uniword styleset apply input.docx output.docx --name distinctive --verbose
# Apply a .dotx file
uniword styleset apply input.docx output.docx --file Distinctive.dotx
Options:
--name-
Bundled StyleSet name (e.g.,
distinctive,elegant,formal) --file-
Path to a
.dotxStyleSet file --strategy-
Conflict resolution strategy (default:
keep_existing) --verbose,-v-
Show detailed output
You must specify --name or --file, but not both.
4.1. Conflict resolution strategies
When a StyleSet defines a style that already exists in the document, the
--strategy option controls the behavior:
keep_existing(default)-
Keep the document’s existing style, add only new ones.
replace-
Replace existing styles with StyleSet definitions.
rename-
Keep both, renaming imported styles to avoid conflicts.
uniword styleset apply in.docx out.docx --name formal --strategy replace
5. extract
Extract the styles from a DOCX document into a YAML StyleSet that can be
re-applied to other documents with styleset apply. Useful for capturing
a corporate style baseline from an existing template document.
uniword styleset extract corporate_report.docx
uniword styleset extract corporate_report.docx --output stylesets/corporate.yml
Options:
--output,-o-
Output YAML file (default:
<docname>.styleset.ymlin the current directory)