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

fix(theme): make warning a first-class admonition, and deprecate caution admonition #9308

Merged
merged 7 commits into from Sep 15, 2023

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented Sep 14, 2023

Breaking change

  • The undocumented :::warning admonition becomes yellow instead of red, like most users expect
  • :::warning is now a first-class official admonition keyword
  • :::caution is deprecated in v3 and will be removed in v4

Motivation

Fix #7558

:::warning should render as:

CleanShot 2023-09-14 at 18 11 55

Instead of:

CleanShot 2023-09-14 at 18 12 42

Note :::warning used to be a legacy admonition alias that we didn't even document in the very first v2.0.0 (see docs).

Now :::warning becomes a first-class official admonition keyword.

It replaces the :::caution admonition keyword that keeps working in v3 but will be removed in v4 as part of #9307

Test Plan

Preview

Test links

https://deploy-preview-9308--docusaurus-2.netlify.app/tests/docs/tests/admonitions

@slorber slorber added pr: breaking change Existing sites may not build successfully in the new version. Description contains more details. pr: bug fix This PR fixes a bug in a past release. labels Sep 14, 2023
@slorber slorber added this to the 3.0 milestone Sep 14, 2023
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Sep 14, 2023
@netlify
Copy link

netlify bot commented Sep 14, 2023

[V2]

Name Link
🔨 Latest commit 3f6dd84
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/650334f70d7afa0008983192
😎 Deploy Preview https://deploy-preview-9308--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions
Copy link

github-actions bot commented Sep 14, 2023

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 62 🟢 97 🟢 92 🟢 100 🟠 89 Report
/docs/installation 🟠 81 🟢 98 🟢 92 🟢 100 🟠 89 Report

@github-actions
Copy link

Size Change: 0 B

Total Size: 1.11 MB

ℹ️ View Unchanged
Filename Size
website/.docusaurus/globalData.json 117 kB
website/build/assets/css/styles.********.css 113 kB
website/build/assets/js/main.********.js 836 kB
website/build/index.html 41.4 kB

compressed-size-action

@Josh-Cena
Copy link
Collaborator

Can we emit a warning server-side (and/or in dev mode) each time a deprecated type is used?

@slorber
Copy link
Collaborator Author

slorber commented Sep 14, 2023

Can we emit a warning server-side (and/or in dev mode) each time a deprecated type is used?

Yes but I'll do that later as I don't want users to be overwhelmed by the v3.0 upgrade immediately

@Josh-Cena
Copy link
Collaborator

Fair enough. We can emit warnings later

1 similar comment
@Josh-Cena
Copy link
Collaborator

Fair enough. We can emit warnings later

@slorber slorber merged commit f5ae537 into main Sep 15, 2023
29 of 30 checks passed
@slorber slorber deleted the slorber/admonition-warning branch September 15, 2023 08:48
This was referenced Oct 19, 2023
@boevski
Copy link

boevski commented Jan 17, 2024

Would you guys consider keeping both in v4? Both warning and caution have their place in writing, especially in some industries. There are plenty of discussions online explaining what the difference is between them.

@slorber
Copy link
Collaborator Author

slorber commented Jan 18, 2024

@boevski please comment on this issue instead: #9307

Make sure provide an exhaustive list of arguments and reference links to convince us it's worth it to keep caution, because a simple GitHub comment/claim is not enough to act on for us.

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: breaking change Existing sites may not build successfully in the new version. Description contains more details. pr: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RFC: change Docusaurus admonition warning color from red to yellow
4 participants