File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 1+ coverage :
2+ status :
3+ project :
4+ default :
5+ threshold : 0.5%
Original file line number Diff line number Diff line change 44import json
55import os
66import posixpath
7+ import sphinx
78from docutils import nodes
89from docutils .parsers .rst import Directive , directives
910from pkg_resources import resource_filename
@@ -346,7 +347,11 @@ def setup(app):
346347 if "add_script_file" in dir (app ):
347348 app .add_script_file (path )
348349 else :
349- app .add_javascript (path )
350+ # check sphinx version for backward compatibility
351+ if sphinx .version_info >= (3 , 0 ):
352+ app .add_js_file (path )
353+ else :
354+ app .add_javascript (path )
350355 app .connect ("html-page-context" , update_context )
351356 app .connect ("build-finished" , copy_assets )
352357
You canβt perform that action at this time.
0 commit comments