aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/tools/docs
diff options
context:
space:
mode:
authorGravatar Mark Daoust <markdaoust@google.com>2018-04-11 09:50:40 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-04-11 09:52:21 -0700
commit08a12ca6016c34d9476d2e93bd0f2dc9ae60abc5 (patch)
tree4418af8d62a6b742fb483b70bda9c9b6b87e2e22 /tensorflow/tools/docs
parenta9a3b98a76f1d4a8fb7a02e451fb71147a842f31 (diff)
Add a clear error message for when a doc does not have a title.
PiperOrigin-RevId: 192463583
Diffstat (limited to 'tensorflow/tools/docs')
-rw-r--r--tensorflow/tools/docs/generate_lib.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tensorflow/tools/docs/generate_lib.py b/tensorflow/tools/docs/generate_lib.py
index 34dd419f15..9cc261d7dd 100644
--- a/tensorflow/tools/docs/generate_lib.py
+++ b/tensorflow/tools/docs/generate_lib.py
@@ -308,6 +308,10 @@ def build_doc_index(src_dir):
continue
title_parser = _GetMarkdownTitle()
title_parser.process(os.path.join(dirpath, base_name))
+ if title_parser.title is None:
+ msg = ('`{}` has no markdown title (# title)'.format(
+ os.path.join(dirpath, base_name)))
+ raise ValueError(msg)
key_parts = os.path.join(suffix, base_name[:-3]).split('/')
if key_parts[-1] == 'index':
key_parts = key_parts[:-1]