Skip to main content

Copy button for code blocks within documentation

I am recreating the feature request I sent to support in the past: Since the docs contain "$" and "#" in their commands to symbolize if the command should be executed as root/sudo or non-root/non-sudo, it makes copying it over to shell directly hard, especially multi-line command blocks. Therefore having a native copy button that would exclude the "$" or "#" would help immensely.
Status: Completed4 comments

Log in to comment and vote

Comments4

  • Arni Johannesson changed status to Completed
    Team•

    Oct 5, 2022

    This has been completed and gone live today. We are reviewing all our docs pages to make sure it works everywhere and we have consistent code examples.

    • Epsilon PS _ Paul Schiffer

      •

      Oct 22, 2022

      Arni from Webdock: I noticed today that the copy button scrolls with the text if a code block is too wide to be displayed completely. One example is the "Install base packages" block on the following page: https://webdock.io/en/docs/perfect-server-stacks/apache-stacks/ubuntu-lamp-81#:~:text=x%20mariadbreposetup%0A./mariadbreposetup-,Install%20base%20packages,-apt%2Dget%20update . Also see the attached image. Furthermore, is it possible to extend the limits of the code block to the right so the copy button receives its own space? At the moment it blocks a few characters so I can't read the command fully before copying (See second attached image).

    • Arni Johannesson

      Team•

      Oct 23, 2022

      Epsilon PS _ Paul Schiffer: The copy button should only show on hover, so as long as you move the mouse outside the area it should not block any characters. As for the scroll-with-content issue, we will get that looked at. Thanks!

  • Arni Johannesson changed status to Planned
    Team•

    Sep 29, 2022

    Yes! Sorry this was lost from our internal lists somehow. We will get on this soon.