-
-
Notifications
You must be signed in to change notification settings - Fork 9k
docs: mention admonition quirks with Prettier #6135
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
Conversation
@@ -69,6 +69,27 @@ Some **content** with _markdown_ `syntax`. Check [this `api`](#). | |||
|
|||
::: | |||
|
|||
## Usage with Prettier |
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.
I'd have used an admonition to relay this message but there are already so many example admonitions on this page people probably won't notice a non-example
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.
That's hard🤦♂️Maybe we should wrap the demo admonitions in <BrowserWindow>
instead? But the current solution looks fine
✔️ [V2] 🔨 Explore the source changes: 21aa712 🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/61c000e5acd7800008ba420e 😎 Browse the preview: https://deploy-preview-6135--docusaurus-2.netlify.app |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-6135--docusaurus-2.netlify.app/ |
@@ -69,6 +69,27 @@ Some **content** with _markdown_ `syntax`. Check [this `api`](#). | |||
|
|||
::: | |||
|
|||
## Usage with Prettier | |||
|
|||
If you use [Prettier](https://prettier.io) to format your Markdown files, Prettier might autoformatting your code which results in invalid the admonition syntax. To avoid this problem, add empty lines around your content. This is also why the examples we show here all have empty lines around the content. |
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.
If you use [Prettier](https://prettier.io) to format your Markdown files, Prettier might autoformatting your code which results in invalid the admonition syntax. To avoid this problem, add empty lines around your content. This is also why the examples we show here all have empty lines around the content. | |
If you use [Prettier](https://prettier.io) to format your Markdown files, Prettier might autoformat your code to invalid admonition syntax. To avoid this problem, add empty lines around the starting and ending directives. This is also why the examples we show here all have empty lines around the content. |
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.
Thank you, I should have proofread it 🤦🏻
Also I guess you would need |
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.
👍 Good to merge whenever you feel ready
Motivation
Some people at Meta were confused when they ran Prettier on their Markdown files and Prettier messed up their admonition syntax.
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
Netlify preview
Related PRs
(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)