-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
docs: simplify imported code blocks syntax #6830
Conversation
- Use `language=<lang>` prop instead of "className="language-<lang>" for imported code blocks I've been using this in my personal projects ([example](https://raw.githubusercontent.com/nathan-contino-mongo/docusaurus-realm/9a2ebb6a43bbbd7b38899fcc86c903dcc1f61283/docs/sdk/kotlin/migrate-from-java-sdk.mdx)) since it is less verbose. If this interface is somehow less stable than the `className` prop, feel free to close this. But if both will work going forward we should probably recommend the simpler of the two.
Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
Signed the CLA -- sorry I didn't complete that in advance. Let me know if I should do anything else to get that CI check passing, it looks like it's failed and won't retry until I push another change to this branch. |
✔️ [V2] 🔨 Explore the source changes: 1fabcda 🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/6220fcab2a500300080492ff 😎 Browse the preview: https://deploy-preview-6830--docusaurus-2.netlify.app |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-6830--docusaurus-2.netlify.app/ |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! The language
prop is indeed the recommended way going forward.
language=<lang>
prop instead ofclassName="language-<lang>"
for imported code blocksMotivation
I've been using this in my personal projects (example) since it is less verbose.
If this interface is somehow less stable than the
className
prop, feel free to close this.But if both will work going forward we should probably recommend the simpler of the two.
Have you read the Contributing Guidelines on pull requests?
Yes. Apologies if I missed anything -- there is quite a bit to read.
Test Plan
I've tested this in my own personal project. Linked above. You can see these code blocks (with syntax highlighting) working in action at the github pages-deployed site.
Related PRs
N/A