Skip to content

Conversation

@leemthompo
Copy link
Contributor

@leemthompo leemthompo commented Nov 12, 2025

Uses https://github.com/elastic/request-converter

I've got a hacky Python script that automates adding multi-language code examples to docs pages.

  • Finds console code blocks in markdown files
  • Converts them to multiple languages (Python, JS, PHP, Ruby, curl) using es-request-converter CLI
  • Wraps results in tab-sets (handles incrementing outermost colons in directives to work with steppers etc.
  • Handles annotations, localhost replacement, and formatting quirks
  • Works around two bugs found in the converter itself

I'll share and "document" the script itself as part of ON week summary.

Related PR: #3908

@github-actions
Copy link

github-actions bot commented Nov 12, 2025

🔍 Preview links for changed docs

- Extract code examples into _snippets/ directory
- Replace inline code blocks with include directives
- Generate snippet files
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