Components
Code Block
BetaCode to read and copy: a listing with line numbers, a diff or a command.
Details
Code to read, copy or edit, in a card: a listing with line numbers, a diff, tabbed files or a command. A header (file icon, file name, Copy, or a diff's +N -M) over a Code View, which draws the code: gutter, syntax colouring, diff rows, the current line, wrapping and scrolling. With files the header is the file tabs, the active file's path and one Copy; when the tabs do not fit, a pager and a select stand in for them. The command variant is one line with Copy at its end. editable makes the code an editor (the Code View's, CodeMirror 6, loaded only then); Copy takes the edited text. Because the block is built on the Code View, adding it installs the editor's packages, but a block that is never editable never downloads them (a dynamic import). Copy puts the code on the clipboard and says so for 1.5s. For code without the card (an editor pane), use a Code View.