Skip to content

Commit

Permalink
Testing raw cells with various mimetypes
Browse files Browse the repository at this point in the history
  • Loading branch information
mwouts committed Apr 3, 2019
1 parent 1a4a867 commit 5d68f5a
Show file tree
Hide file tree
Showing 8 changed files with 281 additions and 0 deletions.
78 changes: 78 additions & 0 deletions tests/notebooks/ipynb_py/The flavors of raw cells.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"cells": [
{
"cell_type": "raw",
"metadata": {
"raw_mimetype": "text/latex"
},
"source": [
"$1+1$"
]
},
{
"cell_type": "raw",
"metadata": {
"raw_mimetype": "text/restructuredtext"
},
"source": [
":math:`1+1`"
]
},
{
"cell_type": "raw",
"metadata": {
"raw_mimetype": "text/html"
},
"source": [
"<b>Bold text<b>"
]
},
{
"cell_type": "raw",
"metadata": {
"raw_mimetype": "text/markdown"
},
"source": [
"**Bold text**"
]
},
{
"cell_type": "raw",
"metadata": {
"raw_mimetype": "text/x-python"
},
"source": [
"1 + 1"
]
},
{
"cell_type": "raw",
"metadata": {},
"source": [
"Not formatted"
]
}
],
"metadata": {
"celltoolbar": "Format de la Cellule Texte Brut",
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
31 changes: 31 additions & 0 deletions tests/notebooks/mirror/ipynb_to_Rmd/The flavors of raw cells.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
jupyter:
kernelspec:
display_name: Python 3
language: python
name: python3
---

```{python raw_mimetype=text/latex, active="", eval=FALSE}
$1+1$
```

```{python raw_mimetype=text/restructuredtext, active="", eval=FALSE}
:math:`1+1`
```

```{python raw_mimetype=text/html, active="", eval=FALSE}
<b>Bold text<b>
```

```{python raw_mimetype=text/markdown, active="", eval=FALSE}
**Bold text**
```

```{python raw_mimetype=text/x-python, active="", eval=FALSE}
1 + 1
```

```{python active="", eval=FALSE}
Not formatted
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# ---
# jupyter:
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---

# %% [raw] {"raw_mimetype": "text/latex"}
# $1+1$

# %% [raw] {"raw_mimetype": "text/restructuredtext"}
# :math:`1+1`

# %% [raw] {"raw_mimetype": "text/html"}
# <b>Bold text<b>

# %% [raw] {"raw_mimetype": "text/markdown"}
# **Bold text**

# %% [raw] {"raw_mimetype": "text/x-python"}
# 1 + 1

# %% [raw]
# Not formatted
31 changes: 31 additions & 0 deletions tests/notebooks/mirror/ipynb_to_md/The flavors of raw cells.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
jupyter:
kernelspec:
display_name: Python 3
language: python
name: python3
---

```raw_mimetype="text/latex"
$1+1$
```

```raw_mimetype="text/restructuredtext"
:math:`1+1`
```

```raw_mimetype="text/html"
<b>Bold text<b>
```

```raw_mimetype="text/markdown"
**Bold text**
```

```raw_mimetype="text/x-python"
1 + 1
```

```
Not formatted
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# ---
# jupyter:
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---

# %% [raw] {"raw_mimetype": "text/latex"}
# $1+1$

# %% [raw] {"raw_mimetype": "text/restructuredtext"}
# :math:`1+1`

# %% [raw] {"raw_mimetype": "text/html"}
# <b>Bold text<b>

# %% [raw] {"raw_mimetype": "text/markdown"}
# **Bold text**

# %% [raw] {"raw_mimetype": "text/x-python"}
# 1 + 1

# %% [raw]
# Not formatted
25 changes: 25 additions & 0 deletions tests/notebooks/mirror/ipynb_to_script/The flavors of raw cells.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# ---
# jupyter:
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---

# + {"raw_mimetype": "text/latex", "active": ""}
# $1+1$

# + {"raw_mimetype": "text/restructuredtext", "active": ""}
# :math:`1+1`

# + {"raw_mimetype": "text/html", "active": ""}
# <b>Bold text<b>

# + {"raw_mimetype": "text/markdown", "active": ""}
# **Bold text**

# + {"raw_mimetype": "text/x-python", "active": ""}
# 1 + 1

# + {"active": ""}
# Not formatted
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# ---
# jupyter:
# jupytext:
# cell_markers: '{{{,}}}'
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---

# {{{ {"raw_mimetype": "text/latex", "active": ""}
# $1+1$
# }}}

# {{{ {"raw_mimetype": "text/restructuredtext", "active": ""}
# :math:`1+1`
# }}}

# {{{ {"raw_mimetype": "text/html", "active": ""}
# <b>Bold text<b>
# }}}

# {{{ {"raw_mimetype": "text/markdown", "active": ""}
# **Bold text**
# }}}

# {{{ {"raw_mimetype": "text/x-python", "active": ""}
# 1 + 1
# }}}

# {{{ {"active": ""}
# Not formatted
# }}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# ---
# jupyter:
# jupytext:
# cell_markers: region,endregion
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---

# region {"raw_mimetype": "text/latex", "active": ""}
# $1+1$
# endregion

# region {"raw_mimetype": "text/restructuredtext", "active": ""}
# :math:`1+1`
# endregion

# region {"raw_mimetype": "text/html", "active": ""}
# <b>Bold text<b>
# endregion

# region {"raw_mimetype": "text/markdown", "active": ""}
# **Bold text**
# endregion

# region {"raw_mimetype": "text/x-python", "active": ""}
# 1 + 1
# endregion

# region {"active": ""}
# Not formatted
# endregion

0 comments on commit 5d68f5a

Please sign in to comment.