File: conf.py

package info (click to toggle)
jupyterlab-server 2.25.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 676 kB
  • sloc: python: 3,454; makefile: 13; sh: 2
file content (140 lines) | stat: -rw-r--r-- 4,076 bytes parent folder | download
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.

# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
import os.path as osp
import shutil
import sys

HERE = osp.abspath(osp.dirname(__file__))
sys.path.insert(0, osp.join(HERE, "..", ".."))

from jupyterlab_server import LabServerApp, _version  # noqa

# -- Project information -----------------------------------------------------

project = "JupyterLab Server"
copyright = "2021, Project Jupyter"  # noqa
author = "Project Jupyter"

# The short X.Y version.
version = "%i.%i" % _version.version_info[:2]
# The full version, including alpha/beta/rc tags.
release = _version.__version__

# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
    "myst_parser",
    "autodoc_traits",
    "sphinx.ext.autodoc",
    "sphinx.ext.intersphinx",
    "sphinxcontrib.openapi",
    "sphinx.ext.napoleon",
    "sphinx.ext.mathjax",
    "sphinx_copybutton",
]

try:
    import enchant  # type:ignore  # noqa

    extensions += ["sphinxcontrib.spelling"]
except ImportError:
    pass


myst_enable_extensions = ["html_image"]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
#
#
html_theme = "pydata_sphinx_theme"

# Add an Edit this Page button
html_theme_options = {
    "use_edit_page_button": True,
    "navigation_with_keys": False,
}

# Output for github to be used in links
html_context = {
    "github_user": "jupyterlab",  # Username
    "github_repo": "jupyterlab_server",  # Repo name
    "github_version": "master",  # Version
    "doc_path": "/docs/source/",  # Path in the checkout to the docs root
}

# This option generates errors when methods do not have docstrings,
# so disable
numpydoc_show_class_members = False

config_header = """\
.. _api-full-config:


Config file and command line options
====================================

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

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

  $ python -m jupyterlab_server --generate-config


.. _options:

Options
-------

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

  $ python -m jupyterlab_server --help-all

"""


def setup(app):
    dest = osp.join(HERE, "changelog.md")
    shutil.copy(osp.join(HERE, "..", "..", "CHANGELOG.md"), dest)
    destination = osp.join(HERE, "api/app-config.rst")
    with open(destination, "w") as f:
        f.write(config_header)
        f.write(LabServerApp().document_config_options())