Skip to content

Commit c27b586

Browse files
committed
moved css copying to build_finished and addition to builder_initiated
1 parent b0e6c90 commit c27b586

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

jupyter_sphinx/execute.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,14 @@ def builder_inited(app):
5555
if embed_url:
5656
app.add_js_file(embed_url)
5757

58+
# add jupyter-sphinx css
59+
app.add_css_file('jupyter-sphinx.css')
5860
# Check if a thebelab config was specified
5961
if app.config.jupyter_sphinx_thebelab_config:
6062
app.add_js_file('thebelab-helper.js')
6163
app.add_css_file('thebelab.css')
6264

65+
6366
### Directives and their associated doctree nodes
6467

6568
class JupyterKernel(Directive):
@@ -766,6 +769,11 @@ def build_finished(app, env):
766769
if app.builder.format != 'html':
767770
return
768771

772+
# Copy stylesheet
773+
src = os.path.join(os.path.dirname(__file__), 'css')
774+
dst = os.path.join(app.outdir, '_static')
775+
copy_asset(src, dst)
776+
769777
thebe_config = app.config.jupyter_sphinx_thebelab_config
770778
if not thebe_config:
771779
return
@@ -778,11 +786,6 @@ def build_finished(app, env):
778786

779787
def setup(app):
780788
# Configuration
781-
# Copy stylesheet
782-
src = os.path.join(os.path.dirname(__file__), 'css')
783-
dst = os.path.join(app.outdir, '_static')
784-
copy_asset(src, dst)
785-
app.add_css_file('jupyter-sphinx.css')
786789

787790
app.add_config_value(
788791
'jupyter_execute_kwargs',

0 commit comments

Comments
 (0)