|
1 week ago | |
---|---|---|
.. | ||
modules | 1 week ago | |
README.md | 1 week ago | |
docs_consistency_checker.py | 1 week ago | |
fetch_youtube_video_metadata.py | 11 months ago |
A Python script designed to check consistency between documentation files in different languages for the Defold project. This tool compares file structures and Markdown syntax trees to ensure translations maintain the same structure and formatting.
Install the required package:
pip install openpyxl
To run a full comparison between source and target documentation directories:
python docs_consistency_checker.py --source-dir ./docs/en --target-dir ./docs/zh
python docs_consistency_checker.py --source-dir /path/to/source/docs --target-dir /path/to/target/docs
python docs_consistency_checker.py --source-dir ./docs/en --target-dir ./docs/zh --file manuals/game-project/game-project.md
python docs_consistency_checker.py --source-file /path/to/source/file.md --target-file /path/to/target/file.md
python docs_consistency_checker.py --source-dir ./docs/en --target-dir ./docs/zh --output custom_comparison.xlsx
Argument | Description |
---|---|
--file |
Specify a particular file to check (relative to docs directory) |
--source-dir |
Path to source documentation directory |
--target-dir |
Path to target documentation directory |
--output |
Path for the output Excel file |
--source-file |
Path to a specific source file |
--target-file |
Path to a specific target file |
--help |
Show help message and exit |
The script generates an Excel file with the following columns:
The script includes comprehensive error handling for:
The script is organized into several modules:
docs_consistency_checker.py
: Main entry point and command-line interfacemodules/main.py
: Core comparison logicmodules/file_handler.py
: File operations and utilitiesmodules/markdown_handler.py
: Markdown parsing and comparisonmodules/excel_handler.py
: Excel report generationpython docs_consistency_checker.py --source-dir ../docs/en --target-dir ../docs/zh
python docs_consistency_checker.py --source-dir ../docs/en --target-dir ../docs/zh --file manuals/introduction.md
python docs_consistency_checker.py --source-file ../docs/en/manuals/introduction.md --target-file ../docs/zh/manuals/introduction.md
python docs_consistency_checker.py --help