From 32e5fa0c03ebc850a6b8aa80779a899b98b103a5 Mon Sep 17 00:00:00 2001 From: Daniel Rainer Date: Tue, 19 Aug 2025 00:05:33 +0200 Subject: [PATCH] Stop depending on `fish_indent` for man pages This allows building man pages without having `fish_indent` available, which is useful because building man pages can happen during compilation of the fish binaries, including `fish_indent`, resulting in an annoying cyclic dependency. This change does not affect the generated man pages, at least with the current config. --- doc_src/conf.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/doc_src/conf.py b/doc_src/conf.py index 8f5a684a1..82f9cd093 100644 --- a/doc_src/conf.py +++ b/doc_src/conf.py @@ -10,6 +10,7 @@ import glob import os.path import subprocess import sys +from sphinx.highlighting import lexers from sphinx.errors import SphinxWarning from docutils import nodes @@ -35,11 +36,14 @@ def issue_role(name, rawtext, text, lineno, inliner, options=None, content=None) return [link], [] +def do_not_use_fish_indent_for_man(app): + if app.builder.name == "man": + del lexers["fish-docs-samples"] + + # -- Load our extensions ------------------------------------------------- def setup(app): # Our own pygments lexers - from sphinx.highlighting import lexers - this_dir = os.path.dirname(os.path.realpath(__file__)) sys.path.insert(0, this_dir) from fish_indent_lexer import FishIndentLexer @@ -52,6 +56,8 @@ def setup(app): app.add_config_value("issue_url", default=None, rebuild="html") app.add_role("issue", issue_role) + app.connect("builder-inited", do_not_use_fish_indent_for_man) + # The default language to assume highlight_language = "fish-docs-samples"