]> git.puffer.fish Git - matthieu/frr.git/commitdiff
doc: do not use custom directive on old sphinx
authorQuentin Young <qlyoung@qlyoung.net>
Wed, 26 Jun 2024 22:17:07 +0000 (18:17 -0400)
committerQuentin Young <qlyoung@qlyoung.net>
Thu, 27 Jun 2024 18:48:08 +0000 (14:48 -0400)
Not supported.

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
doc/user/conf.py

index a36d4406f3b8419cce206565fec1b36c935aa67e..395875520d7f6e277603b8349c30c452e77e5653 100644 (file)
@@ -415,9 +415,14 @@ class ClicmdDirective(GenericObject):
 
 
 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):