|
20 | 20 | HERE = osp.abspath(osp.dirname(__file__))
|
21 | 21 | sys.path.insert(0, osp.join(HERE, "..", ".."))
|
22 | 22 |
|
| 23 | +from jupyterlab_server import LabServerApp, _version # noqa |
| 24 | + |
23 | 25 | # -- Project information -----------------------------------------------------
|
24 | 26 |
|
25 | 27 | project = "JupyterLab Server"
|
26 | 28 | copyright = "2021, Project Jupyter" # noqa
|
27 | 29 | author = "Project Jupyter"
|
28 | 30 |
|
29 |
| -# The full version, including alpha/beta/rc tags |
30 |
| -_version_py = osp.join(HERE, "..", "..", "jupyterlab_server", "_version.py") |
31 |
| -version_ns = {} |
32 |
| - |
33 |
| -with open(_version_py) as version_file: |
34 |
| - exec(version_file.read(), version_ns) # noqa |
35 |
| - |
36 | 31 | # The short X.Y version.
|
37 |
| -version = "%i.%i" % version_ns["version_info"][:2] |
| 32 | +version = "%i.%i" % _version.version_info[:2] |
38 | 33 | # The full version, including alpha/beta/rc tags.
|
39 |
| -release = version_ns["__version__"] |
| 34 | +release = _version.__version__ |
40 | 35 |
|
41 | 36 | # -- General configuration ---------------------------------------------------
|
42 | 37 |
|
|
54 | 49 | "sphinx_copybutton",
|
55 | 50 | ]
|
56 | 51 |
|
| 52 | +try: |
| 53 | + import enchant # type:ignore # noqa |
| 54 | + |
| 55 | + extensions += ["sphinxcontrib.spelling"] |
| 56 | +except ImportError: |
| 57 | + pass |
| 58 | + |
| 59 | + |
57 | 60 | myst_enable_extensions = ["html_image"]
|
58 | 61 |
|
59 | 62 | # Add any paths that contain templates here, relative to this directory.
|
|
90 | 93 | # so disable
|
91 | 94 | numpydoc_show_class_members = False
|
92 | 95 |
|
| 96 | +config_header = """\ |
| 97 | +.. _api-full-config: |
| 98 | +
|
| 99 | +
|
| 100 | +Config file and command line options |
| 101 | +==================================== |
| 102 | +
|
| 103 | +The JupyterLab Server can be run with a variety of command line arguments. |
| 104 | +A list of available options can be found below in the :ref:`options section |
| 105 | +<options>`. |
| 106 | +
|
| 107 | +Defaults for these options can also be set by creating a file named |
| 108 | +``jupyter_jupyterlab_server_config.py`` in your Jupyter folder. The Jupyter |
| 109 | +folder is in your home directory, ``~/.jupyter``. |
| 110 | +
|
| 111 | +To create a ``jupyter_jupyterlab_server_config.py`` file, with all the defaults |
| 112 | +commented out, you can use the following command line:: |
| 113 | +
|
| 114 | + $ python -m jupyterlab_server --generate-config |
| 115 | +
|
| 116 | +
|
| 117 | +.. _options: |
| 118 | +
|
| 119 | +Options |
| 120 | +------- |
| 121 | +
|
| 122 | +This list of options can be generated by running the following and hitting |
| 123 | +enter:: |
| 124 | +
|
| 125 | + $ python -m jupyterlab_server --help-all |
| 126 | +
|
| 127 | +""" |
| 128 | + |
93 | 129 |
|
94 | 130 | def setup(app):
|
95 | 131 | dest = osp.join(HERE, "changelog.md")
|
96 | 132 | shutil.copy(osp.join(HERE, "..", "..", "CHANGELOG.md"), dest)
|
97 |
| - with open(osp.join(HERE, "../autogen_config.py")) as f: |
98 |
| - exec(compile(f.read(), "../autogen_config.py", "exec"), {}) # noqa |
| 133 | + destination = osp.join(HERE, "api/app-config.rst") |
| 134 | + with open(destination, "w") as f: |
| 135 | + f.write(config_header) |
| 136 | + f.write(LabServerApp().document_config_options()) |
0 commit comments