-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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 playgroundPosition config for live codeblock #4328
Conversation
…Editor in @docusaurus/theme-live-codeblock
[V1] Deploy preview failure Built without sensitive environment variables with commit 2aaa692 https://app.netlify.com/sites/docusaurus-1/deploys/60413c6c12b374000779b8fa |
Deploy preview for docusaurus-2 ready! Built without sensitive environment variables with commit 2aaa692 |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-4328--docusaurus-2.netlify.app/classic/ |
Size Change: +20 B (0%) Total Size: 532 kB
ℹ️ View Unchanged
|
@@ -343,6 +345,25 @@ function MyPlayground(props) { | |||
} | |||
``` | |||
|
|||
### Configuration | |||
|
|||
You can also configurate `@docusaurus/theme-live-codeblock` plugin with the following parameters: |
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.
going to move this part to the API doc of the plugin because it's a less useful option
Could it be better if it was customizable via metastring, like that?
|
# Conflicts: # packages/docusaurus-theme-live-codeblock/src/theme/Playground/index.js # packages/docusaurus-theme-live-codeblock/src/theme/Playground/styles.module.css
@lex111 agree but can be implemented later in a separate PR. if someone needs this? Configuring this globally still has value |
@tokarchyn please let me push to your branch by checking the checkbox allowing maintainers to edit your fork. I resolved the conflicts and also made the API more "future proof" I'd appreciate a review regarding the styles with top/bottom, as I'm not 100% sure I handled the conflicts correctly: |
In case you want to update your branch yourself, my changes are pushed on branch slorber/playgroundPosition |
@slorber I checked the checkbox right after creating pull request, so maybe there is something else I should do to allow edits by maintainers. |
Thanks that's ok
Just let me know if it still works like you wanted
Le jeu. 4 mars 2021 à 21:08, tokarchyn <notifications@github.com> a écrit :
… @slorber <https://github.com/slorber> I checked the checkbox right after
creating pull request, so maybe there is something else I should do to
allow edits by maintainers.
Nevertheless, I've already merged your branch into fork's master. Should I
also squash the commits or do something else?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4328 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFW6PW3DUF6EDW2FPLC26DTB7SCBANCNFSM4YP2KLFA>
.
|
Thanks, let's merge this as is, seems good enough to me |
Motivation
I would like to make section with live code examples in my project's documentation, but because of fact that result is shown after code editor and my examples code is large, it does not look pretty. That is why I decided to add possibility to configure @docusaurus/theme-live-codeblock plugin, so It will show result before the editor.
Have you read the Contributing Guidelines on pull requests?
Yes.
Test Plan
Add configuration in file "docusaurus.config.js" like this:
All live code blocks should change their appearance like this: