Skip to content

Commit f74ee83

Browse files
busunkim96tswast
authored andcommitted
Translate: Add docs for v3beta1. (googleapis#7681)
* Add docs for v3beta1. * Add docstring replace to synth.py * Reset language synth.metadata
1 parent 3dea28d commit f74ee83

8 files changed

Lines changed: 64 additions & 12 deletions

File tree

translate/docs/README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../README.rst
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Client for Cloud Translation API
2+
================================
3+
4+
.. automodule:: google.cloud.translate_v3beta1
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 Cloud Translation API Client
2+
======================================
3+
4+
.. automodule:: google.cloud.translate_v3beta1.types
5+
:members:

translate/docs/index.rst

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

33
Detailed Usage Guide
44
--------------------
@@ -9,11 +9,25 @@ Detailed Usage Guide
99

1010
API Reference
1111
-------------
12+
13+
A new beta release, spelled ``v3beta1``, is provided to provide for preview
14+
of upcoming features. In order to use this, you will want to import from
15+
``google.cloud.translate_v3beta1`` in lieu of ``google.cloud.translate``.
16+
17+
.. toctree::
18+
:maxdepth: 2
19+
20+
gapic/v3beta1/api
21+
gapic/v3beta1/types
22+
23+
An API and type reference is provided for v2:
24+
1225
.. toctree::
1326
:maxdepth: 2
1427

1528
client
1629

30+
1731
Changelog
1832
---------
1933

translate/google/cloud/translate_v3beta1/proto/translation_service_pb2.py

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

translate/noxfile.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
from __future__ import absolute_import
1818
import os
19+
import shutil
1920

2021
import nox
2122

@@ -138,3 +139,22 @@ def cover(session):
138139
session.run("coverage", "report", "--show-missing", "--fail-under=100")
139140

140141
session.run("coverage", "erase")
142+
143+
@nox.session(python='3.6')
144+
def docs(session):
145+
"""Build the docs."""
146+
147+
session.install('sphinx', 'alabaster', 'recommonmark')
148+
session.install('-e', '.')
149+
150+
shutil.rmtree(os.path.join('docs', '_build'), ignore_errors=True)
151+
session.run(
152+
'sphinx-build',
153+
'-W', # warnings as errors
154+
'-T', # show full traceback on exception
155+
'-N', # no colors
156+
'-b', 'html',
157+
'-d', os.path.join('docs', '_build', 'doctrees', ''),
158+
os.path.join('docs', ''),
159+
os.path.join('docs', '_build', 'html', ''),
160+
)

translate/synth.metadata

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"updateTime": "2019-04-04T12:25:29.184680Z",
2+
"updateTime": "2019-04-08T22:42:12.391231Z",
33
"sources": [
44
{
55
"generator": {
66
"name": "artman",
7-
"version": "0.16.23",
8-
"dockerImage": "googleapis/artman@sha256:f3a3f88000dc1cd1b4826104c5574aa5c534f6793fbf66e888d11c0d7ef5762e"
7+
"version": "0.16.25",
8+
"dockerImage": "googleapis/artman@sha256:d9597f983d1d4e61272c63cb97b7d8f8234da9999526c35d357de3d781f0ec1b"
99
}
1010
},
1111
{
1212
"git": {
13-
"name": "googleapis-private",
14-
"remote": "https://github.com/googleapis/googleapis-private.git",
15-
"sha": "6c972ee69c6f4e4ae19df06c4c2a082cee64cab0",
16-
"internalRef": "241798897"
13+
"name": "googleapis",
14+
"remote": "git@github.com:googleapis/googleapis.git",
15+
"sha": "9a02c5acecb43f38fae4fa52c6420f21c335b888",
16+
"internalRef": "242170119"
1717
}
1818
},
1919
{
@@ -27,7 +27,7 @@
2727
"destinations": [
2828
{
2929
"client": {
30-
"source": "googleapis-private",
30+
"source": "googleapis",
3131
"apiName": "translate",
3232
"apiVersion": "v3beta1",
3333
"language": "python",

translate/synth.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@
3232
"translate",
3333
version,
3434
include_protos=True,
35-
private=True,
3635
)
3736

3837
#s.move(library / f'google/cloud/translation_{version}', f'google/cloud/translate_{version}', excludes=excludes)
3938
s.move(library / f'google/cloud/translate_{version}', excludes=excludes)
4039
s.move(library / 'tests')
40+
s.move(library / f"docs/gapic/{version}")
4141

4242
# translation -> translate
4343
s.replace(
@@ -46,6 +46,12 @@
4646
"google.cloud.translate_v3beta1.proto",
4747
)
4848

49+
s.replace(
50+
"google/cloud/**/translation_service_pb2.py",
51+
r"""record delimiters are ':raw-latex:`\\n`' instead of
52+
':raw-latex:`\\r`:raw-latex:`\\n`'.""",
53+
r"""record delimiters are ``\\\\\\\\n`` instead of
54+
``\\\\\\\\r\\\\\\\\n``.""",)
4955
# ----------------------------------------------------------------------------
5056
# Add templated files
5157
# ----------------------------------------------------------------------------

0 commit comments

Comments
 (0)