From 24edd63d033224273639aa9fc9b0b5014578f288 Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Wed, 26 Jun 2024 18:17:07 -0400 Subject: [PATCH] doc: do not use custom directive on old sphinx Not supported. Signed-off-by: Quentin Young --- doc/user/conf.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/user/conf.py b/doc/user/conf.py index 574bfd0a4d4e..ef69afc7b427 100644 --- a/doc/user/conf.py +++ b/doc/user/conf.py @@ -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):