diff --git a/tests/notebooks/mirror/ipynb_to_md/Notebook with metadata and long cells.md b/tests/notebooks/mirror/ipynb_to_md/Notebook with metadata and long cells.md index de273fc00..73325a3fa 100644 --- a/tests/notebooks/mirror/ipynb_to_md/Notebook with metadata and long cells.md +++ b/tests/notebooks/mirror/ipynb_to_md/Notebook with metadata and long cells.md @@ -35,11 +35,11 @@ After that cell we'll have a code cell Followed by a raw cell -``` + This is the content of the raw cell -``` + # Part two - cell metadata @@ -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" + This is a raw cell with cell metadata `{"key": "value"}` -``` + diff --git a/tests/notebooks/mirror/ipynb_to_md/The flavors of raw cells.md b/tests/notebooks/mirror/ipynb_to_md/The flavors of raw cells.md index 137aa8ce4..a22bad50c 100644 --- a/tests/notebooks/mirror/ipynb_to_md/The flavors of raw cells.md +++ b/tests/notebooks/mirror/ipynb_to_md/The flavors of raw cells.md @@ -6,26 +6,26 @@ jupyter: name: python3 --- -```raw_mimetype="text/latex" + $1+1$ -``` + -```raw_mimetype="text/restructuredtext" + :math:`1+1` -``` + -```raw_mimetype="text/html" + Bold text -``` + -```raw_mimetype="text/markdown" + **Bold text** -``` + -```raw_mimetype="text/x-python" + 1 + 1 -``` + -``` + Not formatted -``` + diff --git a/tests/notebooks/mirror/ipynb_to_md/jupyter_with_raw_cell_in_body.md b/tests/notebooks/mirror/ipynb_to_md/jupyter_with_raw_cell_in_body.md index 1f3953bbd..f829ab214 100644 --- a/tests/notebooks/mirror/ipynb_to_md/jupyter_with_raw_cell_in_body.md +++ b/tests/notebooks/mirror/ipynb_to_md/jupyter_with_raw_cell_in_body.md @@ -10,8 +10,8 @@ jupyter: 1+2+3 ``` -``` + This is a raw cell -``` + This is a markdown cell diff --git a/tests/notebooks/mirror/md_to_ipynb/jupytext_markdown.ipynb b/tests/notebooks/mirror/md_to_ipynb/jupytext_markdown.ipynb index a73c2ad01..329fe9f8a 100644 --- a/tests/notebooks/mirror/md_to_ipynb/jupytext_markdown.ipynb +++ b/tests/notebooks/mirror/md_to_ipynb/jupytext_markdown.ipynb @@ -47,10 +47,12 @@ ] }, { - "cell_type": "raw", + "cell_type": "markdown", "metadata": {}, "source": [ - "THIS IS A RAW CELL" + "```\n", + "THIS IS A RAW CELL\n", + "```" ] }, { diff --git a/tests/notebooks/mirror/md_to_ipynb/plain_markdown.ipynb b/tests/notebooks/mirror/md_to_ipynb/plain_markdown.ipynb new file mode 100644 index 000000000..2ba73714a --- /dev/null +++ b/tests/notebooks/mirror/md_to_ipynb/plain_markdown.ipynb @@ -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", + "\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 +}