2015-06-02 04:06:33 +08:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
2015-06-03 07:42:54 +08:00
|
|
|
import os
|
2015-06-03 06:35:01 +08:00
|
|
|
from notebook.notebookapp import NotebookApp
|
2015-06-02 04:06:33 +08:00
|
|
|
|
|
|
|
header = """\
|
|
|
|
.. _config:
|
|
|
|
|
2015-09-23 00:32:11 +08:00
|
|
|
|
|
|
|
Config file and command line options
|
|
|
|
====================================
|
2015-06-02 04:06:33 +08:00
|
|
|
|
|
|
|
The notebook server can be run with a variety of command line arguments.
|
|
|
|
A list of available options can be found below in the :ref:`options section
|
|
|
|
<options>`.
|
|
|
|
|
|
|
|
Defaults for these options can also be set by creating a file named
|
2015-06-02 23:20:01 +08:00
|
|
|
``jupyter_notebook_config.py`` in your Jupyter folder. The Jupyter
|
|
|
|
folder is in your home directory, ``~/.jupyter``.
|
2015-06-02 04:06:33 +08:00
|
|
|
|
2015-06-02 23:20:01 +08:00
|
|
|
To create a ``jupyter_notebook_config.py`` file, with all the defaults
|
|
|
|
commented out, you can use the following command line::
|
2015-06-02 04:06:33 +08:00
|
|
|
|
2015-06-02 23:20:01 +08:00
|
|
|
$ jupyter notebook --generate-config
|
2015-06-02 04:06:33 +08:00
|
|
|
|
|
|
|
|
|
|
|
.. _options:
|
|
|
|
|
|
|
|
Options
|
|
|
|
-------
|
|
|
|
|
|
|
|
This list of options can be generated by running the following and hitting
|
|
|
|
enter::
|
|
|
|
|
|
|
|
$ jupyter notebook --help
|
|
|
|
|
|
|
|
"""
|
2015-06-05 00:35:02 +08:00
|
|
|
try:
|
|
|
|
destination = os.path.join(os.path.dirname(__file__), 'source/config.rst')
|
|
|
|
except:
|
|
|
|
destination = os.path.join(os.getcwd(), 'config.rst')
|
2015-06-03 02:04:20 +08:00
|
|
|
|
|
|
|
with open(destination, 'w') as f:
|
2015-06-02 04:06:33 +08:00
|
|
|
f.write(header)
|
2015-06-03 06:35:01 +08:00
|
|
|
f.write(NotebookApp().document_config_options())
|