How to show terminal/shell code snippets in Sphinx?

Shengjie picture Shengjie · May 6, 2013 · Viewed 18.7k times · Source

Using Sphinx, I know you can show a code snippet by having something like:

.. code-block:: ruby.
  ${your ruby code goes here} 

How can I show a code snippet of terminal or shell commands not related to any languages? I don't care if they are not highlighted properly syntax wise, I just want them show up in the doc as a piece of code other than normal text.

Example

$ ls -lsa . 
$ make file

Answer

Marco Mariani picture Marco Mariani · Dec 28, 2015
.. code-block:: console

is meant for interactive sessions. Bash or sh didn't work for me.

( from http://build-me-the-docs-please.readthedocs.org/en/latest/Using_Sphinx/ShowingCodeExamplesInSphinx.html#pygments-lexers )