\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": [
"## Github Flavored Markdown"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The Notebook webapp support Github flavored markdown meaning that you can use triple backticks for code blocks \n",
"\n",
"```python\n",
"print(\"Hello World\")\n",
"```\n",
"\n",
"```javascript\n",
"console.log(\"Hello World\")\n",
"```\n",
"
\n",
"\n",
"Gives \n",
"```python\n",
"print(\"Hello World\")\n",
"```\n",
"\n",
"```javascript\n",
"console.log(\"Hello World\")\n",
"```\n",
"\n",
"And a table like this : \n",
"\n",
"\n",
"| This | is |\n",
"|------|------|\n",
"| a | table| \n",
"
\n",
"\n",
"A nice Html Table\n",
"\n",
"| This | is |\n",
"|------|------|\n",
"| a | table| "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Local files"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"animation.m4v\n",
"python-logo.svg\n"
]
}
],
"source": [
"!ls *svg *m4v"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"If you have local files in your Notebook directory, you can refer to these files in Markdown cells via relative URLs that are prefixed with `files/`:\n",
"\n",
" files/[subdirectory/]\n",
"\n",
"Note that it is **not** `/files`.\n",
"\n",
"For example, in the `figs` subdirectory, we have the Python logo:\n",
"\n",
"![img](files/python-logo.svg)\n",
"\n",
"and a video with the HTML5 video tag:\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": [
"### Exercise"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Download a photo from the web into the local directory, and display it in the notebook by using the files URL pattern explained above"
]
},
{
"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": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.11"
},
"widgets": {
"state": {},
"version": "1.1.1"
}
},
"nbformat": 4,
"nbformat_minor": 1
}