Skip to content
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

Merged
merged 2 commits into from
Mar 3, 2022

Conversation

nathan-contino-mongo
Copy link
Contributor

@nathan-contino-mongo nathan-contino-mongo commented Mar 3, 2022

  • Use language=<lang> prop instead of className="language-<lang>" for imported code blocks

Motivation

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

- 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.
@facebook-github-bot
Copy link
Contributor

Hi @nathan-contino-mongo!

Thank you for your pull request and welcome to our community.

Action Required

In 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.

Process

In 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 CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@nathan-contino-mongo
Copy link
Contributor Author

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.

@netlify
Copy link

netlify bot commented Mar 3, 2022

✔️ [V2]
Built without sensitive environment variables

🔨 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

@github-actions
Copy link

github-actions bot commented Mar 3, 2022

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 51
🟢 Accessibility 100
🟠 Best practices 83
🟢 SEO 100
🟢 PWA 90

Lighthouse ran on https://deploy-preview-6830--docusaurus-2.netlify.app/

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Mar 3, 2022
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@Josh-Cena Josh-Cena changed the title refactor: simplify imported code blocks docs: simplify imported code blocks syntax Mar 3, 2022
@Josh-Cena Josh-Cena added the pr: documentation This PR works on the website or other text documents in the repo. label Mar 3, 2022
Copy link
Collaborator

@Josh-Cena Josh-Cena left a 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.

@Josh-Cena Josh-Cena merged commit 5f1edd5 into facebook:main Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: documentation This PR works on the website or other text documents in the repo.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants