{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Markdown Cells"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Text can be added to Jupyter Notebooks using Markdown cells. You can change the cell type to Markdown by using the `Cell` menu, the toolbar, or the key shortcut `m`. Markdown is a popular markup language that is a superset of HTML. Its specification can be found here:\n",
"\n",
""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Markdown basics"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You can make text *italic* or **bold** by surrounding a block of text with a single or double * respectively"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You can build nested itemized or enumerated lists:\n",
"\n",
"* One\n",
" - Sublist\n",
" - This\n",
" - Sublist\n",
" - That\n",
" - The other thing\n",
"* Two\n",
" - Sublist\n",
"* Three\n",
" - Sublist\n",
"\n",
"Now another list:\n",
"\n",
"1. Here we go\n",
" 1. Sublist\n",
" 2. Sublist\n",
"2. There we go\n",
"3. Now this"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You can add horizontal rules:\n",
"\n",
"---"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Here is a blockquote:\n",
"\n",
"> Beautiful is better than ugly.\n",
"> Explicit is better than implicit.\n",
"> Simple is better than complex.\n",
"> Complex is better than complicated.\n",
"> Flat is better than nested.\n",
"> Sparse is better than dense.\n",
"> Readability counts.\n",
"> Special cases aren't special enough to break the rules.\n",
"> Although practicality beats purity.\n",
"> Errors should never pass silently.\n",
"> Unless explicitly silenced.\n",
"> In the face of ambiguity, refuse the temptation to guess.\n",
"> There should be one-- and preferably only one --obvious way to do it.\n",
"> Although that way may not be obvious at first unless you're Dutch.\n",
"> Now is better than never.\n",
"> Although never is often better than *right* now.\n",
"> If the implementation is hard to explain, it's a bad idea.\n",
"> If the implementation is easy to explain, it may be a good idea.\n",
"> Namespaces are one honking great idea -- let's do more of those!"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"And shorthand for links:\n",
"\n",
"[Jupyter's website](https://jupyter.org)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You can use backslash \\ to generate literal characters which would otherwise have special meaning in the Markdown syntax.\n",
"\n",
"```\n",
"\\*literal asterisks\\*\n",
" *literal asterisks*\n",
"```\n",
"\n",
"Use double backslash \\ \\ to generate the literal $ symbol."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Headings"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You can add headings by starting a line with one (or multiple) `#` followed by a space, as in the following example:\n",
"\n",
"```\n",
"# Heading 1\n",
"# Heading 2\n",
"## Heading 2.1\n",
"## Heading 2.2\n",
"```"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Embedded code"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You can embed code meant for illustration instead of execution in Python:\n",
"\n",
" def f(x):\n",
" \"\"\"a docstring\"\"\"\n",
" return x**2\n",
"\n",
"or other languages:\n",
"\n",
" if (i=0; i\n",
"\n",
"Header 1 | \n",
"Header 2 | \n",
"
\n",
"\n",
"row 1, cell 1 | \n",
"row 1, cell 2 | \n",
"
\n",
"\n",
"row 2, cell 1 | \n",
"row 2, cell 2 | \n",
"
\n",
""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Local files"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"If you have local files in your Notebook directory, you can refer to these files in Markdown cells directly:\n",
"\n",
" [subdirectory/]\n",
"\n",
"For example, in the images folder, we have the Python logo:\n",
"\n",
" \n",
"\n",
"\n",
"\n",
"and a video with the HTML5 video tag:\n",
"\n",
" \n",
"\n",
"\n",
"\n",
"These do not embed the data into the notebook file, and require that the files exist when you are viewing the notebook."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Security of local files"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Note that this means that the Jupyter notebook server also acts as a generic file server\n",
"for files inside the same tree as your notebooks. Access is not granted outside the\n",
"notebook folder so you have strict control over what files are visible, but for this\n",
"reason it is highly recommended that you do not run the notebook server with a notebook\n",
"directory at a high level in your filesystem (e.g. your home directory).\n",
"\n",
"When you run the notebook in a password-protected manner, local file access is restricted\n",
"to authenticated users unless read-only views are active."
]
}
],
"metadata": {
"anaconda-cloud": {},
"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.2"
}
},
"nbformat": 4,
"nbformat_minor": 1
}