notebook/docs/autogen_config.py

46 lines
1.1 KiB
Python
Raw Normal View History

#!/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
header = """\
.. _config:
2015-09-23 00:32:11 +08:00
Config file and command line options
====================================
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 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 23:20:01 +08:00
$ jupyter notebook --generate-config
.. _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')
with open(destination, 'w') as f:
f.write(header)
2015-06-03 06:35:01 +08:00
f.write(NotebookApp().document_config_options())