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
custom
include
lib
sockops
tests
.gitignore -rw-r--r-- 151 bytes
COPYING -rw-r--r-- 17.6 KB
Makefile -rw-r--r-- 18.7 KB
Makefile.bpf -rw-r--r-- 3.0 KB
bpf_alignchecker.c -rw-r--r-- 2.8 KB
bpf_features.h -rw-r--r-- 333 bytes
bpf_host.c -rw-r--r-- 34.6 KB
bpf_lxc.c -rw-r--r-- 51.3 KB
bpf_network.c -rw-r--r-- 969 bytes
bpf_overlay.c -rw-r--r-- 9.6 KB
bpf_sock.c -rw-r--r-- 29.1 KB
bpf_xdp.c -rw-r--r-- 6.6 KB
cilium-map-migrate.c -rw-r--r-- 12.9 KB
cilium-probe-kernel-hz.c -rw-r--r-- 3.9 KB
ep_config.h -rw-r--r-- 1.5 KB
filter_config.h -rw-r--r-- 508 bytes
init.sh -rwxr-xr-x 18.1 KB
netdev_config.h -rw-r--r-- 375 bytes
node_config.h -rw-r--r-- 6.5 KB

back to top