Skip to content

Commit e18b555

Browse files
committed
add javascript support
With this we can (for example) include HoloViews, Bohek, or plotly plots in the docs. This is already used in https://adaptive.readthedocs.io
1 parent 449e7da commit e18b555

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

jupyter_sphinx/execute.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,12 @@ def cell_output_to_nodes(cell, data_priority, dir):
432432
text=data,
433433
rawsource=data,
434434
))
435+
elif mime_type == 'application/javascript':
436+
to_add.append(docutils.nodes.raw(
437+
text='<script type="{mime_type}">{data}</script>'
438+
.format(mime_type=mime_type, data=data),
439+
format='html',
440+
))
435441
elif mime_type == WIDGET_VIEW_MIMETYPE:
436442
to_add.append(JupyterWidgetViewNode(data))
437443

@@ -558,6 +564,7 @@ def setup(app):
558564
'jupyter_execute_data_priority',
559565
[
560566
WIDGET_VIEW_MIMETYPE,
567+
'application/javascript',
561568
'text/html',
562569
'image/svg+xml',
563570
'image/png',

0 commit comments

Comments
 (0)