Switch to fish_indent based syntax highlighting in sphinx docs

This commit is contained in:
ridiculousfish 2019-03-14 13:52:25 -07:00
parent 93cc99d6d0
commit e85cb25883
4 changed files with 14 additions and 3 deletions

View File

@ -1,4 +1,4 @@
.. highlight:: fish
.. highlight:: fish-docs-samples
Commands
============

View File

@ -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,

View File

@ -1,4 +1,4 @@
.. highlight:: fish
.. highlight:: fish-docs-samples
.. _intro:
Introduction

View File

@ -1,4 +1,4 @@
.. highlight:: fish
.. highlight:: fish-docs-samples
Tutorial
========