Skip to content

[RFC] Differenciate "caution" admonitions #19181

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

Closed
smnandre opened this issue Nov 24, 2023 · 13 comments
Closed

[RFC] Differenciate "caution" admonitions #19181

smnandre opened this issue Nov 24, 2023 · 13 comments
Labels
hasPR A Pull Request has already been submitted for this issue. Website

Comments

@smnandre
Copy link
Member

TLDR: Way too much text to suggest two things :

  • differenciate "caution" depending on the level (or soften the "red")
  • minor CSS adaptations on mobile (see the screenshots at the end)

While reading the bundle docs, I felt a bit... "attacked" (big quotes around, I'm all right haha..) This is a minor topic. But even on an tiny tiny level, i think there may be something there to improve easily.

Why "attacked" ? As the perfect human beeing i am (**cough**), when it's red, in my head i understand "this is a danger, a risk and i must read this right now".

It was neither a danger, neither something i had to read. And when it happens a lot, i really feel patronized / yelled at.

So maybe a softer red could be used (see suggestions at the end of this message), or ....

Differenciate DANGER and... ??

I think there is a semantic difference between "danger/alert/caution" and "warning"(?).

To illustrate, the following blocs should be (in my mind) on two really different levels of importance.

Profiler Bundles
profiler bundle

We had a similar discussion recently on the UX repository about the UX packages docs. I was not keen to display a big red/caution block to give an information. But that information was a pretty highly important one.

So i suggest to differenciate CAUTION either by

  • introducing a lower level
  • introducting a higher level

But in both case i don't find the "perfect word" for it.

Style on mobile

On mobile, i find the admonition-* blocks really large. Maybe some small modifications could be made to ease the reading:

  • remove the margin-bottom after the title
  • diminish the font-size (as it's done for the "since-version" blocks)
  • use a smaller border-width (2px currently)

See how it compares in the following before/after table.

Suggestion

Here a 3 screens to visualise what those ideas could render

- Profiler Bundles Content
Before profiler mobile bundle mobile content mobile
After profiler mobile sugggested bundle mobile suggested content mobile suggested
@OskarStark
Copy link
Contributor

cc @javiereguiluz

@wouterj
Copy link
Member

wouterj commented Dec 9, 2023

ReStructuredText comes with a .. caution:: and .. danger:: admonition that we currently use as aliases, we might want to differentiate between them?

@smnandre
Copy link
Member Author

I do think "data integrity" and "security" (in a broad meaning) deserve to be separated from the rest.

But if you people do not think it's worth it i'm fine with it.

I'll list all those "gray area" admonitions and we may discuss the "not-obvious" ones, maybe write a sort of "rule" down ?

@smnandre
Copy link
Member Author

@javiereguiluz
Copy link
Member

Yes, I think this change makes sense. As Wouter said, RST gives us danger in addition to caution. So, let's demote caution to warning messages and let's add danger for truly dangerous problems.

What Simon said is a good way to decide which one to use: "data integrity or security" issues --> danger; anything else --> caution.

The map from GitHub admonitions would be:

GitHub Us
note .. note::
tip .. tip::
important (none)
warning .. caution::
caution .. danger::

Next steps?

  • (Someone) Check if https://github.com/symfony-tools/docs-builder needs to do some change for this
  • (Me) Change the current styles of caution and make them orange/yellow and add a new danger style with the same styles as the current caution styles
  • (Community) Review all Symfony Docs and change some .. caution:: directives to .. danger::

Anything else?

@smnandre
Copy link
Member Author

I'm having a look at docs-builder

@alexandre-daubois
Copy link
Member

alexandre-daubois commented Dec 15, 2023

I'm having a look at cautions in the overall docs repo to change some to danger.

@smnandre
Copy link
Member Author

Here are some suggestions for the danger icon (from tabler)

admonition-danger

Currently the danger are rendered as caution, so we'll need to check the doc for them too (cc @alexandre-daubois )

@alexandre-daubois
Copy link
Member

Got it, thank you for letting me know!

@smnandre
Copy link
Member Author

@javiereguiluz the only thing that'd need to change i think is the LEVEL => ICON mapping in src/Templates/default/html/directives/admonition.html.twig

I can open a PR and add a test with a new expected / source block for danger if you want ?

@smnandre
Copy link
Member Author

source border title icon
tip #059669 #10b981 #047857
warning #d97706 #f59e0b #b45309
caution #db2777 #ec4899 #be185d

(don't mind me i just discovered we can show colors in github's markdown)

javiereguiluz added a commit to symfony-tools/docs-builder that referenced this issue Dec 26, 2023
This PR was squashed before being merged into the main branch.

Discussion
----------

Add directive test for admonition/danger

Follows this topic about admonition levels on symfony/symfony-docs: [[RFC] Differenciate "caution" admonitions #19181 ](symfony/symfony-docs#19181)

The bloc `danger` will be used soon in Symfony docs (cc [javiereguiluz](https://github.com/javiereguiluz) [comment](symfony/symfony-docs#19181 (comment)) ).

So this PR allow a single test to check its compilation.

Commits
-------

2f89856 Add directive test for admonition/danger
javiereguiluz added a commit that referenced this issue Dec 26, 2023
This PR was merged into the 5.4 branch.

Discussion
----------

Mutate some `cautions` to `dangers`

Part of #19181

Commits
-------

ac45c0c Mutate some `cautions` to `dangers`
@javiereguiluz
Copy link
Member

Let's close this one as fixed.

We did an amazing team work here 💪

E.g.

Thanks!

@xabbuh xabbuh added the hasPR A Pull Request has already been submitted for this issue. label Dec 26, 2023
@smnandre
Copy link
Member Author

Thank you all 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hasPR A Pull Request has already been submitted for this issue. Website
Projects
None yet
Development

No branches or pull requests

6 participants