-
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
feat: Add support for code titles, language info and copy button #225
Conversation
@jxnblk Also, what are your opinion on #212 (comment), as we should include all of the language colors built in for the language info Also, which one of these icons do you like better? #212 (comment) These would be for the copy button, which has been decided that it should have an icon instead of the "Copy"/"Copied" text #212 (comment) (although I think that this shouldn't be default, and could maybe be stored in a variant?) |
Personally, I'd rather see a text label for copy, but I think we can add a prop to the |
@jxnblk and whoever else is following this PR, I have just pushed a commit with code that I believe adds support for a copy button! I'm not exactly quite if it works (as I have yet to find a way of testing the code locally), so would love feedback! Please note that the code for this feature was either adapted or lifted from the Gatsby source, which should be fine as they are using the MIT license Also note that I have yet to add support for custom icons instead of just the plain "Copy" text |
@johnletey , Do you have a screenshot of the rendered output? |
@sonapraneeth-a Like I said above, I don't know how to run the package locally ... would love some advice and I'd be happy to try to run it locally! |
@johnletey if you're able to run the docs site locally with This line could change to pass props to the component: // example
code: props => <Prism {...props} copy={true} />, |
Wow ... I'll have to try this out! Thanks @jxnblk Overall though, how does the code look? |
@johnletey are you still interested in working on this? If not, I think we can close this PR out for the time being |
@jxnblk Sorry for the late reply. Unfortunately, I don't think I will have much time to work on this in the future, so I am going to go ahead and close this. If there is anyone that wants to continue on this, go for it! |
Closes #212
Related gatsbyjs/gatsby#15834