-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
feat(v2): add ability default lang for code blocks #1910
Conversation
Deploy preview for docusaurus-2 ready! Built with commit c94f027 |
Deploy preview for docusaurus-preview ready! Built with commit c94f027 |
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'm ok with this. But I think we should alert people of the breaking changes by throwing an error in __DEV__
if prismTheme
is being declared.
Also we need CHANGELOG changes and docs changes in https://v2.docusaurus.io/docs/markdown-features#syntax-highlighting.
@endiliey WDYT?
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 thought this is still wip ?
It was a proof of concept, to show you, I will soon complete this PR.
Fine, although I would merely decide note in change log, given that this is an alpha version |
This should be fine. Seeing lot of people requesting dark and light mode config for the prism theme too.
prism.theme.dark
prism.theme.light
or just prism.theme
…Sent from my iPhone
On 3 Nov 2019, at 11:49 PM, Alexey Pyltsyn ***@***.***> wrote:
It was a proof of concept, to show you, I will soon complete this PR.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Hmm, I have a problem, I don’t know how to document the new |
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.
We can start documenting here. https://v2.docusaurus.io/docs/theme-classic
Under new CodeBlock
section.
Ready for review! ✔️ |
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'm gonna stop https://v2.docusaurus.io/ auto publishing on master push. We should only deploy the docs after new version is out
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.
LGTM. cc @endiliey for another approval
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.
feel free to merge.
Squash and merge. please ✌️
So exciting, merged! |
Motivation
It often happens that in Markdown code blocks do not (intentionally) specify the language, and then the default language was used. This is convenient if the examples language in docs is the same (why should it be indicated all the time?). Or, for example, when end-user forgot to specify that language.
Note: if you do not specify a language, then in HTML it will be represented as
language-undefined
.In v1 there was such an feature, I propose to bring back it to v2.
Also in this PR, as an experiment, changed way to provide options for Prism - in a separate object (as it was in v1). This is a breaking change, yes, but in the end it is a flexible approach, because in the future there may be more options for highlighting code (=Prism).
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
docusaurus.config.js
:js
: