-
Notifications
You must be signed in to change notification settings - Fork 55
/
autogen_config.py
49 lines (35 loc) · 1.03 KB
/
autogen_config.py
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
46
47
48
49
#!/usr/bin/env python
"""
autogen_config.py
Create config_options.rst, a Sphinx documentation source file.
Documents the options that may be set in nbconvert's configuration file,
jupyter_nbconvert_config.py.
"""
import os
import os.path
from nbclient.cli import NbClientApp
header = """\
.. This is an automatically generated file.
.. do not modify by hand.
.. _other-full-config:
Config file and command line options
====================================
Jupyter ``nbclient`` 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>`.
.. _options:
Options
-------
This list of options can be generated by running the following and hitting
enter::
$ jupyter execute --help-all
"""
try:
indir = os.path.dirname(__file__)
except NameError:
indir = os.getcwd()
destination = os.path.join(indir, "reference/config_options.rst")
with open(destination, "w") as f:
app = NbClientApp()
f.write(header)
f.write(app.document_config_options())