-
Notifications
You must be signed in to change notification settings - Fork 53
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
[SR-15914] Quickly copy code snippets from documentation #274
Comments
Can I work on this issue? I have an idea how to resolve this. |
Hi @khubaibalam2000 , of course! Feel free to open a PR against the repo! Here you have information about how to contribute: https://github.com/apple/swift-docc-render/blob/main/CONTRIBUTING.md |
Hi @khubaibalam2000 , that error about the theme-settings.json is totally fine. It won't block you from previewing any doccarchive, it's just an optional theme file. Are you using a doccarchive when running the repo? I won't work without it. I attach one as example for you to be able to test: SlothCreator.doccarchive.zip You will need to run the project doing: When going to: http://localhost:8080/documentation/slothcreator you will see this: then you can go to some page like http://localhost:8080/documentation/slothcreator/foodgenerator/generatefood(in:) where there is a code snippet, for you to manually test your progress. Let me know if you face any other new issue on the way! :) |
I took a closer look! Usually (like the linked Inspiration page in Nuxt docs), you'd have a copy button in the top-right corner, on the same toolbar where the filename is: https://content.nuxt.com/components/content-list DocC Render currently has two typical presentations of code listings:
The easiest way to add the copy button would be to make a new component for the button and style to be If we go that route, we'd need to add more padding to the Preview component, because right now it's on the right and pretty close to the top of the whole code listing component. Related: I'm looking at swiftlang/swift-docc#737 (comment) — and if we end up tweaking
I have the whole pipeline running locally, but I'll likely only get to this within this or next week, got a few other things to take care of ;( |
Attachment: Download
Additional Detail from JIRA
md5: 5f55926266c45b3d40ef1c9effa5213b
Issue Description:
Quickly copy code snippets from documentation using a button that appears on code snippet's hover state.
It improves the UX for this specific action
Inspitation: https://content.nuxtjs.org/snippets/
The text was updated successfully, but these errors were encountered: