mirror of
https://github.com/langgenius/dify-docs.git
synced 2026-03-26 13:18:34 +07:00
tools
This directory contains Python scripts designed to automate various maintenance and generation tasks for the Dify documentation, such as content synchronization and navigation file updates.
How to use
Auto apply when PR
Tools will work and apply changes by git push when the PR is made from a branch under the same repo by GitHub Actions.
When the PR is from a forked repo, it will not work since GitHub Actions will not have permission to push back to the forked repo.
Manually apply
Run the tools/main_docs_bundle.py script.
Prerequisites: Ensure you have the necessary Python environment and dependencies installed (e.g., python3.x, pip install -r requirements.txt if applicable).
Features
General
- Remove all "Edit this page" and "Report an issue" cards.
- Then reapply them to all mdx docs under folder
plugin-dev-**, en, ja-jp, zh-hans.- Also apply standard markdown ending syntax - leave a blank line before the last line.
Plugin Dev docs
- Rename plugin-dev-** docs based on its frontmatter.
- Automatically sync references at other docs when renaming happens. (Optional - you can modify it by edit
UPDATE_REFERENCES = Trueat the top oftools/rename_by_dimensions.pyif needed.)
- Automatically sync references at other docs when renaming happens. (Optional - you can modify it by edit
- Apply plugin-dev-** docs to docs.json (Auto Mintlify deployment).
- Remove non-existing docs.
- Leave docs that already exist.
- Optionally rebuild all plugin-dev-** docs - would be useful when changing order or nested structure. Modify
refresh = Falseat the top oftools/apply_docs_json.pyif needed.
- Optionally rebuild all plugin-dev-** docs - would be useful when changing order or nested structure. Modify
Additional notes
Plugin Dev docs manually modified:
- Contributing guidance is manually positioned at the end of its relevant navigation group (e.g., in
docs.jsonor sidebar configuration). - The order of a few documents requires manual adjustment as the automated process defaults to alphabetical sorting.