diff options
author | Mark Daoust <markdaoust@google.com> | 2018-05-23 13:55:32 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-05-23 13:58:24 -0700 |
commit | 190d2d57bc8d2e3f43fbe6cbf649d878efdff878 (patch) | |
tree | 970ed885754b5fec7eb8877daa5bc93756b7c28b /tensorflow/tools/docs | |
parent | 0920a3c59ee85d1917e27fc69ed5cbd8e4b7a6c4 (diff) |
Clear docstrings for auto-generated module files, and detach github links from generated files.
PiperOrigin-RevId: 197783520
Diffstat (limited to 'tensorflow/tools/docs')
-rw-r--r-- | tensorflow/tools/docs/parser.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tensorflow/tools/docs/parser.py b/tensorflow/tools/docs/parser.py index 7363e4f8b5..50c9052741 100644 --- a/tensorflow/tools/docs/parser.py +++ b/tensorflow/tools/docs/parser.py @@ -615,6 +615,9 @@ def _parse_md_docstring(py_object, relative_path_to_root, reference_resolver): docstring, compatibility = _handle_compatibility(raw_docstring) docstring, function_details = _parse_function_details(docstring) + if 'Generated by: tensorflow/tools/api/generator' in docstring: + docstring = '' + return _DocstringInfo( docstring.split('\n')[0], docstring, function_details, compatibility) @@ -1597,7 +1600,8 @@ class _GeneratedFile(object): return True def __str__(self): - return 'Defined in `%s%s`.\n\n' % (self.path_prefix, self.path) + return 'Defined in generated file: `%s%s`.\n\n' % (self.path_prefix, + self.path) def _get_defined_in(py_object, parser_config): @@ -1634,6 +1638,8 @@ def _get_defined_in(py_object, parser_config): if re.match(r'.*/gen_[^/]*\.py$', path): return _GeneratedFile(path, parser_config) + if 'genfiles' in path or 'tools/api/generator' in path: + return _GeneratedFile(path, parser_config) elif re.match(r'.*_pb2\.py$', path): # The _pb2.py files all appear right next to their defining .proto file. return _ProtoFile(path[:-7] + '.proto', parser_config) |