-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Code block with language tabs #982
Comments
There is the problem of syntax though. How do we divine code block with language tabs ? :o |
A way to do it is to extend the markdown grammar to support it. Like said here, the text of the code block should be self-contained in the markdown instead of using external files. Then maybe we need to patch the markdown parser to support this new grammar. Javascript is then used to render it. However, modifying markdown grammer is not always good. Another way is to put a placeholder like a reserved label |
@hsluoyz - we have a pull request in review that can add tabbing to a docs page. I imagine we could repurpose the final version of that to do something similar to what is being asked for here. |
@JoelMarcey Thanks! Never thought the PR will be so fast! We are really looking forward to this feature! I will test it first when the feature is ready :) |
#1063 might be a better option (but we are still settling a nicer syntax, but overall the PR looks good) https://deploy-preview-1063--docusaurus-preview.netlify.com/docs/en/next/doc-markdown#code-tabs |
Thanks for the status update! This PR is really amazing! Cannot wait to try it :) @fiennyangeln @endiliey |
I believe tabbed code block is now supported on latest version |
I will try it ASAP, close it now. |
🚀 Feature
Code block with language tabs
Have you read the Contributing Guidelines on issues?
Yes
Motivation
My project is a library. It supports four languages: Golang, Java, PHP and Node.js. So I need to show code in multiple languages in my documentation.
Pitch
I already noticed the discussion here: #103. But it seems to be a little hacky. I still want to know if there's any official decision on this feature or other third-party recommendations? Thanks.
The text was updated successfully, but these errors were encountered: