feat: unified HTML-to-markdown migration tool for legacy API docs#654
Draft
shczhen wants to merge 1 commit into
Draft
feat: unified HTML-to-markdown migration tool for legacy API docs#654shczhen wants to merge 1 commit into
shczhen wants to merge 1 commit into
Conversation
Add a generic script that converts DITA-OT generated HTML API reference documentation into pure markdown files compatible with the docs portal. The tool handles multiple products and platforms without requiring per-product custom scripts. It supports: - Class/struct pages with properties - Enum type definitions - Method/API pages with parameters and return values - Callback definitions - Nested article structures and TOC pages - Internal link resolution to portal routes - Admonition/note rendering (info, warning, error) - Code blocks with language hints Includes Vitest tests and README documentation.
shczhen
force-pushed
the
worktree-html-to-md-migration
branch
from
July 6, 2026 09:13
8ee3ef5 to
29e3e25
Compare
Collaborator
Follow-up issue filed for the current scope gap in this migration script: #673. That issue tracks clarifying and extending the HTML migration tooling beyond DITA-OT OpenAPI/REST YAML sources are intentionally out of scope because those have already been handled through the OpenAPI migration path. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a generic migration script that converts DITA-OT (Oxygen XML) generated HTML API reference docs into pure markdown files for the docs portal.
Why
The legacy documentation site has HTML API references generated by DITA-OT across 20+ products and 16+ platforms. Previously, each product required a custom migration script. This unified tool eliminates that duplication.
How it works
The script:
index.htmlAPI/subdirectorymeta.jsonfor sidebar structureSupported content types
class_enum_api_callback_toc_/rtc_Output format
Pure markdown — no custom MDX components. Uses:
:::info[Note]/:::warning/:::errorfor admonitions<a id="...">for stable anchorsTesting
<ul>were not wrapped in admonition syntaxFiles
scripts/html-to-md-migration.mjsscripts/html-to-md-migration.test.tsscripts/html-to-md-migration.README.md