Skip to content

Commit

Permalink
adding requirejs dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
choldgraf committed Apr 11, 2020
1 parent 560c145 commit 4d5dfa4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
6 changes: 5 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'numpydoc',
'recommonmark'
'recommonmark',
'jupyter_sphinx'
]

autosummary_generate = True
Expand Down Expand Up @@ -76,6 +77,9 @@
"doc_path": "docs",
}

jupyter_sphinx_require_url = ''


# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
Expand Down
18 changes: 18 additions & 0 deletions docs/demo/demo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -471,3 +471,21 @@ Download Links
==============

:download:`This long long long long long long long long long long long long long long long download link should be blue, normal weight text with a leading icon, and should wrap white-spaces <static/yi_jing_01_chien.jpg>`

HTML
====

The HTML below shouldn't display, but it uses RequireJS to make sure that all
works as expected.

.. jupyter-execute::

import plotly.express as px
import plotly.io as pio
import plotly.offline as py

pio.renderers.default = "notebook"

df = px.data.iris()
fig = px.scatter(df, x="sepal_width", y="sepal_length", color="species", size="sepal_length")
fig
5 changes: 4 additions & 1 deletion pydata_sphinx_theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="docsearch:language" content="en">

<!-- RequireJS must come before bootstrap or we hit https://stackoverflow.com/questions/15371918/mismatched-anonymous-define-module/23467090#23467090 -->
<!-- So we'll load it here in case any downstream plugins etc use it -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" async></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
{%- endblock %}

{# Silence the sidebar's, relbar's #}
Expand Down

0 comments on commit 4d5dfa4

Please sign in to comment.