mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 12:04:39 +08:00
Switch to fish_indent based syntax highlighting in sphinx docs
This commit is contained in:
parent
93cc99d6d0
commit
e85cb25883
|
@ -1,4 +1,4 @@
|
|||
.. highlight:: fish
|
||||
.. highlight:: fish-docs-samples
|
||||
|
||||
Commands
|
||||
============
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.. highlight:: fish
|
||||
.. highlight:: fish-docs-samples
|
||||
.. _intro:
|
||||
|
||||
Introduction
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.. highlight:: fish
|
||||
.. highlight:: fish-docs-samples
|
||||
|
||||
Tutorial
|
||||
========
|
||||
|
|
Loading…
Reference in New Issue
Block a user