Skip to content

Conversation

@adit-chandra
Copy link

@adit-chandra adit-chandra commented Nov 5, 2025

  • fixes Fix broken files in copy-upstream-docs.sh #103
  • add higher-coverage, extensible node-based tooling for transforming upstream md docs into mintlify-flavored mdx.
    • prefer node-based tooling mainly to leverage remark + rehype native, well-maintained AST and mdx processing libraries
    • replaces previous transform-docs.awk with transform.mjs.
      • transform-docs.awk lacks AST functionality. lack of AST-support in pure awk made edge case handling and residual-html parsing exception unwieldy and intractable.
    • imo transform.mjs is more easily extensible and maintainable tooling moving forward.
  • new tooling burns down BROKEN_FILES list in copy-upstream-docs.sh down to 0
  • test plan:
    • locally verified
      • git submodule update --init --depth 1 -- upstream
      • cd tools/mdx-transform && npm ci
      • npm test
      • cd ../../ && copy-upstream-docs.sh /tmp/mdx-check
      • mint dev --no-open
    • added some unit tests to cover transform.mjs expected behavior

@adit-chandra adit-chandra force-pushed the adit/mdx-transform-tooling branch from 5cb8ae4 to 492a978 Compare November 5, 2025 18:21
@adit-chandra adit-chandra marked this pull request as ready for review November 5, 2025 18:42
@promptless
Copy link
Contributor

promptless bot commented Nov 5, 2025

📝 Documentation updates detected!

New suggestion: Document new MDX transformation tooling in README

@alan707
Copy link
Collaborator

alan707 commented Nov 10, 2025

@adit-chandra I think you will need to rebase on top of main to get this to work.

@adit-chandra adit-chandra force-pushed the adit/mdx-transform-tooling branch from 86f5474 to b344f2c Compare November 12, 2025 02:45
@adit-chandra
Copy link
Author

@adit-chandra I think you will need to rebase on top of main to get this to work.

rebased!

@alan707
Copy link
Collaborator

alan707 commented Nov 12, 2025

@adit-chandra the reason this is failing is because the secrets inherited by your PR are not accepted by the bazel-contrib/bazel-docs repo. @alexeagle is adding a new cron workflow that will run these triggers every few mins.

@alan707
Copy link
Collaborator

alan707 commented Nov 12, 2025

once #125 lands, you should be able to merge main into your branch and it should just work 🤞

adit-chandra and others added 10 commits November 12, 2025 16:14
Co-authored-by: promptless[bot] <promptless[bot]@users.noreply.github.com>
Co-authored-by: promptless[bot] <promptless[bot]@users.noreply.github.com>
Co-authored-by: promptless[bot] <promptless[bot]@users.noreply.github.com>
Co-authored-by: promptless[bot] <promptless[bot]@users.noreply.github.com>
Co-authored-by: promptless[bot] <promptless[bot]@users.noreply.github.com>
Co-authored-by: promptless[bot] <promptless[bot]@users.noreply.github.com>
This commit introduces a comprehensive Node.js-based MDX transformation tool
that successfully processes all previously broken documentation files from the
upstream Bazel repository.

## What Changed

- Created `tools/mdx-transform/` with a new Node.js transformer
  - Replaces the legacy `transform-docs.awk` script
  - Uses unified/remark/rehype ecosystem for robust parsing
  - Handles complex HTML, liquid templates, and MDX edge cases

- Updated `copy-upstream-docs.sh` to use the new transformer
  - Cleared BROKEN_FILES list (30 → 0 files)
  - All files now transform successfully

- Updated CI workflow to install Node.js dependencies

## Key Features

The new transformer handles:
- Liquid template syntax removal ({% %}, {{ }})
- Curly brace escaping for MDX
- Compare callouts → Mintlify Callout components
- Navigation tables → clean link navigation
- Material icons → arrow symbols
- HTML entity preservation in tables
- Email and URL autolink conversion
- Frontmatter extraction from H1 titles

## Test Results

✅ All unit tests passing (3/3)
✅ 156 files transformed successfully
✅ 19/19 previously broken files now working
✅ Zero Mintlify validation errors on transformed files

Co-authored-by: promptless[bot] <179508745+promptless[bot]@users.noreply.github.com>
@adit-chandra adit-chandra force-pushed the adit/mdx-transform-tooling branch from 49974ed to 86ef3a8 Compare November 13, 2025 00:14
@alan707
Copy link
Collaborator

alan707 commented Nov 13, 2025

help is on the way, I will create a Github App to fix this issue

@alan707
Copy link
Collaborator

alan707 commented Nov 13, 2025

@adit-chandra if you rebase now it should work - I've added a Github App with #135 and fixed with #137

@alan707
Copy link
Collaborator

alan707 commented Nov 13, 2025

confirmed the dependabot upgrade works with #136

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix broken files in copy-upstream-docs.sh

2 participants