Generate corresponding grpc_types.h link

pull/22745/head
Lidi Zheng 5 years ago
parent d3805e1b6c
commit 6b2239ed40
  1. 13
      doc/python/sphinx/conf.py
  2. 7
      doc/python/sphinx/glossary.rst

@ -28,13 +28,17 @@ sys.path.insert(0, os.path.join(PYTHON_FOLDER, 'grpcio_testing'))
# -- Project information ----------------------------------------------------- # -- Project information -----------------------------------------------------
project = 'gRPC Python' project = 'gRPC Python'
copyright = '2018, The gRPC Authors' copyright = '2020, The gRPC Authors'
author = 'The gRPC Authors' author = 'The gRPC Authors'
# Import generated grpc_version after the path been modified # Import generated grpc_version after the path been modified
import grpc_version import grpc_version
version = ".".join(grpc_version.VERSION.split(".")[:3]) version = '.'.join(grpc_version.VERSION.split('.')[:3])
release = grpc_version.VERSION release = grpc_version.VERSION
if 'dev' in grpc_version.VERSION:
branch = 'master'
else:
branch = 'v%s.%s.x' % tuple(grpc_version.VERSION.split('.')[:2])
# -- General configuration --------------------------------------------------- # -- General configuration ---------------------------------------------------
@ -54,6 +58,7 @@ extensions = [
'sphinx.ext.napoleon', 'sphinx.ext.napoleon',
'sphinx.ext.coverage', 'sphinx.ext.coverage',
'sphinx.ext.autodoc.typehints', 'sphinx.ext.autodoc.typehints',
'sphinx.ext.extlinks',
] ]
napoleon_google_docstring = True napoleon_google_docstring = True
@ -100,3 +105,7 @@ epub_exclude_files = ['search.html']
# -- Options for todo extension ---------------------------------------------- # -- Options for todo extension ----------------------------------------------
todo_include_todos = True todo_include_todos = True
# -- Options for substitutions -----------------------------------------------
rst_epilog = '.. |grpc_types_link| replace:: https://github.com/grpc/grpc/blob/%s/include/grpc/impl/codegen/grpc_types.h' % branch

@ -44,7 +44,6 @@ Glossary
A list of key-value pairs to configure the underlying gRPC Core channel or A list of key-value pairs to configure the underlying gRPC Core channel or
server object. Channel arguments are meant for advanced usages. Full list server object. Channel arguments are meant for advanced usages. Full list
channel arguments can be found under the "grpc_arg_keys" section of channel arguments can be found under the "grpc_arg_keys" section of
`grpc_types.h "grpc_types.h" header file (|grpc_types_link|). For example, if you want to disable TCP port
<https://github.com/grpc/grpc/blob/master/include/grpc/impl/codegen/grpc_types.h>`_ reuse, you may construct channel arguments like: ``options =
header file. For example, if you want to disable TCP port reuse, you may (('grpc.so_reuseport', 0),)``.
construct channel arguments like: ``options = (('grpc.so_reuseport', 0),)``.

Loading…
Cancel
Save