Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Markdown Code Component with Copy to Clipboard #2255

Closed
nipunchamikara opened this issue Feb 5, 2024 · 3 comments
Closed

Markdown Code Component with Copy to Clipboard #2255

nipunchamikara opened this issue Feb 5, 2024 · 3 comments
Labels
question Question

Comments

@nipunchamikara
Copy link
Member

Is your feature request related to a problem? Please describe

We have a card that displays some code lines using a ui.markup component by wrapping the code in <code> tags along with a button to download the code as a file.

Describe the solution you'd like

A way to copy the code in the ui.markup to clipboard by either clicking a button, or markdown cards as a component instead of a separate card.

Describe alternatives you've considered

Markdown cards do have a copy to clipboard functionality, it is a card which means it cannot be added as a component. To add a card would mean having to remake the layouts. Also looked into copying to clipboard using inline JS, but it looked too complicated.

@nipunchamikara nipunchamikara added the feature Feature request label Feb 5, 2024
@mturoci
Copy link
Collaborator

mturoci commented Feb 6, 2024

Hey @nipunchamikara I think this should be doable via ui.text IIRC. It should support markdown out of the box together with copy to clipboard button. Please give it a try and let me know.

@mturoci mturoci added the ui Related to UI label Feb 6, 2024
@nipunchamikara
Copy link
Member Author

Hello @mturoci, yep you are right, it works with ui.text. I'm not sure if the docs didn't made it clear or if I missed something. Anyways, thanks a lot! Closing this issue.

@mturoci
Copy link
Collaborator

mturoci commented Feb 7, 2024

Docs should be there - https://wave.h2o.ai/docs/widgets/form/text/#with-markdown, but feel free to make a PR if you think there is a room for improvement.

@mturoci mturoci added question Question and removed ui Related to UI feature Feature request labels Feb 7, 2024
@h2oai h2oai locked and limited conversation to collaborators Feb 7, 2024
@mturoci mturoci converted this issue into discussion #2259 Feb 7, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
question Question
Projects
None yet
Development

No branches or pull requests

2 participants