aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/tools/docs/parser.py
diff options
context:
space:
mode:
authorGravatar Mark Daoust <markdaoust@google.com>2018-08-14 13:30:16 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-08-14 13:33:25 -0700
commitd576b76bf517737e1914d4d593a46e02c62dc286 (patch)
tree834f7a1d3d1560962272caa43e24f790d6e91d72 /tensorflow/tools/docs/parser.py
parent3c12d001f08c770382c054688a12ad8d70c6296e (diff)
Add doc control decorators to the api-generator.
There are two primary goals here. First: This gives us a starting point to cleanup/remove the "private_map" and "do_not_descend" map from `generate_lib.py`. Replacing them with local decorators. The primary reason for these in the first place is to deal with unsealed modules (The docs generator will crawl anything it can reach). Second: This gives us options for splitting documentation output between "Users" and "Subclass Implementers". There are many "public" functions that you do not need to know about unless you are interested in implementing a sub-class. These only make sense to document on the base class "Layer", "Model", "Metric". PiperOrigin-RevId: 208701899
Diffstat (limited to 'tensorflow/tools/docs/parser.py')
-rw-r--r--tensorflow/tools/docs/parser.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/tensorflow/tools/docs/parser.py b/tensorflow/tools/docs/parser.py
index ffb93027ed..801c8bcb4a 100644
--- a/tensorflow/tools/docs/parser.py
+++ b/tensorflow/tools/docs/parser.py
@@ -32,6 +32,7 @@ import six
from google.protobuf.message import Message as ProtoMessage
from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.util import tf_inspect
+from tensorflow.tools.docs import doc_controls
# A regular expression capturing a python identifier.
@@ -1175,15 +1176,18 @@ class _ClassPageInfo(object):
# Don't document anything that is defined in object or by protobuf.
defining_class = _get_defining_class(py_class, short_name)
- if (defining_class is object or
- defining_class is type or defining_class is tuple or
- defining_class is BaseException or defining_class is Exception or
- # The following condition excludes most protobuf-defined symbols.
- defining_class and defining_class.__name__ in ['CMessage', 'Message',
- 'MessageMeta']):
+ if defining_class in [object, type, tuple, BaseException, Exception]:
+ continue
+
+ # The following condition excludes most protobuf-defined symbols.
+ if (defining_class and
+ defining_class.__name__ in ['CMessage', 'Message', 'MessageMeta']):
continue
# TODO(markdaoust): Add a note in child docs showing the defining class.
+ if doc_controls.should_skip_class_attr(py_class, short_name):
+ continue
+
child_doc = _parse_md_docstring(child, relative_path,
parser_config.reference_resolver)