We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c7154ad commit a827fc0Copy full SHA for a827fc0
src/sphinx_codeautolink/__init__.py
@@ -1,6 +1,6 @@
1
"""Sphinx extension for linking code examples to reference documentation."""
2
3
-from pathlib import Path
+from importlib.resources import files
4
from shutil import copyfile
5
6
from sphinx.application import Sphinx
@@ -85,5 +85,6 @@ def setup(app: Sphinx):
85
86
def _copy_styles(app, exc):
87
if app.builder.format == "html" and not exc:
88
- css_file = Path(__file__).parent / "static" / "sphinx-codeautolink.css"
89
- copyfile(css_file, app.outdir / "_static" / "sphinx-codeautolink.css")
+ css_name = "sphinx-codeautolink.css"
+ css_file = files("sphinx_codeautolink.static").joinpath(css_name)
90
+ copyfile(css_file, app.outdir / "_static" / css_name)
0 commit comments