File: autogen_config.py

package info (click to toggle)
jupyter-notebook 4.2.3-4~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 7,804 kB
  • sloc: python: 8,698; makefile: 240; sh: 74
file content (45 lines) | stat: -rw-r--r-- 1,107 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env python

import os
from notebook.notebookapp import NotebookApp

header = """\
.. _config:


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
``jupyter_notebook_config.py`` in your Jupyter folder. The Jupyter
folder is in your home directory, ``~/.jupyter``.

To create a ``jupyter_notebook_config.py`` file, with all the defaults
commented out, you can use the following command line::

  $ jupyter notebook --generate-config


.. _options:

Options
-------

This list of options can be generated by running the following and hitting 
enter::

  $ jupyter notebook --help

"""
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)
    f.write(NotebookApp().document_config_options())