Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9054a3b

Browse files
authored
Merge pull request#1209 from python-gitlab/docs/cli-reference-page
docs(cli): add auto-generated CLI reference
2 parents8cb8040 +6c21fc8 commit9054a3b

File tree

9 files changed

+49
-8
lines changed

9 files changed

+49
-8
lines changed

‎docs/api/gitlab.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
gitlab package
2-
==============
1+
API reference (``gitlab`` package)
2+
==================================
33

44
Subpackages
55
-----------

‎docs/cli-objects.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
##################################
2+
CLI reference (``gitlab`` command)
3+
##################################
4+
5+
..warning::
6+
7+
The following is a complete, auto-generated list of subcommands available
8+
via the:command:`gitlab` command-line tool. Some of the actions may
9+
currently not work as expected or lack functionality available via the API.
10+
11+
Please see the existing `list of CLI related issues`_, or open a new one if
12+
it is not already listed there.
13+
14+
.. _list of CLI related issues:https://github.com/python-gitlab/python-gitlab/issues?q=is%3Aopen+is%3Aissue+label%3Acli
15+
16+
..autoprogram::gitlab.cli:docs()
17+
:prog: gitlab

‎docs/cli.rstrenamed to ‎docs/cli-usage.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,10 @@ Example:
180180
Examples
181181
========
182182

183+
**Notice:**
184+
185+
For a complete list of objects and actions available, see:doc:`/cli-objects`.
186+
183187
List the projects (paginated):
184188

185189
..code-block::console

‎docs/conf.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@
3939
# Add any Sphinx extension module names here, as strings. They can be
4040
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
4141
# ones.
42-
extensions= ["sphinx.ext.autodoc","sphinx.ext.autosummary","ext.docstrings"]
42+
extensions= [
43+
"sphinx.ext.autodoc",
44+
"sphinx.ext.autosummary",
45+
"ext.docstrings",
46+
"sphinxcontrib.autoprogram",
47+
]
4348

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

‎docs/index.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ Contents:
1212
:maxdepth:2
1313

1414
install
15-
cli
15+
cli-usage
1616
api-usage
1717
faq
18-
switching-to-v4
1918
api-objects
2019
api/gitlab
20+
cli-objects
2121
release_notes
2222
changelog
23+
switching-to-v4
2324

2425

2526
Indices and tables

‎gitlab/cli.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,20 @@ def _parse_value(v):
149149
returnv
150150

151151

152+
defdocs():
153+
"""
154+
Provide a statically generated parser for sphinx only, so we don't need
155+
to provide dummy gitlab config for readthedocs.
156+
"""
157+
if"sphinx"notinsys.modules:
158+
sys.exit("Docs parser is only intended for build_sphinx")
159+
160+
parser=_get_base_parser(add_help=False)
161+
cli_module=importlib.import_module("gitlab.v4.cli")
162+
163+
return_get_parser(cli_module)
164+
165+
152166
defmain():
153167
if"--version"insys.argv:
154168
print(gitlab.__version__)

‎rtd-requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
-r requirements.txt
22
jinja2
33
sphinx==3.2.1
4+
sphinx_rtd_theme
5+
sphinxcontrib-autoprogram

‎test-requirements.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
coverage
22
httmock
3-
jinja2
43
mock
54
pytest
65
pytest-cov
7-
sphinx==3.2.1
8-
sphinx_rtd_theme
96
responses

‎tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ max-line-length = 88
4444
ignore = H501,H803
4545

4646
[testenv:docs]
47+
deps = -r{toxinidir}/rtd-requirements.txt
4748
commands = python setup.py build_sphinx
4849

4950
[testenv:cover]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp