diff options
author | Ken Payson <kpayson@google.com> | 2016-07-11 11:09:27 -0700 |
---|---|---|
committer | Ken Payson <kpayson@google.com> | 2016-07-12 10:43:27 -0700 |
commit | f7f47a6d26b19898f5824845bce30e18856eb58d (patch) | |
tree | da6b852b23745bc0fb66acc0c139c616cb5c753a /src/python/grpcio/commands.py | |
parent | 76c929606e98033164c316aa76a9b9bbb3d8f9df (diff) |
Added Glossary to docs with metadata definition
Diffstat (limited to 'src/python/grpcio/commands.py')
-rw-r--r-- | src/python/grpcio/commands.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/python/grpcio/commands.py b/src/python/grpcio/commands.py index 3f91954d5f..904fd81bc7 100644 --- a/src/python/grpcio/commands.py +++ b/src/python/grpcio/commands.py @@ -62,6 +62,26 @@ napoleon_numpy_docstring = True html_theme = 'sphinx_rtd_theme' """ +API_GLOSSARY = """ + +Glossary +================ + +.. glossary:: + + metadatum + A key-value pair included in the HTTP header. It is a + 2-tuple where the first entry is the key and the + second is the value, i.e. (key, value). The metadata key is an ASCII str, + and must be a valid HTTP header name. The metadata value can be + either a valid HTTP ASCII str, or bytes. If bytes are provided, + the key must end with '-bin', i.e. + ``('binary-metadata-bin', b'\\x00\\xFF')`` + + metadata + A sequence of metadatum. +""" + class CommandError(Exception): """Simple exception class for GRPC custom commands.""" @@ -131,6 +151,9 @@ class SphinxDocumentation(setuptools.Command): conf_filepath = os.path.join('doc', 'src', 'conf.py') with open(conf_filepath, 'a') as conf_file: conf_file.write(CONF_PY_ADDENDUM) + glossary_filepath = os.path.join('doc', 'src', 'grpc.rst') + with open(glossary_filepath, 'a') as glossary_filepath: + glossary_filepath.write(API_GLOSSARY) sphinx.main(['', os.path.join('doc', 'src'), os.path.join('doc', 'build')]) |