docs: use parsed-literal to highlight interactive examples

There are a few code blocks where the default highlighting does not
work and the documentation looks bad as a result. Usually this happens
when we are demonstrating an important interactive feature, such as
autosuggestions, syntax highlighting, or tab completion.

The pygments highlighter was not designed for code samples like these.
But it is important to show the behavior clearly in the docs. I am
attempting to make these weird examples look as much like the "normal"
code blocks as possible.

https://docutils.sourceforge.io/docs/ref/rst/directives.html#parsed-literal
This commit is contained in:
Charles Gould
2020-08-02 12:01:34 -04:00
committed by ridiculousfish
parent ac1f63781d
commit 2740473a65
3 changed files with 84 additions and 49 deletions

View File

@@ -1,5 +1,22 @@
.sphinxsidebar ul.current > li.current { font-weight: bold }
.gray { color: #555555 }
.purple { color: #551a8b }
.red { color: #FF0000 }
/* Color based on the Name.Function (.nf) class from pygments.css. */
.command { color: #005fd7 }
/* Color based on the Name.Constant (.no) class from pygments.css. */
.param { color: #00afff }
/* Color based on the Name.Constant (.no) class from pygments.css. */
/* Used for underlining file paths in interactive code examples. */
.param-valid-path { color: #00afff; text-decoration: underline }
/* Color based on the Generic.Prompt (.gp) class from pygments.css. */
.prompt { color: #8f5902 }
kbd {
background-color: #f9f9f9;
border: 1px solid #aaa;