Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: bump sphinx version to 4.0.2, remove deprecated API (backport #8789) #9270

Merged
merged 2 commits into from
Aug 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions doc/developer/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't seen this before. I think hasattr(app, "add_css_file") is the more accepted way to do this.

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
Expand Down
1 change: 1 addition & 0 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sphinx==4.0.2
17 changes: 9 additions & 8 deletions doc/user/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
# 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")
app.add_js_file("overrides.js")
else:
app.add_stylesheet("overrides.css")


# load Pygments lexer for FRR config syntax
#
Expand Down