Skip to content

Commit

Permalink
Additional notebook for testing the Markdown format
Browse files Browse the repository at this point in the history
  • Loading branch information
mwouts committed Mar 24, 2019
1 parent 6d7a554 commit 62c5ad6
Show file tree
Hide file tree
Showing 9 changed files with 473 additions and 6 deletions.
146 changes: 146 additions & 0 deletions tests/notebooks/ipynb_py/Notebook with metadata and long cells.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Part one - various cells"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Here we have a markdown cell\n",
"\n",
"\n",
"with two blank lines"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now we have a markdown cell\n",
"with a code block inside it\n",
"\n",
"```python\n",
"1 + 1\n",
"```\n",
"\n",
"After that cell we'll have a code cell"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"6"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"2 + 2\n",
"\n",
"\n",
"3 + 3"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Followed by a raw cell"
]
},
{
"cell_type": "raw",
"metadata": {},
"source": [
"This is \n",
"the content\n",
"of the raw cell"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Part two - cell metadata"
]
},
{
"cell_type": "markdown",
"metadata": {
"key": "value"
},
"source": [
"This is a markdown cell with cell metadata `{\"key\": \"value\"}`"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
".class": null,
"tags": [
"parameters"
]
},
"outputs": [
{
"data": {
"text/plain": [
"'This is a code cell with metadata `{\"tags\":[\"parameters\"], \".class\":null}`'"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"\"\"\"This is a code cell with metadata `{\"tags\":[\"parameters\"], \".class\":null}`\"\"\""
]
},
{
"cell_type": "raw",
"metadata": {
"key": "value"
},
"source": [
"This is a raw cell with cell metadata `{\"key\": \"value\"}`"
]
}
],
"metadata": {
"celltoolbar": "Edit Metadata",
"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.6.6"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
jupyter:
kernelspec:
display_name: Python 3
language: python
name: python3
---

# Part one - various cells

[region]: #
Here we have a markdown cell


with two blank lines

[endregion]: #

Now we have a markdown cell
with a code block inside it

```python
1 + 1
```

After that cell we'll have a code cell

```{python}
2 + 2
3 + 3
```

Followed by a raw cell

```{python active="", eval=FALSE}
This is
the content
of the raw cell
```

# Part two - cell metadata

[region {"key": "value"}]: #
This is a markdown cell with cell metadata `{"key": "value"}`

[endregion]: #

```{python .class=None, tags=c("parameters")}
"""This is a code cell with metadata `{"tags":["parameters"], ".class":null}`"""
```

```{python key=value, active="", eval=FALSE}
This is a raw cell with cell metadata `{"key": "value"}`
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# ---
# jupyter:
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---

# %% [markdown]
# # Part one - various cells

# %% [markdown]
# Here we have a markdown cell
#
#
# with two blank lines

# %% [markdown]
# Now we have a markdown cell
# with a code block inside it
#
# ```python
# 1 + 1
# ```
#
# After that cell we'll have a code cell

# %%
2 + 2


3 + 3

# %% [markdown]
# Followed by a raw cell

# %% [raw]
# This is
# the content
# of the raw cell

# %% [markdown]
# # Part two - cell metadata

# %% [markdown] {"key": "value"}
# This is a markdown cell with cell metadata `{"key": "value"}`

# %% {".class": null, "tags": ["parameters"]}
"""This is a code cell with metadata `{"tags":["parameters"], ".class":null}`"""

# %% [raw] {"key": "value"}
# This is a raw cell with cell metadata `{"key": "value"}`
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
jupyter:
kernelspec:
display_name: Python 3
language: python
name: python3
---

# Part one - various cells

[region]: #
Here we have a markdown cell


with two blank lines

[endregion]: #

[region]: #
Now we have a markdown cell
with a code block inside it

```python
1 + 1
```

After that cell we'll have a code cell

[endregion]: #

```python
2 + 2


3 + 3
```

Followed by a raw cell

```
This is
the content
of the raw cell
```

# Part two - cell metadata

[region {"key": "value"}]: #
This is a markdown cell with cell metadata `{"key": "value"}`

[endregion]: #

```python .class tags=["parameters"]
"""This is a code cell with metadata `{"tags":["parameters"], ".class":null}`"""
```

```key="value"
This is a raw cell with cell metadata `{"key": "value"}`
```
6 changes: 6 additions & 0 deletions tests/notebooks/mirror/ipynb_to_md/sample_rise_notebook_66.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ jupyter:
name: python3
---

[region {"slideshow": {"slide_type": "slide"}}]: #
A markdown cell

[endregion]: #

```python slideshow={"slide_type": ""}
1+1
```

[region {"cell_style": "center", "slideshow": {"slide_type": "fragment"}}]: #
Markdown cell two

[endregion]: #
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# ---
# jupyter:
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---

# %% [markdown]
# # Part one - various cells

# %% [markdown]
# Here we have a markdown cell
#
#
# with two blank lines

# %% [markdown]
# Now we have a markdown cell
# with a code block inside it
#
# ```python
# 1 + 1
# ```
#
# After that cell we'll have a code cell

# %%
2 + 2


3 + 3

# %% [markdown]
# Followed by a raw cell

# %% [raw]
# This is
# the content
# of the raw cell

# %% [markdown]
# # Part two - cell metadata

# %% [markdown] {"key": "value"}
# This is a markdown cell with cell metadata `{"key": "value"}`

# %% {".class": null, "tags": ["parameters"]}
"""This is a code cell with metadata `{"tags":["parameters"], ".class":null}`"""

# %% [raw] {"key": "value"}
# This is a raw cell with cell metadata `{"key": "value"}`
Loading

0 comments on commit 62c5ad6

Please sign in to comment.