Skip to main content

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.

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.11.tar.gz (12.4 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.11-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for dita_cleanup-0.9.11.tar.gz
Algorithm Hash digest
SHA256 a0f2e9f6071c2ceda7a91b0087a32901e792d2197bd1fe8724c1230298d222a6
MD5 46a382e7d2aa67dc9ffb1d3b9b3f8316
BLAKE2b-256 bb04ffb7538f00e479544beb5437af42cc4c737b1c59f8e822d79bd6232cb9aa

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for dita_cleanup-0.9.11-py3-none-any.whl
Algorithm Hash digest
SHA256 b75f21e166a05a45dcf14708a9e893b2290b2f534feccbb1eefe7609cbbf66ce
MD5 9f490be1456c9e4d3cbbfac48c3cc287
BLAKE2b-256 61bda59097a2a5797a1e889e0cf38df71a01ec4f404c923d31a7feb36671e043

See more details on using hashes here.

Release history Release notifications | RSS feed

0.9.12

2 files

This release

0.9.11 This release

2 files

0.9.10

2 files

0.9.9

2 files

0.9.8

2 files

0.9.7

2 files

0.9.6

2 files

0.9.5

2 files

0.9.4

2 files

0.9.3

2 files

0.9.2

2 files

0.9.1

2 files

0.9.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page