Skip to content

Commit 91084e6

Browse files
authored
Add nox session 'docs' to remaining manual clients. (#8478)
1 parent 99b4cc8 commit 91084e6

File tree

4 files changed

+67
-7
lines changed

4 files changed

+67
-7
lines changed

docs/README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../README.rst

docs/conf.py

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
# documentation root, use os.path.abspath to make it absolute, like shown here.
2121
sys.path.insert(0, os.path.abspath(".."))
2222

23-
__version__ = "0.91.4"
23+
__version__ = "0.1.0"
2424

2525
# -- General configuration ------------------------------------------------
2626

2727
# If your documentation needs a minimal Sphinx version, state it here.
28-
# needs_sphinx = '1.0'
28+
needs_sphinx = "1.6.3"
2929

3030
# Add any Sphinx extension module names here, as strings. They can be
3131
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
@@ -36,6 +36,7 @@
3636
"sphinx.ext.intersphinx",
3737
"sphinx.ext.coverage",
3838
"sphinx.ext.napoleon",
39+
"sphinx.ext.todo",
3940
"sphinx.ext.viewcode",
4041
]
4142

@@ -44,13 +45,18 @@
4445
autodoc_default_flags = ["members"]
4546
autosummary_generate = True
4647

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

52+
# Allow markdown includes (so releases.md can include CHANGLEOG.md)
53+
# http://www.sphinx-doc.org/en/master/markdown.html
54+
source_parsers = {".md": "recommonmark.parser.CommonMarkParser"}
55+
5056
# The suffix(es) of source filenames.
5157
# You can specify multiple suffix as a list of string:
5258
# source_suffix = ['.rst', '.md']
53-
source_suffix = ".rst"
59+
source_suffix = [".rst", ".md"]
5460

5561
# The encoding of source files.
5662
# source_encoding = 'utf-8-sig'
@@ -116,6 +122,7 @@
116122
# If true, `todo` and `todoList` produce output, else they produce nothing.
117123
todo_include_todos = True
118124

125+
119126
# -- Options for HTML output ----------------------------------------------
120127

121128
# The theme to use for HTML and HTML Help pages. See the documentation for
@@ -125,7 +132,15 @@
125132
# Theme options are theme-specific and customize the look and feel of a theme
126133
# further. For a list of options available for each theme, see the
127134
# documentation.
128-
# html_theme_options = {}
135+
html_theme_options = {
136+
"description": "Google Cloud Client Libraries for Python",
137+
"github_user": "googleapis",
138+
"github_repo": "google-cloud-python",
139+
"github_banner": True,
140+
"font_family": "'Roboto', Georgia, sans",
141+
"head_font_family": "'Roboto', Georgia, serif",
142+
"code_font_family": "'Roboto Mono', 'Consolas', monospace",
143+
}
129144

130145
# Add any paths that contain custom themes here, relative to this directory.
131146
# html_theme_path = []
@@ -214,6 +229,18 @@
214229
# Output file base name for HTML help builder.
215230
htmlhelp_basename = "google-cloud-logging-doc"
216231

232+
# -- Options for warnings ------------------------------------------------------
233+
234+
235+
suppress_warnings = [
236+
# Temporarily suppress this to avoid "more than one target found for
237+
# cross-reference" warning, which are intractable for us to avoid while in
238+
# a mono-repo.
239+
# See https://github.com/sphinx-doc/sphinx/blob
240+
# /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843
241+
"ref.python"
242+
]
243+
217244
# -- Options for LaTeX output ---------------------------------------------
218245

219246
latex_elements = {
@@ -260,6 +287,7 @@
260287
# If false, no module index is generated.
261288
# latex_domain_indices = True
262289

290+
263291
# -- Options for manual page output ---------------------------------------
264292

265293
# One entry per manual page. List of tuples
@@ -277,6 +305,7 @@
277305
# If true, show URL addresses after external links.
278306
# man_show_urls = False
279307

308+
280309
# -- Options for Texinfo output -------------------------------------------
281310

282311
# Grouping the document tree into Texinfo files. List of tuples
@@ -289,7 +318,7 @@
289318
u"google-cloud-logging Documentation",
290319
author,
291320
"google-cloud-logging",
292-
"GAPIC library for the {metadata.shortName} v2 service",
321+
"GAPIC library for the logging API",
293322
"APIs",
294323
)
295324
]
@@ -306,12 +335,20 @@
306335
# If true, do not generate a @detailmenu in the "Top" node's menu.
307336
# texinfo_no_detailmenu = False
308337

338+
309339
# Example configuration for intersphinx: refer to the Python standard library.
310340
intersphinx_mapping = {
311341
"python": ("http://python.readthedocs.org/en/latest/", None),
312-
"gax": ("https://gax-python.readthedocs.org/en/latest/", None),
342+
"google-auth": ("https://google-auth.readthedocs.io/en/stable", None),
343+
"google.api_core": (
344+
"https://googleapis.github.io/google-cloud-python/latest",
345+
None,
346+
),
347+
"grpc": ("https://grpc.io/grpc/python/", None),
348+
"requests": ("http://docs.python-requests.org/en/master/", None),
313349
}
314350

351+
315352
# Napoleon settings
316353
napoleon_google_docstring = True
317354
napoleon_numpy_docstring = True

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. include:: /../logging/README.rst
1+
.. include:: README.rst
22

33
Usage Documentation
44
-------------------

noxfile.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from __future__ import absolute_import
1616

1717
import os
18+
import shutil
1819
import sys
1920

2021
import nox
@@ -165,3 +166,24 @@ def cover(session):
165166
session.run("coverage", "report", "--show-missing", "--fail-under=100")
166167

167168
session.run("coverage", "erase")
169+
170+
@nox.session(python="3.7")
171+
def docs(session):
172+
"""Build the docs for this library."""
173+
174+
session.install("-e", ".")
175+
session.install("sphinx", "alabaster", "recommonmark")
176+
177+
shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True)
178+
session.run(
179+
"sphinx-build",
180+
"-W", # warnings as errors
181+
"-T", # show full traceback on exception
182+
"-N", # no colors
183+
"-b",
184+
"html",
185+
"-d",
186+
os.path.join("docs", "_build", "doctrees", ""),
187+
os.path.join("docs", ""),
188+
os.path.join("docs", "_build", "html", ""),
189+
)

0 commit comments

Comments
 (0)