Skip to content

Commit a3fbfca

Browse files
MarkDaoustcopybara-github
authored andcommitted
Move special case out of library into user-script.
PiperOrigin-RevId: 438814932
1 parent 10313cb commit a3fbfca

File tree

2 files changed

+0
-17
lines changed

2 files changed

+0
-17
lines changed

tools/tensorflow_docs/api_generator/generate_lib.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"""Generate tensorflow.org style API Reference docs for a Python module."""
1616

1717
import collections
18-
import importlib
1918
import inspect
2019
import os
2120
import pathlib
@@ -576,24 +575,11 @@ def write_docs(
576575
toc_gen = GenerateToc(module_children)
577576
toc_dict = toc_gen.generate()
578577

579-
# Replace the overview path *only* for 'TensorFlow' to
580-
# `/api_docs/python/tf_overview`. This will be redirected to
581-
# `/api_docs/python/tf`.
582-
toc_values = toc_dict['toc'][0]
583-
if toc_values['title'] == 'tf':
584-
section = toc_values['section'][0]
585-
section['path'] = str(site_path / 'tf_overview')
586-
587578
leftnav_toc = output_dir / root_module_name / '_toc.yaml'
588579
with open(leftnav_toc, 'w') as toc_file:
589580
yaml.dump(toc_dict, toc_file, default_flow_style=False)
590581

591582
if redirects and gen_redirects:
592-
if yaml_toc and toc_values['title'] == 'tf':
593-
redirects.append({
594-
'from': str(site_path / 'tf_overview'),
595-
'to': str(site_path / 'tf'),
596-
})
597583
redirects_dict = {
598584
'redirects': sorted(redirects, key=lambda redirect: redirect['from'])
599585
}

tools/tensorflow_docs/api_generator/generate_lib_test.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,6 @@ def test_write(self):
114114
'redirects': [{
115115
'from': '/api_docs/python/tf/test_function',
116116
'to': '/api_docs/python/tf/TestModule/test_function'
117-
}, {
118-
'from': '/api_docs/python/tf_overview',
119-
'to': '/api_docs/python/tf'
120117
}]
121118
})
122119

0 commit comments

Comments
 (0)