-
Notifications
You must be signed in to change notification settings - Fork 672
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
[@theme-ui/prism] Add support for code titles, language info and copy button #212
Comments
@jxnblk If this is a feature that you want to see in |
That'd be great @johnletey 😺 |
Though I'd also add that the copy functionality should be opted into with a meta string.
|
That would also be a good idea. Also, in place of Copy button as text, we can have a something like a copy icon which might look good. What do you think, @johno ? |
I can dig it 👍 |
All great ideas guys! I will try to have something up by tomorrow! |
BTW @johno ... what is the best way to run |
Hm, right now it's a bit hacky. I just reran the build and then restarted the docs server : ) We could also set up a small dev site in the workspace that uses gatsby-plugin-compile-es6-packages and then we input from |
Got it ... might just try my bet to not mess things up 🤞 |
@johno @sonapraneeth-a Here are two options for this icon:
|
@johno How exactly do you want to add the language info, because Gatsby uses quite a lot of CSS to create those beautiful language tags Should I just copy all of the css directly and then put it into an |
@johnletey , are you using libraries for the icon or are they plain svg files? |
@sonapraneeth-a They are just plain SVG file Note that I haven't implemented anything for the copy feature yet or the language info ... just the code titles |
Hey all, I know this is probably unrelated, but it would be really great if the fenced code block metastring could be used to pass arbitrary props down to the component that renders the highlighted syntax and/or live preview. We've got a ton of issues with Primer CSS docs (see primer/css#735, primer/css#820, primer/css#841) that could be easily solved if we were able to style the containing element via props rather than putting the props into the code example itself: ```jsx p={2} minHeight={300}
<Dropdown>...</Dropdown>
``` And I feel pretty strongly that the metastring should be parsed properly — as JSX props — so that we can pass stuff like Addendum: Another way of saying ☝️ is: I think the |
@shawnbot All wonderful ideas ... maybe submit a new issue (or multiple issues) for all of these new features ... and when I'm done implementing the features requested in this issue, I'll start working on those (or you can too if you want too ... as you said)
I completely agree with you! Although I was under the impression that we did not follow the |
Yeah I'd like to avoid that syntax since it's less standard then metastrings or JSX props. Not to mention it breaks syntax highlighting on GitHub! 😸 |
Ah yes, my mistake! I was looking at gatsbyjs/gatsby/#15834 it didn't register that it was removed in the diff. 🤦♂
Cheers, will do! Thanks for all your hard work on this. 🤘 |
how to set line-highlighting using theme-ui/@prism like https://twitter.com/kentcdodds/status/1110276893293473792 ? |
We’re closing this issue, since we don’t want to include this functionality & specific cosmetic choices like icons directly inside Theme UI. You can build this into your own site using custom MDX components (see #1120 as an example). |
As mentioned in https://github.com/gatsbyjs/gatsby/pull/15834/files, it would be good to have code title and copy button support for theme-ui
The text was updated successfully, but these errors were encountered: