Skip to content

Commit

Permalink
Translate: Add docs for v3beta1. (googleapis#7681)
Browse files Browse the repository at this point in the history
* Add docs for v3beta1.

* Add docstring replace to synth.py

* Reset language synth.metadata
  • Loading branch information
busunkim96 authored and tswast committed Apr 11, 2019
1 parent 3dea28d commit f74ee83
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 12 deletions.
1 change: 1 addition & 0 deletions translate/docs/README.rst
6 changes: 6 additions & 0 deletions translate/docs/gapic/v3beta1/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Client for Cloud Translation API
================================

.. automodule:: google.cloud.translate_v3beta1
:members:
:inherited-members:
5 changes: 5 additions & 0 deletions translate/docs/gapic/v3beta1/types.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Types for Cloud Translation API Client
======================================

.. automodule:: google.cloud.translate_v3beta1.types
:members:
16 changes: 15 additions & 1 deletion translate/docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. include:: /../translate/README.rst
.. include:: README.rst

Detailed Usage Guide
--------------------
Expand All @@ -9,11 +9,25 @@ Detailed Usage Guide

API Reference
-------------

A new beta release, spelled ``v3beta1``, is provided to provide for preview
of upcoming features. In order to use this, you will want to import from
``google.cloud.translate_v3beta1`` in lieu of ``google.cloud.translate``.

.. toctree::
:maxdepth: 2

gapic/v3beta1/api
gapic/v3beta1/types

An API and type reference is provided for v2:

.. toctree::
:maxdepth: 2

client


Changelog
---------

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions translate/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

from __future__ import absolute_import
import os
import shutil

import nox

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

session.run("coverage", "erase")

@nox.session(python='3.6')
def docs(session):
"""Build the docs."""

session.install('sphinx', 'alabaster', 'recommonmark')
session.install('-e', '.')

shutil.rmtree(os.path.join('docs', '_build'), ignore_errors=True)
session.run(
'sphinx-build',
'-W', # warnings as errors
'-T', # show full traceback on exception
'-N', # no colors
'-b', 'html',
'-d', os.path.join('docs', '_build', 'doctrees', ''),
os.path.join('docs', ''),
os.path.join('docs', '_build', 'html', ''),
)
16 changes: 8 additions & 8 deletions translate/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"updateTime": "2019-04-04T12:25:29.184680Z",
"updateTime": "2019-04-08T22:42:12.391231Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.16.23",
"dockerImage": "googleapis/artman@sha256:f3a3f88000dc1cd1b4826104c5574aa5c534f6793fbf66e888d11c0d7ef5762e"
"version": "0.16.25",
"dockerImage": "googleapis/artman@sha256:d9597f983d1d4e61272c63cb97b7d8f8234da9999526c35d357de3d781f0ec1b"
}
},
{
"git": {
"name": "googleapis-private",
"remote": "https://github.com/googleapis/googleapis-private.git",
"sha": "6c972ee69c6f4e4ae19df06c4c2a082cee64cab0",
"internalRef": "241798897"
"name": "googleapis",
"remote": "git@github.com:googleapis/googleapis.git",
"sha": "9a02c5acecb43f38fae4fa52c6420f21c335b888",
"internalRef": "242170119"
}
},
{
Expand All @@ -27,7 +27,7 @@
"destinations": [
{
"client": {
"source": "googleapis-private",
"source": "googleapis",
"apiName": "translate",
"apiVersion": "v3beta1",
"language": "python",
Expand Down
8 changes: 7 additions & 1 deletion translate/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@
"translate",
version,
include_protos=True,
private=True,
)

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

# translation -> translate
s.replace(
Expand All @@ -46,6 +46,12 @@
"google.cloud.translate_v3beta1.proto",
)

s.replace(
"google/cloud/**/translation_service_pb2.py",
r"""record delimiters are ':raw-latex:`\\n`' instead of
':raw-latex:`\\r`:raw-latex:`\\n`'.""",
r"""record delimiters are ``\\\\\\\\n`` instead of
``\\\\\\\\r\\\\\\\\n``.""",)
# ----------------------------------------------------------------------------
# Add templated files
# ----------------------------------------------------------------------------
Expand Down

0 comments on commit f74ee83

Please sign in to comment.