Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

infra: update copy druid script #519

Merged
merged 4 commits into from
Mar 5, 2025

Conversation

317brian
Copy link
Contributor

@317brian 317brian commented Feb 3, 2025

Docusaurus 3 uses MDXv3, which is much stricter.

The longstanding way we've done variables is to find/replace {{DRUIDVERSION}} in the Markdown files. It worked in 2 b/c 2 was less strict. 3 is stricter and picks them up as Javascript variables that are undefined.

Instead of making people learn a new way to do variables, this updates the copy script so that an escaped version of \{\{DRUIDVERSION}} (and variations) also get find/replaced

We would have to do a find/replace anyway unless we set up the variables to match each other in druid-website-src and druid

To verify this, check out the Markdown cleanup branch in apache/druid#17740 and run the copy script in scripts.

Then grep for DRUIDVERSION in the markdown files and maybe whatever version you set, eg 32.0.0

grep -ir 'DRUIDVERSION' ./docs
grep -ir '32.0.0' ./docs

@317brian 317brian marked this pull request as ready for review February 19, 2025 21:47
Copy link
Member

@vtlim vtlim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🦖

Tested using these commands. Spot checked several pages with DRUIDVERSION variable and they resolved correctly.

# build
python do_all_things.py -v 32.0.0 --skip-install --source ../../druid-apache

# preview
npm run serve

There's a syntax warning but it raises on the docstring so doesn't affect anything

/Users/victorialim/Documents/work_repos/druid-website-src/scripts/copy_druid_docs.py:61: SyntaxWarning: invalid escape sequence '\{'

@317brian 317brian merged commit 80b5ecc into apache:master Mar 5, 2025
@317brian 317brian deleted the update-copy-script-druidvar branch March 5, 2025 19:20
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.

2 participants