Skip to main content

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:

  1. Identify incompatible markup in the AsciiDoc source file:

    vale source_file.adoc
    
  2. Convert the AsciiDoc file to a generic DITA topic:

    dita-topic source_file.adoc
    
  3. Convert the generic DITA topic to a specialized DITA concept, reference, or task:

    dita-convert -g source_file.dita -o output_file.dita
    
  4. 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
    
  • Update all image paths:

    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-cleanup with the --help option:

    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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dita_cleanup-0.9.9.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dita_cleanup-0.9.9-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file dita_cleanup-0.9.9.tar.gz.

File metadata

  • Download URL: dita_cleanup-0.9.9.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for dita_cleanup-0.9.9.tar.gz
Algorithm Hash digest
SHA256 55d8a67487bb44b84dbaad259f493f44cc4f7bed9a8bc97422405bb6444e8ece
MD5 058e1f3973723cf91bc155510f5e93c1
BLAKE2b-256 91cbfa746ca77dd6578870d401e609df973ad888097f3b2c835912072bd9d7cb

See more details on using hashes here.

File details

Details for the file dita_cleanup-0.9.9-py3-none-any.whl.

File metadata

  • Download URL: dita_cleanup-0.9.9-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for dita_cleanup-0.9.9-py3-none-any.whl
Algorithm Hash digest
SHA256 6cbc543a8f0bb4a7f23194841ee476d0a57cf53f2b6171b31878d88742dcc8d9
MD5 d99f74833b04d465a21cc6bf8703eb45
BLAKE2b-256 a78deb632cbc399c3dfaadacaeef1550ea3f0db22857f543efdb9da440a8fede

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page