Clean up DITA topics after conversion from AsciiDoc.
Project description
dita-cleanup
dita-cleanup is a command-line utility that allows you to clean up DITA topics after conversion from AsciiDoc.
In combination with asciidoctor-dita-vale, asciidoctor-dita-topic, and dita-convert, this project can be used to rapidly convert AsciiDoc content to DITA:
-
Identify incompatible markup in the AsciiDoc source file:
vale source_file.adoc -
Convert the AsciiDoc file to a generic DITA topic:
dita-topic source_file.adoc -
Convert the generic DITA topic to a specialized DITA concept, reference, or task:
dita-convert -g source_file.dita -o output_file.dita -
Clean up the resulting DITA file:
dita-cleanup -i -D ../images -X . output_file.dita
Installation
Install the dita-cleanup Python package:
python3 -m pip install --upgrade dita-cleanup
Usage
-
Remove unresolved AsciiDoc attribute references from element IDs:
dita-cleanup --prune-ids *.dita -
Replace unresolved AsciiDoc attribute references with reusable content references:
dita-cleanup --conref-target 'topic.dita#topic-id' *.dita -
List any unresoved AsciiDoc attribute references:
dita-cleanup --verbose *.dita -
Add a directory path to all image references:
dita-cleanup --images-dir ../images/ *.dita -
Update invlid cross references based on DITA files present in the supplied directory:
dita-cleanup --xref-dir . *.dita -
Print the updates to standard output instead of overwriting the supplied files:
dita-cleanup --prune-ids --output - *.dita -
For a complete list of available command-line options and their short versions, run
dita-cleanupwith the--helpoption:dita-cleanup --help
Copyright
Copyright © 2025, 2026 Jaromir Hradilek
This program is free software, released under the terms of the MIT license. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dita_cleanup-0.9.6.tar.gz.
File metadata
- Download URL: dita_cleanup-0.9.6.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e09e6aceab7ce5f183e793068d598418dd3a60a8cc9779b4a01814b725f43890
|
|
| MD5 |
5c12a29fc6b389ae13e752cd06d14020
|
|
| BLAKE2b-256 |
d0e9b12375d5566502d222f51d64df390c2a37f30cd1015b7e2c9f33aa45b190
|
File details
Details for the file dita_cleanup-0.9.6-py3-none-any.whl.
File metadata
- Download URL: dita_cleanup-0.9.6-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e686f8d953f4d1aa7d9edda196b8ac2615f332b8662e53d025641a5cad05d76c
|
|
| MD5 |
eedb577ba924c7001e6acb877de2e5d1
|
|
| BLAKE2b-256 |
85f8e88926262349abc13875cf07b65283016b49f761c2991eea2f4e9e91e1f3
|