-
Notifications
You must be signed in to change notification settings - Fork 181
[ON week] Add language client examples to get-started/index-basics.md #3908
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
base: main
Are you sure you want to change the base?
Conversation
🔍 Preview links for changed docs |
915c963 to
75ccb18
Compare
- Extract code examples into _snippets/index-basics/ directory - Replace inline code blocks with include directives - Generate snippet files
|
It's necessary to pull all the examples into separate snippets and include them, otherwise it balloons the source page enormously. However, I'm on the fence about whether the The latest iteration of my script has a |
|
Putting this up for review for anybody interested in the approach, all feedback is welcome :) |
Would keeping the console example in a snippet make it easier to automatically re-generate the language client examples whenever the console example changes? If so, that might be a compelling reason to keep it "snippetized". BTW IMO it would be useful to have a comment at the top of the languages client snippets saying (1) they're generated, so don't edit them directly, and (2) a readme for how to re-generate them, which it sounds like you're already planning. |
It would definitely simplify the mental model of how regeneration works, but I'm also trying to imagine the authoring experience if you want to remove or add code blocks, which might get a bit involved. My initial concern would be that we increase the difficulty of contribution by hiding the console stuff away from the page it's rendered on, 🤷. Although if it was clearly documented that you just need to work within the snippets directory and then regenerate then that should be fine I guess. It will definitely block simple fixes on the web but there has to be a tradeoff somewhere. As mentioned in my ON week recap too, would need to make sure this is all compatible with George and Istvan's testing framework if we decide to implement either.
💯 |
Uses https://github.com/elastic/request-converter
An ON Week Python script automates adding multi-language code examples to docs pages.
Works around two bugs found in the converter itself(fixed in meantime!)I'll share and "document" the script itself as part of ON week summary.