Revision 305e60034740f8e20221b6e00830ee0814102bd6 authored by Quentin Monnet on 07 May 2021, 10:41:24 UTC, committed by André Martins on 16 June 2021, 00:03:28 UTC
[ upstream commit 869e678b1ae3461b169259155e3bb52b6b4fa072 ]

Add a "Copy Commands" to some code blocks. This new button attempts to
copy only commands (and not their output) to the clipboard. The
distinction between commands and output relies on the presence of a
prompt symbol, either "$" or "#", at the beginning of the commands. If a
command ends with a trailing backslash, copy the next line as well.

For example, the following snippet:

    .. code-block:: shell-session

        $ ls -l
        foo
        cat
        $ echo 1 \
        2 \
                3\
            4
        $nospace
        # exit

should place the following text into the clipboard:

    ls -l
    echo 1
    2
            3
        4
    exit

The button is added for the following blocks, when they contain several
lines and at least one command is found in the block:

- "code-block", but with language "shell-session" only,
- Literal blocks ("::"),
- Parsed literals.

Signed-off-by: Quentin Monnet <quentin@isovalent.com>
Signed-off-by: Sebastian Wicki <sebastian@isovalent.com>
1 parent c7c92f2
History
File Mode Size
.github
.travis
Documentation
api
bpf
bugtool
cilium
cilium-health
clustermesh-apiserver
contrib
daemon
envoy
examples
hack
hubble-relay
images
install
jenkinsfiles
operator
pkg
plugins
proxylib
test
tests
tools
vendor
.authors.aux -rw-r--r-- 416 bytes
.gitattributes -rw-r--r-- 211 bytes
.gitignore -rw-r--r-- 1.5 KB
.gitmodules -rw-r--r-- 0 bytes
.golangci.yaml -rw-r--r-- 3.3 KB
.mailmap -rw-r--r-- 3.5 KB
.travis.yml -rw-r--r-- 1.1 KB
AUTHORS -rw-r--r-- 18.8 KB
CHANGELOG.md -rw-r--r-- 116.9 KB
CODEOWNERS -rw-r--r-- 574 bytes
CODE_OF_CONDUCT.md -rw-r--r-- 2.2 KB
CONTRIBUTING.md -rw-r--r-- 227 bytes
FURTHER_READINGS.rst -rw-r--r-- 4.9 KB
GO_VERSION -rw-r--r-- 7 bytes
LICENSE -rw-r--r-- 11.1 KB
MAINTAINERS.md -rw-r--r-- 3.6 KB
Makefile -rw-r--r-- 27.6 KB
Makefile.defs -rw-r--r-- 6.0 KB
Makefile.docker -rw-r--r-- 6.1 KB
Makefile.quiet -rw-r--r-- 718 bytes
README.rst -rw-r--r-- 14.7 KB
SECURITY.md -rw-r--r-- 615 bytes
USERS.md -rw-r--r-- 6.8 KB
VERSION -rw-r--r-- 7 bytes
Vagrantfile -rw-r--r-- 12.8 KB
go.mod -rw-r--r-- 5.3 KB
go.sum -rw-r--r-- 138.9 KB
netlify.toml -rw-r--r-- 92 bytes
vagrant_box_defaults.rb -rw-r--r-- 392 bytes

README.rst

back to top