diff options
author | Gauvain Pocentek <gauvain@pocentek.net> | 2017-06-18 12:16:08 +0200 |
---|---|---|
committer | Gauvain Pocentek <gauvain@pocentek.net> | 2017-06-18 12:16:08 +0200 |
commit | 1a7f67274c9175f46a76c5ae0d8bde7ca2731014 (patch) | |
tree | 523e9fad5aeaae321621e35d3f151ab189ef5936 /docs | |
parent | 2a0afc50311c727ee3bef700553fb60924439ef4 (diff) | |
download | gitlab-1a7f67274c9175f46a76c5ae0d8bde7ca2731014.tar.gz |
Rework documentation
Diffstat (limited to 'docs')
-rw-r--r-- | docs/api/gitlab.rst | 78 | ||||
-rw-r--r-- | docs/api/modules.rst | 7 | ||||
-rw-r--r-- | docs/ext/docstrings.py | 14 | ||||
-rw-r--r-- | docs/index.rst | 2 |
4 files changed, 61 insertions, 40 deletions
diff --git a/docs/api/gitlab.rst b/docs/api/gitlab.rst index d34d56f..e75f843 100644 --- a/docs/api/gitlab.rst +++ b/docs/api/gitlab.rst @@ -1,55 +1,48 @@ gitlab package ============== -Module contents ---------------- +Subpackages +----------- -.. automodule:: gitlab +.. toctree:: + + gitlab.v3 + gitlab.v4 + +Submodules +---------- + +gitlab.base module +------------------ + +.. automodule:: gitlab.base :members: :undoc-members: :show-inheritance: - :exclude-members: Hook, UserProject, Group, Issue, Team, User, - all_projects, owned_projects, search_projects -gitlab.base ------------ +gitlab.cli module +----------------- -.. automodule:: gitlab.base +.. automodule:: gitlab.cli :members: :undoc-members: :show-inheritance: -gitlab.v3.objects module ------------------------- +gitlab.config module +-------------------- -.. automodule:: gitlab.v3.objects +.. automodule:: gitlab.config :members: :undoc-members: :show-inheritance: - :exclude-members: Branch, Commit, Content, Event, File, Hook, Issue, Key, - Label, Member, MergeRequest, Milestone, Note, Snippet, - Tag, canGet, canList, canUpdate, canCreate, canDelete, - requiredUrlAttrs, requiredListAttrs, optionalListAttrs, - optionalGetAttrs, requiredGetAttrs, requiredDeleteAttrs, - requiredCreateAttrs, optionalCreateAttrs, - requiredUpdateAttrs, optionalUpdateAttrs, getRequiresId, - shortPrintAttr, idAttr -gitlab.v4.objects module ------------------------- +gitlab.const module +------------------- -.. automodule:: gitlab.v4.objects +.. automodule:: gitlab.const :members: :undoc-members: :show-inheritance: - :exclude-members: Branch, Commit, Content, Event, File, Hook, Issue, Key, - Label, Member, MergeRequest, Milestone, Note, Snippet, - Tag, canGet, canList, canUpdate, canCreate, canDelete, - requiredUrlAttrs, requiredListAttrs, optionalListAttrs, - optionalGetAttrs, requiredGetAttrs, requiredDeleteAttrs, - requiredCreateAttrs, optionalCreateAttrs, - requiredUpdateAttrs, optionalUpdateAttrs, getRequiresId, - shortPrintAttr, idAttr gitlab.exceptions module ------------------------ @@ -58,3 +51,28 @@ gitlab.exceptions module :members: :undoc-members: :show-inheritance: + +gitlab.mixins module +-------------------- + +.. automodule:: gitlab.mixins + :members: + :undoc-members: + :show-inheritance: + +gitlab.utils module +------------------- + +.. automodule:: gitlab.utils + :members: + :undoc-members: + :show-inheritance: + + +Module contents +--------------- + +.. automodule:: gitlab + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/api/modules.rst b/docs/api/modules.rst deleted file mode 100644 index 3ec5a68..0000000 --- a/docs/api/modules.rst +++ /dev/null @@ -1,7 +0,0 @@ -API documentation -================= - -.. toctree:: - :maxdepth: 4 - - gitlab diff --git a/docs/ext/docstrings.py b/docs/ext/docstrings.py index fc95eeb..32c5da1 100644 --- a/docs/ext/docstrings.py +++ b/docs/ext/docstrings.py @@ -10,6 +10,8 @@ from sphinx.ext.napoleon.docstring import GoogleDocstring def classref(value, short=True): + return value + if not inspect.isclass(value): return ':class:%s' % value tilde = '~' if short else '' @@ -46,8 +48,13 @@ class GitlabDocstring(GoogleDocstring): return output.split('\n') - def __init__(self, *args, **kwargs): - super(GitlabDocstring, self).__init__(*args, **kwargs) + def __init__(self, docstring, config=None, app=None, what='', name='', + obj=None, options=None): + super(GitlabDocstring, self).__init__(docstring, config, app, what, + name, obj, options) + + if name and name.startswith('gitlab.v4.objects'): + return if getattr(self._obj, '__name__', None) == 'Gitlab': mgrs = [] @@ -57,9 +64,12 @@ class GitlabDocstring(GoogleDocstring): mgrs.append(item) self._parsed_lines.extend(self._build_doc('gl_tmpl.j2', mgrs=sorted(mgrs))) + + # BaseManager elif hasattr(self._obj, 'obj_cls') and self._obj.obj_cls is not None: self._parsed_lines.extend(self._build_doc('manager_tmpl.j2', cls=self._obj.obj_cls)) + # GitlabObject elif hasattr(self._obj, 'canUpdate') and self._obj.canUpdate: self._parsed_lines.extend(self._build_doc('object_tmpl.j2', obj=self._obj)) diff --git a/docs/index.rst b/docs/index.rst index ebfc8fe..7805fcf 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -16,7 +16,7 @@ Contents: api-usage switching-to-v4 api-objects - api/modules + api/gitlab release_notes changelog |