diff --git a/sphinx_doc_src/commands.rst b/sphinx_doc_src/commands.rst index f95eef343..f2cd1c283 100644 --- a/sphinx_doc_src/commands.rst +++ b/sphinx_doc_src/commands.rst @@ -1,4 +1,4 @@ -.. highlight:: fish +.. highlight:: fish-docs-samples Commands ============ diff --git a/sphinx_doc_src/conf.py b/sphinx_doc_src/conf.py index edf1b4a29..3c93e87f1 100644 --- a/sphinx_doc_src/conf.py +++ b/sphinx_doc_src/conf.py @@ -8,6 +8,7 @@ import glob import os.path +import pygments # -- Helper functions -------------------------------------------------------- @@ -15,6 +16,16 @@ def strip_ext(path): """ Remove the extension from a path. """ return os.path.splitext(path)[0] +# -- Load our Pygments lexer ------------------------------------------------- +def setup(app): + from sphinx.highlighting import lexers + this_dir = os.path.dirname(os.path.realpath(__file__)) + fish_indent_lexer = pygments.lexers.load_lexer_from_file( + os.path.join(this_dir, 'fish_indent_lexer.py'), + lexername='FishIndentLexer') + lexers['fish-docs-samples'] = fish_indent_lexer + + # -- Path setup -------------------------------------------------------------- # If extensions (or modules to document with autodoc) are in another directory, diff --git a/sphinx_doc_src/index.rst b/sphinx_doc_src/index.rst index a7d5db46d..42a959c7c 100644 --- a/sphinx_doc_src/index.rst +++ b/sphinx_doc_src/index.rst @@ -1,4 +1,4 @@ -.. highlight:: fish +.. highlight:: fish-docs-samples .. _intro: Introduction diff --git a/sphinx_doc_src/tutorial.rst b/sphinx_doc_src/tutorial.rst index 89009ddb5..84697b03b 100644 --- a/sphinx_doc_src/tutorial.rst +++ b/sphinx_doc_src/tutorial.rst @@ -1,4 +1,4 @@ -.. highlight:: fish +.. highlight:: fish-docs-samples Tutorial ========