-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Refactor GitHub alert capitalization styling #4088
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
@hichemfantar is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
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.
via css to allow control and easier overrided by the users.
this this another feature to implement, i don't see any benefit in your change, even github when you write [!NOTE]
outputs in DOM Note
and not NOTE
I'm talking css stylesheet override not passing props also
and it's compatible with #4087 |
even docusaurus uses css for text transform |
the current implementation has downsides but the new one doesn't have any |
it's not compatible due to this check nextra/packages/nextra/src/client/hocs/with-github-alert.tsx Lines 29 to 33 in bcc34cc
|
let me see |
the check doesn't affect current behavior, our change is purely presentation. |
ah you mean the assertion, i'll handle it |
fixed |
I don't see the pros of this PR, github renders all of these same > [!note]
> [!note]
> [!nOte]
> [!nOte]
> [!NOTE]
> [!NOTE] Note [!note] Note [!nOte] Note [!NOTE] |
It’s future proofing for #4087 |
the goal of this HOC to always have same callouts supported by GitHub If you want to pass custom titles, IMO {
caution: 'Error',
important: 'Important',
note: 'Note',
tip: 'Tip',
warning: 'Warning'
} so you could override
so you'll write
which will be rendered with
|
What if I want to have a call out but use my own titles? I do btw You shouldn’t assume what the user wants to render because that’s creating unnecessary limitations which is exactly why docusaurus provides a way to provide a custom title. |
You can provide your own HOC component (for |
so callout will be rendered nicely in your website and in GitHub as well |
why not make it a general solution? github has a limitation that your solution can easily not have. it's also opt in. it's also a highly requested feature https://github.com/orgs/community/discussions/103219 |
I don't see the benefit of writing custom alert syntax aka
which will be not rendered by GitHub, this isn't goal of this HOC, the goal is to be compatible to GitHub Alert syntax |
once it will be supported by github, we can add support in Nextra as well |
a documentation engine should as flexible as possible which is why i still use docusaurus for many projects even though i'd like to move them to nextra. it's small things like this that will help nextra get more adoption. take it from a power user. |
do you think we should throw an error here https://github.com/shuding/nextra/pull/4088/files#diff-b10660e8325c20788b36ba3d2b8eb76e4bde020249fd3df234653df7a5d86223R32 |
Closing since I do not plan to make GitHub Alert Syntax HOC configurable with custom titles (for me it should match GitHub behaviour). If you need a custom title/icon feature just use Nexta's callout https://nextra.site/docs/built-ins/callout directly |
Why:
Titles should displayed as they are and modified via css to allow control and easier overrided by the users.
more reliable (text isn't modified) also better performance (no js) and more typesafe (non-null assertion)
contributes to: #4087
What's being changed (if available, include any code snippets, screenshots, or gifs):
Replace manual capitalization of GitHub alert names with CSS styling for improved consistency and maintainability.
Check off the following:
deployment link in this PR's timeline (this link will be available after
opening the PR).