Skip to content

Commit

Permalink
doc: do not use custom directive on old sphinx
Browse files Browse the repository at this point in the history
Not supported.

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
  • Loading branch information
qlyoung committed Jun 26, 2024
1 parent 31a66e1 commit 24edd63
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions doc/user/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,13 @@ def run(self):


def setup(app):
app.add_object_type("clicmd", "clicmd", objname="CLI command")
# Override the directive that was just created for us
app.add_directive_to_domain("std", "clicmd", ClicmdDirective, override=True)
if int(sphinx.__version__.split(".")[0]) >= 2:
app.add_object_type("clicmd", "clicmd", objname="CLI command")
app.add_directive_to_domain("std", "clicmd", ClicmdDirective, override=True)
else:
app.add_object_type("clicmd", "clicmd", indextemplate="pair: %s; configuration command")


# I dont care how stupid this is
if "add_js_file" in dir(app):
Expand Down

0 comments on commit 24edd63

Please sign in to comment.