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 4
4
import json
5
5
import os
6
6
import posixpath
7
+ import sphinx
7
8
from docutils import nodes
8
9
from docutils .parsers .rst import Directive , directives
9
10
from pkg_resources import resource_filename
@@ -346,7 +347,11 @@ def setup(app):
346
347
if "add_script_file" in dir (app ):
347
348
app .add_script_file (path )
348
349
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 )
350
355
app .connect ("html-page-context" , update_context )
351
356
app .connect ("build-finished" , copy_assets )
352
357
You can’t perform that action at this time.
0 commit comments