-
Notifications
You must be signed in to change notification settings - Fork 16
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
Widget code-block
#34
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/goplus/www/HNs9nbrqUbdp37SZGq428EyX6k4F |
"react-copy-to-clipboard": "^5.0.4", | ||
"react-dom": "17.0.2", | ||
"react-markdown": "^7.1.0", | ||
"react-syntax-highlighter": "^15.4.5", |
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.
react-syntax-highlighter
是 react-code-blocks
依赖的库,这里换成 react-syntax-highlighter
是为了更好的细节控制能力
I care the output specification. Is there a .js script to use, like |
why call it |
It loads widgets specified with attribute <script data-widgets="code" src="https://goplus.org/widgets/loader.js"></script> This will load widget <script data-widgets="code,editor" src="https://goplus.org/widgets/loader.js"></script> It will load both Details are described here.
|
@xushiwei This is intended - so that we can update widgets throughout all sites at once. The way to import as a library (installed locally with version specified by some package management tool), may be supported later. But it's not as convenient, that's why it's not supported at first place. |
many developers care about code size. if they only need |
The file
|
P.S. The loader way is also performance-friendly, as it reuses browser cache for widget files across different sites. For example, when user browsing |
👍🏻 |
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.
🐂 🍺
Features
: get doc content byimport
instead ofgetStaticProps
Code
RefactorCode
RunnableCode
Editable (Go to playground, instead of edit in-place)Code
Docs Aside SupportCode
as widget<goplus-code>
Features
, as some codes is not executableDocs Aside Support
component
Code
widget
goplus-code
Output