Skip to main content

Copy Code to Clipboard

Paligo has a Copy to Clipboard feature that you can use with your code samples.

When the feature is enabled, a copy button appears for each programlisting element, and your readers can use it to copy the code sample inside the element to their computer's clipboard. This makes it easier for your readers to use the exact code from your samples as a starting point for their own programs.

A section of a topic in an HTML output. There is a code sample in the content, and to the right of the code, a copy to clipboard icon.

Copy button for all programlisting elements.

To enable or disable the copy code feature:

  1. Select Layout in the top menu.

    Paligo editor. The Layout option in the header menu is highlighted.

    Paligo displays a list of Layouts. The list is empty if there are no custom Layouts in your Paligo instance.

  2. Select the Layout you want to update or Create a Layout.

    Tip

    You can copy the URL of the Layout Editor and paste it into a new tab in your browser. This can be useful if you frequently switch between your Paligo content and the Layout settings.

  3. Select Analytics and other integrations in the sidebar.

    Analytics_and_other_integrations_Layout_small.jpg
  4. Disable Enable MathJax equation rendering.

    Enable_MathJax_Equation_Rendering.png
  5. Select Verbatim (code and software) in the sidebar.

    Verbatim_Code_and_Software.png
  6. Use the Add copy to clipboard button to all programlistings to control whether the copy button is included:

    Layout setting - add copy to clipboard button for all programlistings.
    • Set it to 1 to include the copy button for every programlisting element in your HTML5 output.

    • Set it to 0 or default if you do not want to include it.

  7. Select Save.

When you publish your content using this layout, the programlistings will have a copy button if you chose to enable the feature.