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:

    asciidoctor -r dita-topic -b dita-topic -S secure 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 -iI -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 -i *.dita
    
  • Remove unresolved AsciiDoc include directives:

    dita-cleanup -I *.dita
    
  • Replace unresolved AsciiDoc attribute references with reusable content references:

    dita-cleanup -C 'topic.dita#topic-id' *.dita
    
  • Add a directory path to all image references:

    dita-cleanup -D ../images/ *.dita
    
  • Update invlid cross references based on DITA files present in the supplied directory:

    dita-cleanup -X . *.dita
    
  • Print the updated files to standard output instead of overwriting the supplied files:

    dita-cleanup -iI -D ../images/ -X . -o - *.dita
    

For a complete list of available command-line options, run dita-cleanup with the -h option:

dita-cleanup -h

Copyright

Copyright © 2025 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.1.tar.gz (10.5 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.1-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dita_cleanup-0.9.1.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dita_cleanup-0.9.1.tar.gz
Algorithm Hash digest
SHA256 3b72d43bf5295c02e42893d22a138aca923e275acb2d19a02c06c2eb68a70081
MD5 07c69db2a327d6ea61a587252e2cabd1
BLAKE2b-256 1e6a04eb88bdde2e876861df48e7e6141f13b05db3e623bcc2220ae136be0d98

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dita_cleanup-0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for dita_cleanup-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c5d299b81942ca5ab791eedf5aa9ba7d5fb13c534f9609c705c6cef463a5a380
MD5 cc757979ca528299591418d6cc699076
BLAKE2b-256 c8eb8980fdf4909db109eef6ab5825de1bafb47278f379c8044517ffacbd3082

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