Skip to content

Commit 68e6376

Browse files
Updated files with 'repo_helper'. (#73)
Co-authored-by: repo-helper[bot] <74742576+repo-helper[bot]@users.noreply.github.com>
1 parent 2be6cac commit 68e6376

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

doc-source/conf.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,28 @@
7373
}
7474

7575

76+
# Fix for pathlib issue with sphinxemoji on Python 3.9 and Sphinx 4.x
77+
def copy_asset_files(app, exc):
78+
# 3rd party
79+
from domdf_python_tools.compat import importlib_resources
80+
from sphinx.util.fileutil import copy_asset
81+
82+
if exc:
83+
return
84+
85+
asset_files = ["twemoji.js", "twemoji.css"]
86+
for path in asset_files:
87+
path_str = os.fspath(importlib_resources.files("sphinxemoji") / path)
88+
copy_asset(path_str, os.path.join(app.outdir, "_static"))
89+
90+
7691
def setup(app):
7792
# 3rd party
7893
from sphinx_toolbox.latex import better_header_layout
7994
from sphinxemoji import sphinxemoji
8095

8196
app.connect("config-inited", lambda app, config: better_header_layout(config))
82-
app.connect("build-finished", sphinxemoji.copy_asset_files)
97+
app.connect("build-finished", copy_asset_files)
8398
app.add_js_file("https://unpkg.com/twemoji@latest/dist/twemoji.min.js")
8499
app.add_js_file("twemoji.js")
85100
app.add_css_file("twemoji.css")

doc-source/requirements.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ sphinx-prompt>=1.1.0
1313
sphinx-pyproject>=0.1.0
1414
sphinx-tabs>=1.1.13
1515
sphinx-toolbox>=3.5.0
16+
sphinxcontrib-applehelp==1.0.4
17+
sphinxcontrib-devhelp==1.0.2
18+
sphinxcontrib-htmlhelp==2.0.1
1619
sphinxcontrib-httpdomain>=1.7.0
20+
sphinxcontrib-jsmath==1.0.1
21+
sphinxcontrib-qthelp==1.0.3
22+
sphinxcontrib-serializinghtml==1.1.5
1723
sphinxemoji>=0.2.0
1824
toctree-plus>=0.6.1

0 commit comments

Comments
 (0)