Skip to content

Commit

Permalink
Add MyST-NB, for rendering Jupyter notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Jan 11, 2025
1 parent 32a82ac commit 7b1e4e7
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ CHANGES

Unreleased
----------
- Added `MyST-NB`_, for rendering Jupyter notebooks

.. _MyST-NB: https://myst-nb.readthedocs.io/

2024/12/13 0.37.2
-----------------
Expand Down
60 changes: 60 additions & 0 deletions docs/myst/cell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
# https://myst-parser.readthedocs.io/en/latest/syntax/tables.html#csv-tables
# https://myst-nb.readthedocs.io/en/v0.13.2/use/formatting_outputs.html#stdout-and-stderr
jupytext:
text_representation:
extension: .md
format_name: myst
format_version: '0.8'
jupytext_version: 1.4.2
kernelspec:
display_name: Python 3
language: python
name: python3
---

# Cells

Widget elements that are like "editors with output".

## Sphinx native

:::{code} sql
SELECT * FROM sometable
:::
:::{csv-table}
:header: >
: "schema_name", "table_name", "sum(num_docs)"
:widths: 15, 10, 30

"doc", "taxi_january", 5929248
"doc", "taxi_january_bestcompresion", 5929248
"doc", "taxi_january_nocolumnstore_bestcompression", 5929248
"doc", "taxi_january_nocolumnstore_noindex_bestcompresion", 5929248
"doc", "taxi_january_noindex_bestcompression", 5929248
"doc", "taxi_january_nocolumnstore", 5929248
:::


:::{code} bash
antrl4
:::
:::{code} text
Downloading antlr4-4.13.2-complete.jar
ANTLR tool needs Java to run; install Java JRE 11 yes/no (default yes)? yes
Installed Java in /root/.jre/jdk-11.0.24+8-jre; remove that dir to uninstall
ANTLR Parser Generator Version 4.13.2
:::

## IPython

Using [MyST-NB].

```{code-cell} ipython3
import sys
print("this is some stdout")
print("this is some stderr", file=sys.stderr)
```


[MyST-NB]: https://myst-nb.readthedocs.io/
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
install_requires=[
"furo==2024.8.6",
"jinja2>=3,<4",
"myst-nb<1.2",
"myst-parser[linkify]<5",
"sphinx>=7.1,<9",
"sphinx-basic-ng==1.0.0b2",
Expand Down
2 changes: 1 addition & 1 deletion src/crate/theme/rtd/conf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
exclude_trees = ["pyenv", "tmp", "out", "parts", "clients", "eggs"]

extensions = [
"myst_parser",
"myst_nb",
"sphinx_copybutton",
"sphinx_design",
"sphinx_design_elements",
Expand Down

0 comments on commit 7b1e4e7

Please sign in to comment.