Commit fe35901b authored by Holger Dinkel's avatar Holger Dinkel

add Pygments style to format code-blocks

parent bb2b1129
No preview for this file type
......@@ -39,5 +39,32 @@ ToDos:
- Better control of verbatim code-blocks:
- distinguish user input from output (boldface?)
- syntax highlight
syntax highlight styling
^^^^^^^^^^^^^^^^^^^^^^^^
To change the formatting of verbatim code blocks (which are highlighted using Pygments), you can create a style file and reference this
in 'conf.py':
::
pygments_style = 'lsi.lsiClass'
This is the content of the file lsi.py:
::
from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, Number, Operator, Generic
class lsiClass(Style):
default_style = "sphinx"
styles = {
Comment: 'bold #800',
Keyword: 'bold #005',
Name: '#f00',
Name.Function: '#0f0',
Name.Class: 'bold #0f0',
String: 'bg:#eee #111'
}
For details, see the `Pygments Docu <http://pygments.org/docs/styles/>`_
......@@ -82,7 +82,11 @@ exclude_patterns = ['_build']
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
#pygments_style = 'sphinx'
#pygments_style = 'murphy'
#pygments_style = 'vim'
pygments_style = 'lsi.lsiClass'
# The default language to highlight source code in. The default is 'python'. The value should be a valid Pygments lexer name, see Showing code examples for more details.
highlight_language = 'bash'
......@@ -250,3 +254,4 @@ texinfo_documents = [
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'http://docs.python.org/': None}
from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, Number, Operator, Generic
class lsiClass(Style):
default_style = "sphinx"
styles = {
Comment: 'bold #800',
Keyword: 'bold #005',
Name: '#f00',
Name.Function: '#0f0',
Name.Class: 'bold #0f0',
String: 'bg:#eee #111'
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment