Skip to content

Migrate code-excerpts tooling to npm package version#9638

Merged
chalin merged 2 commits intoopen-telemetry:mainfrom
chalin:chalin-m24-code-excerpter-ts-2026-0412
Apr 13, 2026
Merged

Migrate code-excerpts tooling to npm package version#9638
chalin merged 2 commits intoopen-telemetry:mainfrom
chalin:chalin-m24-code-excerpter-ts-2026-0412

Conversation

@chalin
Copy link
Copy Markdown
Contributor

@chalin chalin commented Apr 13, 2026

  • Fixes Add tooling in support of auto-update of code excerpts in docs #1635
  • Replaces the Dart-based code excerpt tooling with new Node code-excerpter tool, rewritten in TypeScript, as a drop-in replacement
  • Illustrates drop-in replacement by hooking up the tool into the Test PR job (details below)
  • Adjusts content/en/docs/languages/java/getting-started.md, as an example of how usage will be simplified by using this new version of the tool
    • @jack-berg: I've not updated any other Java pages with <?code-excerpt...?> directives b/c I know you're working on them. If you would like me to clean up those files, let me know.
  • Drops the old tools/, which was in support of the Dart tooling
  • npm scripts:
    • Adds check:code-excerpts
    • Adds fix:code-excerpts
    • Keeps a deprecated code-excerpts alias that prints a red deprecation notice
  • Includes check:code-excerpts in test:compound-tests so that it gets run in the Test PR check
  • Refreshescontent/en/site/build/npm-scripts.md to document the new commands and the deprecated alias.
  • Adjusts content/en/docs/languages/java/getting-started.md snippet markup so excerpt-related Prettier/Markdownlint comment markers stay clean.

/cc @vitorvasc

@chalin chalin requested a review from a team as a code owner April 13, 2026 15:14
@chalin chalin added the CI/infra Repo CI & infrastructure label Apr 13, 2026
@otelbot-docs otelbot-docs bot requested review from a team April 13, 2026 15:14
@github-actions github-actions bot added dependencies Pull requests that update a dependency file sig:java labels Apr 13, 2026
@otelbot-docs otelbot-docs bot added missing:docs-approval Co-owning SIG has provided approval, PR needs approval from docs maintainer missing:sig-approval Co-owning SIG didn't provide an approval labels Apr 13, 2026
chalin added 2 commits April 13, 2026 11:40
Replace the Dart-based code excerpt tooling with a Node-based code-excerpter package. Removed the tools/ Dart files and symlinks (README, build.yaml, pubspec.yaml, and tools/content/*), added the code-excerpter dependency, and introduced an internal _code-excerpter-over-en script. Add explicit npm scripts: check:code-excerpts and fix:code-excerpts (and keep a deprecated alias for code-excerpts that warns and forwards to fix), and updated package.json scripts accordingly. Also updated docs and site content: added "excerpter" to cspell words, refreshed npm-scripts.md to document the deprecation and new commands, and adjusted Java getting-started snippets to clean up prettier/markdownlint comment markers around code excerpts.
@chalin chalin force-pushed the chalin-m24-code-excerpter-ts-2026-0412 branch from deae16e to cea7650 Compare April 13, 2026 15:40
@otelbot-docs otelbot-docs bot removed the missing:docs-approval Co-owning SIG has provided approval, PR needs approval from docs maintainer label Apr 13, 2026
@chalin chalin added this pull request to the merge queue Apr 13, 2026
Copy link
Copy Markdown
Member

@jack-berg jack-berg left a comment

Choose a reason for hiding this comment

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

Nice - checked out this PR on my machine and played around with it a bit. Seems to work as expected.

@otelbot-docs otelbot-docs bot added ready-to-be-merged This PR is ready to be merged by a maintainer and removed missing:sig-approval Co-owning SIG didn't provide an approval labels Apr 13, 2026
Merged via the queue into open-telemetry:main with commit 9b4f0ef Apr 13, 2026
26 checks passed
@chalin chalin deleted the chalin-m24-code-excerpter-ts-2026-0412 branch April 13, 2026 18:56
tiffany76 pushed a commit to tiffany76/opentelemetry.io that referenced this pull request Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/infra Repo CI & infrastructure dependencies Pull requests that update a dependency file ready-to-be-merged This PR is ready to be merged by a maintainer sig:java

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add tooling in support of auto-update of code excerpts in docs

3 participants