Debian Codegraph @

tests/data/notebooks/outputs/md_to_ipynb/jupytext_markdown.ipynb

raw
1 {
2 "cells": [
3 {
4 "cell_type": "markdown",
5 "metadata": {},
6 "source": [
7 "# Markdown, code and raw cells\n",
8 "\n",
9 "## Markdown cells\n",
10 "\n",
11 "This is a Markdown cell. Markdown cells end with either a code cell, or two consecutive blank lines in the text.\n",
12 "\n",
13 "If you prefer that Markdown headings define new cells, have a look at the `split_at_heading` option.\n",
14 "\n",
15 "Indented code is accepted, and consecutive blank lines there do not break Markdown cells:\n",
16 "\n",
17 " def f(x):\n",
18 " return 1\n",
19 "\n",
20 "\n",
21 " def h(x):\n",
22 " return f(x)+2\n",
23 "\n",
24 "\n",
25 "## Code cells"
26 ]
27 },
28 {
29 "cell_type": "code",
30 "execution_count": null,
31 "metadata": {},
32 "outputs": [],
33 "source": [
34 "\"\"\"This code cell starts with ` ```python`\"\"\"\n",
35 "1 + 1"
36 ]
37 },
38 {
39 "cell_type": "markdown",
40 "metadata": {
41 "lines_to_next_cell": 0
42 },
43 "source": [
44 "## Raw cells\n",
45 "\n",
46 "Raw cells are delimited with `<!-- #raw -->` and <!-- #endraw -->, like here:"
47 ]
48 },
49 {
50 "cell_type": "raw",
51 "metadata": {},
52 "source": [
53 "this is a raw cell"
54 ]
55 },
56 {
57 "cell_type": "markdown",
58 "metadata": {},
59 "source": [
60 "# Protected Markdown cells\n",
61 "\n",
62 "If you want to include code blocks (or two consecutive blank lines) in a Markdown cell, use explicit Markdown cell delimiters `<!-- #region -->` and `<!-- #endregion -->`."
63 ]
64 },
65 {
66 "cell_type": "markdown",
67 "metadata": {},
68 "source": [
69 "This Markdown cell has two consecutive blank lines\n",
70 "\n",
71 "\n",
72 "And then a code block which is not a Jupyter code cell:\n",
73 "```python\n",
74 "2 + 2\n",
75 "```"
76 ]
77 },
78 {
79 "cell_type": "markdown",
80 "metadata": {},
81 "source": [
82 "# Metadata\n",
83 "\n",
84 "Metadata are supported for all cell types.\n",
85 "\n",
86 "## Markdown cells"
87 ]
88 },
89 {
90 "cell_type": "markdown",
91 "metadata": {
92 "key": "value",
93 "title": "Region title"
94 },
95 "source": [
96 "A cell with a title and additional metadata."
97 ]
98 },
99 {
100 "cell_type": "markdown",
101 "metadata": {},
102 "source": [
103 "## Code cells"
104 ]
105 },
106 {
107 "cell_type": "code",
108 "execution_count": null,
109 "metadata": {
110 "tags": [
111 "parameters"
112 ]
113 },
114 "outputs": [],
115 "source": [
116 "a = 2"
117 ]
118 }
119 ],
120 "metadata": {
121 "kernelspec": {
122 "display_name": "Python 3",
123 "language": "python",
124 "name": "python3"
125 }
126 },
127 "nbformat": 4,
128 "nbformat_minor": 2
129 }