Local Files.ipynb
53 lines
| 1.9 KiB
| text/plain
|
TextLexer
Brian Granger
|
r9191 | { | |
"metadata": { | |||
"name": "Local Files" | |||
}, | |||
"nbformat": 3, | |||
"nbformat_minor": 0, | |||
"worksheets": [ | |||
{ | |||
"cells": [ | |||
{ | |||
"cell_type": "markdown", | |||
"metadata": {}, | |||
"source": [ | |||
"## Local Files\n", | |||
"\n", | |||
"The above examples embed images and video from the notebook filesystem in the output\n", | |||
"areas of code cells. It is also possible to request these files directly in markdown cells\n", | |||
"if they reside in the notebook directory via relative urls prefixed with `files/`:\n", | |||
"\n", | |||
" files/[subdirectory/]<filename>\n", | |||
"\n", | |||
"\n", | |||
"For example, in the example notebook folder, we have the Python logo, addressed as:\n", | |||
"\n", | |||
" <img src=\"files/python-logo.svg\" />\n", | |||
"\n", | |||
"<img src=\"/files/python-logo.svg\" />\n", | |||
"\n", | |||
"and a video with the HTML5 video tag:\n", | |||
"\n", | |||
" <video controls src=\"files/animation.m4v\" />\n", | |||
"\n", | |||
"<video controls src=\"/files/animation.m4v\" />\n", | |||
"\n", | |||
"These do not embed the data into the notebook file,\n", | |||
"and require that the files exist when you are viewing the notebook.\n", | |||
"\n", | |||
"### Security of local files\n", | |||
"\n", | |||
"Note that this means that the IPython 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": {} | |||
} | |||
] | |||
} |