Insert copy button to copy code inside a code block
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 2
- Joined: Fri Feb 07, 2025 5:53 pm
Insert copy button to copy code inside a code block
While in Author or Editor mode, is there a method of copying code from a code block in a webhelp page to the operating system's clipboard?
This page has a perfect example of what I want to do:
https://www.oxygenxml.com/doc/versions/ ... -html.html
I want to be able to include this button in my HTML output:
Any help would be much appreciated.
Thanks
This page has a perfect example of what I want to do:
https://www.oxygenxml.com/doc/versions/ ... -html.html
I want to be able to include this button in my HTML output:
image.png
The idea is to make for a better user experience when the user is viewing code samples in the Online Help.Any help would be much appreciated.
Thanks
You do not have the required permissions to view the files attached to this post.
-
- Posts: 9472
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Insert copy button to copy code inside a code block
Hi,
Thanks for the feature request!
Right now we do not have a special copy action for code blocks when working in the Text/Author visual editing modes.
I added an internal issue based on your request, pasting the issue ID below for future reference:
EXM-55272 Copy action for code blocks
If we get to fix this issue in a future version I will update this forum thread.
As a possible workaround at least for the Author visual editing mode, I would triple click inside the codeblock to select it completely and then cut or copy it. Triple click works also in the Text mode, it will also copy the <codeblock> tags though if you plan to paste afterwards in a Notepad or some other external application.
Regards,
Radu
Thanks for the feature request!
Right now we do not have a special copy action for code blocks when working in the Text/Author visual editing modes.
I added an internal issue based on your request, pasting the issue ID below for future reference:
EXM-55272 Copy action for code blocks
If we get to fix this issue in a future version I will update this forum thread.
As a possible workaround at least for the Author visual editing mode, I would triple click inside the codeblock to select it completely and then cut or copy it. Triple click works also in the Text mode, it will also copy the <codeblock> tags though if you plan to paste afterwards in a Notepad or some other external application.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 2
- Joined: Fri Feb 07, 2025 5:53 pm
Re: Insert copy button to copy code inside a code block
Hi Radu,
Thanks for getting back to me and thanks very much for raising the feature request.
Another question. How did you include this copy button in your HTML output? This is what I want to achieve.
Thanks for getting back to me and thanks very much for raising the feature request.
Another question. How did you include this copy button in your HTML output? This is what I want to achieve.
image.png
ThanksYou do not have the required permissions to view the files attached to this post.
-
- Posts: 9472
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Insert copy button to copy code inside a code block
Hi,
The WebHelp publising is part of our commercial offering, its code is not open source. You can probably search online for similar ways to add copy buttons via Javascript.
Regards,
Radu
The WebHelp publising is part of our commercial offering, its code is not open source. You can probably search online for similar ways to add copy buttons via Javascript.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service