File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 71
71
}
72
72
73
73
74
+ # Fix for pathlib issue with sphinxemoji on Python 3.9 and Sphinx 4.x
75
+ def copy_asset_files (app , exc ):
76
+ # 3rd party
77
+ from domdf_python_tools .compat import importlib_resources
78
+ from sphinx .util .fileutil import copy_asset
79
+
80
+ if exc :
81
+ return
82
+
83
+ asset_files = ["twemoji.js" , "twemoji.css" ]
84
+ for path in asset_files :
85
+ path_str = os .fspath (importlib_resources .files ("sphinxemoji" ) / path )
86
+ copy_asset (path_str , os .path .join (app .outdir , "_static" ))
87
+
88
+
74
89
def setup (app ):
75
90
# 3rd party
76
91
from sphinx_toolbox .latex import better_header_layout
77
92
from sphinxemoji import sphinxemoji
78
93
79
94
app .connect ("config-inited" , lambda app , config : better_header_layout (config ))
80
- app .connect ("build-finished" , sphinxemoji . copy_asset_files )
95
+ app .connect ("build-finished" , copy_asset_files )
81
96
app .add_js_file ("https://unpkg.com/twemoji@latest/dist/twemoji.min.js" )
82
97
app .add_js_file ("twemoji.js" )
83
98
app .add_css_file ("twemoji.css" )
Original file line number Diff line number Diff line change @@ -13,6 +13,12 @@ sphinx-prompt>=1.1.0
13
13
sphinx-pyproject >= 0.1.0
14
14
sphinx-tabs >= 1.1.13
15
15
sphinx-toolbox >= 3.5.0
16
+ sphinxcontrib-applehelp == 1.0.4
17
+ sphinxcontrib-devhelp == 1.0.2
18
+ sphinxcontrib-htmlhelp == 2.0.1
16
19
sphinxcontrib-httpdomain >= 1.7.0
20
+ sphinxcontrib-jsmath == 1.0.1
21
+ sphinxcontrib-qthelp == 1.0.3
22
+ sphinxcontrib-serializinghtml == 1.1.5
17
23
sphinxemoji >= 0.1.6
18
24
toctree-plus >= 0.6.1
You can’t perform that action at this time.
0 commit comments