Skip to content

Commit

Permalink
update config to see if alternative mime priorities are available
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcky committed Feb 21, 2024
1 parent 6431a99 commit 2a93d4f
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 3 deletions.
37 changes: 37 additions & 0 deletions lectures/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,50 @@ latex:
sphinx:
extra_extensions: [sphinx_multitoc_numbering, sphinxext.rediraffe, sphinx_exercise, sphinx_togglebutton, sphinx.ext.intersphinx, sphinx_proof, sphinx_tojupyter]
config:
suppress_warnings: ["mystnb.unknown_mime_type"]
nb_mime_priority_overrides: [
# HTML
['html', 'application/vnd.plotly.v1+json', 9],
['html', 'application/vnd.jupyter.widget-view+json', 10],
['html', 'application/javascript', 20],
['html', 'text/html', 30],
['html', 'text/latex', 40],
['html', 'image/svg+xml', 50],
['html', 'image/png', 60],
['html', 'image/jpeg', 70],
['html', 'text/markdown', 80],
['html', 'text/plain', 90],
# Jupyter Notebooks
['jupyter', 'application/vnd.plotly.v1+json', 9],
['jupyter', 'application/vnd.jupyter.widget-view+json', 10],
['jupyter', 'application/javascript', 20],
['jupyter', 'text/html', 30],
['jupyter', 'text/latex', 40],
['jupyter', 'image/svg+xml', 50],
['jupyter', 'image/png', 60],
['jupyter', 'image/jpeg', 70],
['jupyter', 'text/markdown', 80],
['jupyter', 'text/plain', 90],
# LaTeX
['latex', 'text/latex', 10],
['latex', 'application/pdf', 20],
['latex', 'image/png', 30],
['latex', 'image/jpeg', 40],
['latex', 'text/markdown', 50],
['latex', 'text/plain', 60],
['latex', 'text/html', 70],
# Link Checker
['linkcheck', 'text/plain', 10],
]
# false-positive links
linkcheck_ignore: ['https://doi.org/https://doi.org/10.2307/1235116']
# myst-nb config
nb_render_image_options:
width: 80%
nb_code_prompt_show: "Show {type}"
# -------------
html_js_files:
- https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js
html_favicon: _static/lectures-favicon.ico
html_theme: quantecon_book_theme
html_static_path: ['_static']
Expand Down
12 changes: 9 additions & 3 deletions lectures/plotly.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ jupytext:
text_representation:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.15.1
kernelspec:
display_name: Python 3
display_name: Python 3 (ipykernel)
language: python
name: python3
---
Expand All @@ -17,9 +19,13 @@ kernelspec:

An example plot

```{code-cell}
```{code-cell} ipython3
# x and y given as array_like objects
import plotly.express as px
fig = px.scatter(x=[0, 1, 2, 3, 4], y=[0, 1, 4, 9, 16])
fig.show()
```
```

```{code-cell} ipython3
```

0 comments on commit 2a93d4f

Please sign in to comment.