Merge pull request #8789 from FRRouting/doctest

doc: bump sphinx version to 4.0.2, remove deprecated API
This commit is contained in:
Donatas Abraitis 2021-06-07 17:19:07 +03:00 committed by GitHub
commit b00436316e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 11 deletions

View File

@ -395,8 +395,11 @@ def setup(app):
# printfrr extensions
app.add_object_type("frrfmt", "frrfmt", parse_node=parse_frrfmt)
# css overrides for HTML theme
app.add_stylesheet("overrides.css")
if "add_css_file" in dir(app):
app.add_css_file("overrides.css")
else:
app.add_stylesheet("overrides.css")
# load Pygments lexer for FRR config syntax
#
# NB: in Pygments 2.2+ this can be done with `load_lexer_from_file`, but we

1
doc/requirements.txt Normal file
View File

@ -0,0 +1 @@
sphinx==4.0.2

View File

@ -386,16 +386,17 @@ def setup(app):
# node later on
app.add_object_type("clicmd", "clicmd", indextemplate="pair: %s; configuration command")
# css overrides for HTML theme
# Note sphinx version differences
sver = vparse(sphinx.__version__)
if sver < vparse("1.8.0"):
app.add_stylesheet("overrides.css")
app.add_javascript("overrides.js")
else:
app.add_css_file("overrides.css")
# I dont care how stupid this is
if "add_js_file" in dir(app):
app.add_js_file("overrides.js")
else:
app.add_javascript("overrides.js")
if "add_css_file" in dir(app):
app.add_css_file("overrides.css")
else:
app.add_stylesheet("overrides.css")
# load Pygments lexer for FRR config syntax
#