Make the most out of your Sphinx documentation by using the features of the Awesome Theme.
On this page
To highlight text in code blocks, add the
emphasize-text: PLACEHOLDER option to the
.. code-block:: :emphasize-text: PLACEHOLDER echo "Replace PLACEHOLDER text"
echo "Replace PLACEHOLDER"
Sometimes, you want to highlight changes in code, for example, lines of code that should be removed or added.
To highlight removed lines in a code snippet, use the
To highlight added lines, use the
.. code-block:: shell :emphasize-removed: 1 :emphasize-added: 2 echo "Hello World" echo "Hello You"
echo "Hello World"
You can also use the built-in
diff language to get a similar effect:
.. code-block:: diff + echo "Hello You" - echo "Hello World"
+ echo "Hello You" - echo "Hello World"
Using this approach, you only highlight the changes. The rest of the lines render as
plain text without syntax highlighting. If you copy the code, the
are copied as well.
To get a fast and relevant search-as-you-type experience, you can use Algolia DocSearch as a replacement for Sphinx’ built-in search. It’s free for open source documentation projects and blogs with technical content.