Skip to content

Commit

Permalink
Update the mirror files
Browse files Browse the repository at this point in the history
Closes #321
  • Loading branch information
mwouts committed Sep 21, 2019
1 parent f2167f1 commit 9b79106
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ After that cell we'll have a code cell

Followed by a raw cell

```
<!-- #raw -->
This is
the content
of the raw cell
```
<!-- #endraw -->

# Part two - cell metadata

Expand All @@ -51,6 +51,6 @@ This is a markdown cell with cell metadata `{"key": "value"}`
"""This is a code cell with metadata `{"tags":["parameters"], ".class":null}`"""
```

```key="value"
<!-- #raw {"key": "value"} -->
This is a raw cell with cell metadata `{"key": "value"}`
```
<!-- #endraw -->
24 changes: 12 additions & 12 deletions tests/notebooks/mirror/ipynb_to_md/The flavors of raw cells.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,26 @@ jupyter:
name: python3
---

```raw_mimetype="text/latex"
<!-- #raw {"raw_mimetype": "text/latex"} -->
$1+1$
```
<!-- #endraw -->

```raw_mimetype="text/restructuredtext"
<!-- #raw {"raw_mimetype": "text/restructuredtext"} -->
:math:`1+1`
```
<!-- #endraw -->

```raw_mimetype="text/html"
<!-- #raw {"raw_mimetype": "text/html"} -->
<b>Bold text<b>
```
<!-- #endraw -->

```raw_mimetype="text/markdown"
<!-- #raw {"raw_mimetype": "text/markdown"} -->
**Bold text**
```
<!-- #endraw -->

```raw_mimetype="text/x-python"
<!-- #raw {"raw_mimetype": "text/x-python"} -->
1 + 1
```
<!-- #endraw -->

```
<!-- #raw -->
Not formatted
```
<!-- #endraw -->
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jupyter:
1+2+3
```

```
<!-- #raw -->
This is a raw cell
```
<!-- #endraw -->

This is a markdown cell
6 changes: 4 additions & 2 deletions tests/notebooks/mirror/md_to_ipynb/jupytext_markdown.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@
]
},
{
"cell_type": "raw",
"cell_type": "markdown",
"metadata": {},
"source": [
"THIS IS A RAW CELL"
"```\n",
"THIS IS A RAW CELL\n",
"```"
]
},
{
Expand Down
95 changes: 95 additions & 0 deletions tests/notebooks/mirror/md_to_ipynb/plain_markdown.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"cells": [
{
"cell_type": "raw",
"metadata": {},
"source": [
"---\n",
"title: A sample document\n",
"---"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This document is a plain Markdown document that was not created from a notebook.\n",
"We use this document to test that inputing a Markdown file into Jupytext, and then converting the\n",
"resulting notebook to a Markdown file using nbconvert, is the identity\n",
"\n",
"Another paragraph\n",
"\n",
"# A header\n",
"\n",
"Indented code\n",
"\n",
" def f(x):\n",
" return 1\n",
"\n",
"\n",
" def h(x):\n",
" return f(x)+2\n",
"\n",
"\n",
"A Python code snippet"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"\"\"\"This code cell starts with ` ```python`\"\"\"\n",
"1 + 1"
]
},
{
"cell_type": "markdown",
"metadata": {
"lines_to_next_cell": 0
},
"source": [
"Code snippet without an explicit language"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"```\n",
"echo 'Hello world'\n",
"```"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Markdown comments\n",
"<!-- #comment -->\n",
"\n",
"VS Code region markers"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This Markdown cell has two consecutive blank lines\n",
"\n",
"\n",
"And continues here"
]
}
],
"metadata": {
"jupytext": {
"cell_metadata_filter": "-all",
"main_language": "python",
"notebook_metadata_filter": "-all"
}
},
"nbformat": 4,
"nbformat_minor": 2
}

0 comments on commit 9b79106

Please sign in to comment.