Skip to content

Commit 4786136

Browse files
authored
Autogenerated documentation (#272)
Intended fix for #228
1 parent 51b6861 commit 4786136

File tree

4 files changed

+380
-0
lines changed

4 files changed

+380
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Client for {{ api.naming.long_name }} API
2+
{{ '=' * (14 + api.naming.long_name|length) }}
3+
4+
.. automodule:: {{ api.naming.namespace|join('.')|lower }}.{{ api.naming.versioned_module_name }}
5+
:members:
6+
:inherited-members:
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Types for {{ api.naming.long_name }} API
2+
{{ '=' * (13 + api.naming.long_name|length) }}
3+
4+
.. automodule:: {{ api.naming.namespace|join('.')|lower }}.{{ api.naming.versioned_module_name }}.types
5+
:members:
Lines changed: 363 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,363 @@
1+
{% extends '_base.py.j2' %}
2+
3+
{% block content %}
4+
#
5+
# {{ api.naming.warehouse_package_name }} documentation build configuration file
6+
#
7+
# This file is execfile()d with the current directory set to its
8+
# containing dir.
9+
#
10+
# Note that not all possible configuration values are present in this
11+
# autogenerated file.
12+
#
13+
# All configuration values have a default; values that are commented out
14+
# serve to show the default.
15+
16+
import sys
17+
import os
18+
import shlex
19+
20+
# If extensions (or modules to document with autodoc) are in another directory,
21+
# add these directories to sys.path here. If the directory is relative to the
22+
# documentation root, use os.path.abspath to make it absolute, like shown here.
23+
sys.path.insert(0, os.path.abspath(".."))
24+
25+
__version__ = "0.1.0"
26+
27+
# -- General configuration ------------------------------------------------
28+
29+
# If your documentation needs a minimal Sphinx version, state it here.
30+
needs_sphinx = "1.6.3"
31+
32+
# Add any Sphinx extension module names here, as strings. They can be
33+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
34+
# ones.
35+
extensions = [
36+
"sphinx.ext.autodoc",
37+
"sphinx.ext.autosummary",
38+
"sphinx.ext.intersphinx",
39+
"sphinx.ext.coverage",
40+
"sphinx.ext.napoleon",
41+
"sphinx.ext.todo",
42+
"sphinx.ext.viewcode",
43+
]
44+
45+
# autodoc/autosummary flags
46+
autoclass_content = "both"
47+
autodoc_default_flags = ["members"]
48+
autosummary_generate = True
49+
50+
51+
# Add any paths that contain templates here, relative to this directory.
52+
templates_path = ["_templates"]
53+
54+
# Allow markdown includes (so releases.md can include CHANGLEOG.md)
55+
# http://www.sphinx-doc.org/en/master/markdown.html
56+
source_parsers = {".md": "recommonmark.parser.CommonMarkParser"}
57+
58+
# The suffix(es) of source filenames.
59+
# You can specify multiple suffix as a list of string:
60+
source_suffix = [".rst", ".md"]
61+
62+
# The encoding of source files.
63+
# source_encoding = 'utf-8-sig'
64+
65+
# The master toctree document.
66+
master_doc = "index"
67+
68+
# General information about the project.
69+
project = u"{{ api.naming.warehouse_package_name }}"
70+
copyright = u"2020, Google, LLC"
71+
author = u"Google APIs" # TODO: autogenerate this bit
72+
73+
# The version info for the project you're documenting, acts as replacement for
74+
# |version| and |release|, also used in various other places throughout the
75+
# built documents.
76+
#
77+
# The full version, including alpha/beta/rc tags.
78+
release = __version__
79+
# The short X.Y version.
80+
version = ".".join(release.split(".")[0:2])
81+
82+
# The language for content autogenerated by Sphinx. Refer to documentation
83+
# for a list of supported languages.
84+
#
85+
# This is also used if you do content translation via gettext catalogs.
86+
# Usually you set "language" from the command line for these cases.
87+
language = None
88+
89+
# There are two options for replacing |today|: either, you set today to some
90+
# non-false value, then it is used:
91+
# today = ''
92+
# Else, today_fmt is used as the format for a strftime call.
93+
# today_fmt = '%B %d, %Y'
94+
95+
# List of patterns, relative to source directory, that match files and
96+
# directories to ignore when looking for source files.
97+
exclude_patterns = ["_build"]
98+
99+
# The reST default role (used for this markup: `text`) to use for all
100+
# documents.
101+
# default_role = None
102+
103+
# If true, '()' will be appended to :func: etc. cross-reference text.
104+
# add_function_parentheses = True
105+
106+
# If true, the current module name will be prepended to all description
107+
# unit titles (such as .. function::).
108+
# add_module_names = True
109+
110+
# If true, sectionauthor and moduleauthor directives will be shown in the
111+
# output. They are ignored by default.
112+
# show_authors = False
113+
114+
# The name of the Pygments (syntax highlighting) style to use.
115+
pygments_style = "sphinx"
116+
117+
# A list of ignored prefixes for module index sorting.
118+
# modindex_common_prefix = []
119+
120+
# If true, keep warnings as "system message" paragraphs in the built documents.
121+
# keep_warnings = False
122+
123+
# If true, `todo` and `todoList` produce output, else they produce nothing.
124+
todo_include_todos = True
125+
126+
127+
# -- Options for HTML output ----------------------------------------------
128+
129+
# The theme to use for HTML and HTML Help pages. See the documentation for
130+
# a list of builtin themes.
131+
html_theme = "alabaster"
132+
133+
# Theme options are theme-specific and customize the look and feel of a theme
134+
# further. For a list of options available for each theme, see the
135+
# documentation.
136+
html_theme_options = {
137+
"description": "{{ api.naming.namespace|join(' ') }} Client Libraries for Python",
138+
"github_user": "googleapis",
139+
"github_repo": "google-cloud-python",
140+
"github_banner": True,
141+
"font_family": "'Roboto', Georgia, sans",
142+
"head_font_family": "'Roboto', Georgia, serif",
143+
"code_font_family": "'Roboto Mono', 'Consolas', monospace",
144+
}
145+
146+
# Add any paths that contain custom themes here, relative to this directory.
147+
# html_theme_path = []
148+
149+
# The name for this set of Sphinx documents. If None, it defaults to
150+
# "<project> v<release> documentation".
151+
# html_title = None
152+
153+
# A shorter title for the navigation bar. Default is the same as html_title.
154+
# html_short_title = None
155+
156+
# The name of an image file (relative to this directory) to place at the top
157+
# of the sidebar.
158+
# html_logo = None
159+
160+
# The name of an image file (within the static path) to use as favicon of the
161+
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
162+
# pixels large.
163+
# html_favicon = None
164+
165+
# Add any paths that contain custom static files (such as style sheets) here,
166+
# relative to this directory. They are copied after the builtin static files,
167+
# so a file named "default.css" will overwrite the builtin "default.css".
168+
# html_static_path = []
169+
170+
# Add any extra paths that contain custom files (such as robots.txt or
171+
# .htaccess) here, relative to this directory. These files are copied
172+
# directly to the root of the documentation.
173+
# html_extra_path = []
174+
175+
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
176+
# using the given strftime format.
177+
# html_last_updated_fmt = '%b %d, %Y'
178+
179+
# If true, SmartyPants will be used to convert quotes and dashes to
180+
# typographically correct entities.
181+
# html_use_smartypants = True
182+
183+
# Custom sidebar templates, maps document names to template names.
184+
# html_sidebars = {}
185+
186+
# Additional templates that should be rendered to pages, maps page names to
187+
# template names.
188+
# html_additional_pages = {}
189+
190+
# If false, no module index is generated.
191+
# html_domain_indices = True
192+
193+
# If false, no index is generated.
194+
# html_use_index = True
195+
196+
# If true, the index is split into individual pages for each letter.
197+
# html_split_index = False
198+
199+
# If true, links to the reST sources are added to the pages.
200+
# html_show_sourcelink = True
201+
202+
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
203+
# html_show_sphinx = True
204+
205+
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
206+
# html_show_copyright = True
207+
208+
# If true, an OpenSearch description file will be output, and all pages will
209+
# contain a <link> tag referring to it. The value of this option must be the
210+
# base URL from which the finished HTML is served.
211+
# html_use_opensearch = ''
212+
213+
# This is the file name suffix for HTML files (e.g. ".xhtml").
214+
# html_file_suffix = None
215+
216+
# Language to be used for generating the HTML full-text search index.
217+
# Sphinx supports the following languages:
218+
# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
219+
# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr'
220+
# html_search_language = 'en'
221+
222+
# A dictionary with options for the search language support, empty by default.
223+
# Now only 'ja' uses this config value
224+
# html_search_options = {'type': 'default'}
225+
226+
# The name of a javascript file (relative to the configuration directory) that
227+
# implements a search results scorer. If empty, the default will be used.
228+
# html_search_scorer = 'scorer.js'
229+
230+
# Output file base name for HTML help builder.
231+
htmlhelp_basename = "{{ api.naming.warehouse_package_name }}-doc"
232+
233+
# -- Options for warnings ------------------------------------------------------
234+
235+
236+
suppress_warnings = [
237+
# Temporarily suppress this to avoid "more than one target found for
238+
# cross-reference" warning, which are intractable for us to avoid while in
239+
# a mono-repo.
240+
# See https://github.com/sphinx-doc/sphinx/blob
241+
# /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843
242+
"ref.python"
243+
]
244+
245+
# -- Options for LaTeX output ---------------------------------------------
246+
247+
latex_elements = {
248+
# The paper size ('letterpaper' or 'a4paper').
249+
# 'papersize': 'letterpaper',
250+
# The font size ('10pt', '11pt' or '12pt').
251+
# 'pointsize': '10pt',
252+
# Additional stuff for the LaTeX preamble.
253+
# 'preamble': '',
254+
# Latex figure (float) alignment
255+
# 'figure_align': 'htbp',
256+
}
257+
258+
# Grouping the document tree into LaTeX files. List of tuples
259+
# (source start file, target name, title,
260+
# author, documentclass [howto, manual, or own class]).
261+
latex_documents = [
262+
(
263+
master_doc,
264+
"{{ api.naming.warehouse_package_name }}.tex",
265+
u"{{ api.naming.warehouse_package_name }} Documentation",
266+
author,
267+
"manual",
268+
)
269+
]
270+
271+
# The name of an image file (relative to this directory) to place at the top of
272+
# the title page.
273+
# latex_logo = None
274+
275+
# For "manual" documents, if this is true, then toplevel headings are parts,
276+
# not chapters.
277+
# latex_use_parts = False
278+
279+
# If true, show page references after internal links.
280+
# latex_show_pagerefs = False
281+
282+
# If true, show URL addresses after external links.
283+
# latex_show_urls = False
284+
285+
# Documents to append as an appendix to all manuals.
286+
# latex_appendices = []
287+
288+
# If false, no module index is generated.
289+
# latex_domain_indices = True
290+
291+
292+
# -- Options for manual page output ---------------------------------------
293+
294+
# One entry per manual page. List of tuples
295+
# (source start file, name, description, authors, manual section).
296+
man_pages = [
297+
(
298+
master_doc,
299+
"{{ api.naming.warehouse_package_name }}",
300+
u"{{ api.naming.long_name }} Documentation",
301+
[author],
302+
1,
303+
)
304+
]
305+
306+
# If true, show URL addresses after external links.
307+
# man_show_urls = False
308+
309+
310+
# -- Options for Texinfo output -------------------------------------------
311+
312+
# Grouping the document tree into Texinfo files. List of tuples
313+
# (source start file, target name, title, author,
314+
# dir menu entry, description, category)
315+
texinfo_documents = [
316+
(
317+
master_doc,
318+
"{{ api.naming.warehouse_package_name }}",
319+
u"{{ api.naming.warehouse_package_name }} Documentation",
320+
author,
321+
"{{ api.naming.warehouse_package_name }}",
322+
"GAPIC library for {{ api.naming.long_name }} API",
323+
"APIs",
324+
)
325+
]
326+
327+
# Documents to append as an appendix to all manuals.
328+
# texinfo_appendices = []
329+
330+
# If false, no module index is generated.
331+
# texinfo_domain_indices = True
332+
333+
# How to display URL addresses: 'footnote', 'no', or 'inline'.
334+
# texinfo_show_urls = 'footnote'
335+
336+
# If true, do not generate a @detailmenu in the "Top" node's menu.
337+
# texinfo_no_detailmenu = False
338+
339+
340+
# Example configuration for intersphinx: refer to the Python standard library.
341+
intersphinx_mapping = {
342+
"python": ("http://python.readthedocs.org/en/latest/", None),
343+
"gax": ("https://gax-python.readthedocs.org/en/latest/", None),
344+
"google-auth": ("https://google-auth.readthedocs.io/en/stable", None),
345+
"google-gax": ("https://gax-python.readthedocs.io/en/latest/", None),
346+
"google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None),
347+
"grpc": ("https://grpc.io/grpc/python/", None),
348+
"requests": ("http://requests.kennethreitz.org/en/stable/", None),
349+
}
350+
351+
352+
# Napoleon settings
353+
napoleon_google_docstring = True
354+
napoleon_numpy_docstring = True
355+
napoleon_include_private_with_doc = False
356+
napoleon_include_special_with_doc = True
357+
napoleon_use_admonition_for_examples = False
358+
napoleon_use_admonition_for_notes = False
359+
napoleon_use_admonition_for_references = False
360+
napoleon_use_ivar = False
361+
napoleon_use_param = True
362+
napoleon_use_rtype = True
363+
{% endblock %}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
API Reference
2+
-------------
3+
.. toctree::
4+
:maxdepth: 2
5+
{{ api.naming.versioned_module_name }}/services
6+
{{ api.naming.versioned_module_name }}/types

0 commit comments

Comments
 (0)