Advanced cleaner and packager for Dartdoc-generated HTML documentation.
Project description
dartdoc-advanced
This project provides tools for cleaning, repairing, and packaging HTML documentation generated by Dartdoc. It removes unnecessary stub files, fixes broken or invalid links, normalizes class sidebar paths, and produces a clean ZIP archive ready for distribution or publishing.
The project includes:
-
cleaning pipeline that processes Dartdoc output
-
command-line interface for automation
-
`a simple GUI for non-technical users
a modular internal architecture suitable for further development and integration with Dart or Pub.dev
Features
-
Removes small or empty HTML “stub” files based on configurable size thresholds
-
Fixes duplicated folder prefixes inside class sidebars
-
Disables dead, invalid, or trivial links (for example javascript: URLs)
-
Normalizes links inside root index pages, library index pages, sidebars, and regular HTML pages
-
Packages the cleaned documentation into a single ZIP file
-
Includes a Tkinter GUI for easy use by non-technical users
-
Provides a modular Python codebase organized by responsibility
Project Structure
src/dartdoc_advanced/
- cleaner/
- core.py: main cleaning engine, tree copy, stub removal, HTML rewriting
- stubs.py: detection logic for stub files
- links.py: helpers for analyzing and classifying href values
- sidebar_fix.py: normalization and cleanup for class sidebar HTML files
- pipeline/
- runner.py: orchestrates the full process (cleaning, fixing, zipping)
- cli/
- cli.py: command-line interface entrypoint
- gui/
- app.py: Tkinter desktop application
Pipeline Description
The pipeline performs the following steps:
-
Copies the original Dartdoc output directory into a temporary workspace.
-
Identifies and removes stub HTML files.
-
Processes remaining HTML files to fix or disable problematic links.
-
Applies specialized rules for root index pages, library index pages, and class sidebars.
-
Produces a final ZIP file containing the cleaned documentation.
CLI Usage
The command-line interface can be executed with:
python -m dartdoc_advanced.cli.cli INPUT_DIR OUTPUT_ZIP --min-chars 350 --tiny-chars 150
Arguments:
- INPUT_DIR: path to the Dartdoc “doc/api” directory
- OUTPUT_ZIP: destination of the final ZIP file (with or without .zip extension)
- --min-chars: minimum number of characters required for sidebar/library HTML files
- --tiny-chars: minimum number of characters for all other HTML files
GUI Usage
The GUI can be launched with:
python -m dartdoc_advanced.gui.app
The application allows users to:
- select the source Dartdoc directory
- choose where the ZIP file should be saved
- configure stub detection thresholds
- run the cleaning process in a background thread
Developer Notes
The codebase is divided into small, purpose-specific modules, which makes it easy to test and extend. The command-line entrypoint is stable and suitable for being called from other languages, such as Dart. The project is prepared for packaging as a Python package and can easily expose an executable script.
Link and Stub Logic Overview
Stub rules:
- “-library-sidebar.html” is always removed
- “-class-sidebar.html” and similar sidebar files are always kept
- other HTML files are removed if their textual content is below the configured thresholds
Sidebar normalization:
Paths with duplicated folders such as:
example/example/MyClass.html are rewritten to: example/MyClass.html
Link disabling:
- anchor links are kept
- external links are kept
- javascript: links are disabled
- links to missing or deleted HTML files are disabled
License
MIT
Contribution
Contributions and suggestions are welcome.
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 dartdoc_advanced-0.1.0.tar.gz.
File metadata
- Download URL: dartdoc_advanced-0.1.0.tar.gz
- Upload date:
- Size: 17.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bbfba0544fdb36c0bd3484b8dd051d794b2098f26bc5f5063e37898a0773d2d1
|
|
| MD5 |
40e5a0ce4c27acc2b0143ef94e0fa53c
|
|
| BLAKE2b-256 |
9ece7d5d4f2a954d09e9e26d020fea84002a3e572bdfbf741e33b1dee867b690
|
File details
Details for the file dartdoc_advanced-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dartdoc_advanced-0.1.0-py3-none-any.whl
- Upload date:
- Size: 19.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a55832c1b32e58cc03a168db9ccc5de062c0ed04ffb1fcd942d214d6c7cc12b
|
|
| MD5 |
c840a695e016f46417e87d905bff5406
|
|
| BLAKE2b-256 |
a71a7c5d02e3aeff53d4ead8466dcbddd2a84ecad89fc879a581284afd8bd6c0
|