Skip to content

Commit 3b8be26

Browse files
committed
Workaround for Ubuntu as usual shipping with insanely outdated packages
Fixes #3160
1 parent 9e95939 commit 3b8be26

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from pygments.token import ( # type: ignore
2525
Comment, Keyword, Literal, Name, Number, String, Whitespace
2626
)
27-
from sphinx import addnodes # type: ignore
27+
from sphinx import addnodes, version_info # type: ignore
2828
from sphinx.environment.adapters.toctree import TocTree # type: ignore
2929
from sphinx.util.logging import getLogger # type: ignore
3030

@@ -555,7 +555,7 @@ def process_shortcut_link(env: Any, refnode: Any, has_explicit_title: bool, titl
555555

556556

557557
def write_conf_docs(app: Any, all_kitten_names: Iterable[str]) -> None:
558-
app.add_lexer('conf', ConfLexer)
558+
app.add_lexer('conf', ConfLexer() if version_info[0] < 3 else ConfLexer)
559559
app.add_object_type(
560560
'opt', 'opt',
561561
indextemplate="pair: %s; Config Setting",
@@ -604,7 +604,7 @@ def setup(app: Any) -> None:
604604
write_cli_docs(kn)
605605
write_remote_control_protocol_docs()
606606
write_conf_docs(app, kn)
607-
app.add_lexer('session', SessionLexer)
607+
app.add_lexer('session', SessionLexer() if version_info[0] < 3 else SessionLexer)
608608
app.add_role('link', link_role)
609609
app.add_role('iss', partial(num_role, 'issues'))
610610
app.add_role('pull', partial(num_role, 'pull'))

0 commit comments

Comments
 (0)