Following up on the recent RFC that introduced copy-to-clipboard on code blocks, I’ve been working on additional options that build on that work. These additional options would also be available behind the --enable-experimental-code-block feature flag to modify the presentation of code blocks:
highlight=[Int]— highlight one or more specific linesstrikeout=[Int]— strikethrough specific lineswrap=Int— apply soft wrapping at a specified widthshowLineNumbers— toggle line numbers on
The implementation of these additional options is available across two PRs, which work together:
To illustrate these options, here's a code block as it appears today, without any additional options:
```shell
# Enable custom routing.
RewriteEngine On
# Route documentation and tutorial pages.
RewriteRule ^(documentation|tutorials)\/.*$ MyNewPackage.doccarchive/index.html [L]
# Route files and data for the documentation archive.
#
# If the file path doesn't exist in the website's root ...
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# ... route the request to that file path with the documentation archive.
RewriteRule .* MyNewPackage.doccarchive/$0 [L]
```
And here's the same example with the new options:
# shows line numbers and wraps lines at a character width of 60
# highlights lines 2, 5, 10, and 11
# adds a strikethrough line on lines 9 and 10
```shell, showLineNumbers, wrap=60, highlight=[2, 5, 10, 11], strikeout=[9, 10]
# Enable custom routing.
RewriteEngine On
# Route documentation and tutorial pages.
RewriteRule ^(documentation|tutorials)\/.*$ MyNewPackage.doccarchive/index.html [L]
# Route files and data for the documentation archive.
#
# If the file path doesn't exist in the website's root ...
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# ... route the request to that file path with the documentation archive.
RewriteRule .* MyNewPackage.doccarchive/$0 [L]
```
These additions are meant to give authors more control over how their code is presented. Each option is opt-in at the code block level, so you can apply them only where they make an example clearer without affecting the rest of your documentation.
Thanks again to everyone who’s been part of these conversations. We’ve gotten some seriously helpful feedback in these discussions and we’ve appreciated what you all have shared. I’m looking forward to the discussion on these new options.


