mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 13:39:02 +00:00
Switch to fish_indent based syntax highlighting in sphinx docs
This commit is contained in:
parent
93cc99d6d0
commit
e85cb25883
4 changed files with 14 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
||||||
.. highlight:: fish
|
.. highlight:: fish-docs-samples
|
||||||
|
|
||||||
Commands
|
Commands
|
||||||
============
|
============
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
import glob
|
import glob
|
||||||
import os.path
|
import os.path
|
||||||
|
import pygments
|
||||||
|
|
||||||
# -- Helper functions --------------------------------------------------------
|
# -- Helper functions --------------------------------------------------------
|
||||||
|
|
||||||
|
@ -15,6 +16,16 @@ def strip_ext(path):
|
||||||
""" Remove the extension from a path. """
|
""" Remove the extension from a path. """
|
||||||
return os.path.splitext(path)[0]
|
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 --------------------------------------------------------------
|
# -- Path setup --------------------------------------------------------------
|
||||||
|
|
||||||
# If extensions (or modules to document with autodoc) are in another directory,
|
# If extensions (or modules to document with autodoc) are in another directory,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
.. highlight:: fish
|
.. highlight:: fish-docs-samples
|
||||||
.. _intro:
|
.. _intro:
|
||||||
|
|
||||||
Introduction
|
Introduction
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
.. highlight:: fish
|
.. highlight:: fish-docs-samples
|
||||||
|
|
||||||
Tutorial
|
Tutorial
|
||||||
========
|
========
|
||||||
|
|
Loading…
Reference in a new issue