File: autogen_config.py

package info (click to toggle)
nbclient 0.8.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 760 kB
  • sloc: python: 2,751; makefile: 18
file content (49 lines) | stat: -rw-r--r-- 1,041 bytes parent folder | download | duplicates (3)
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, "config_options.rst")

with open(destination, "w") as f:
    app = NbClientApp()
    f.write(header)
    f.write(app.document_config_options())