Skip to content

Commit

Permalink
Move all symbols to the top of the left nav.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 286620058
  • Loading branch information
yashk2810 authored and copybara-github committed Dec 20, 2019
1 parent 34140b1 commit 83b2b0f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 4 additions & 2 deletions site/en/api_docs/_book.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,12 @@ upper_tabs:
- name: Python
skip_translation: true
contents:
- title: Python {VERSION}
- include: {VERSION_ROOT}/python/_toc.yaml
- title: Overview
path: {VERSION_ROOT}/python/tf
- title: All Symbols
path: {VERSION_ROOT}/python/
- title: Python {VERSION}
- include: {VERSION_ROOT}/python/_toc.yaml

- name: JavaScript
contents:
Expand Down
8 changes: 8 additions & 0 deletions tools/tensorflow_docs/api_generator/generate_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,14 @@ def write_docs(output_dir,
toc_gen = GenerateToc(module_children)
toc_dict = toc_gen.generate()

# Replace the overview path *only* for 'TensorFlow' to
# `/api_docs/tf_overview`. This will be redirected to `/api_docs/python/tf`.
toc_values = toc_dict['toc'][0]
if toc_values['title'] == 'tf':
section = toc_values['section'][0]
if '/versions/' not in section['path']:
section['path'] = '/api_docs/tf_overview'

leftnav_toc = os.path.join(output_dir, '_toc.yaml')
with open(leftnav_toc, 'w') as toc_file:
yaml.dump(toc_dict, toc_file, default_flow_style=False)
Expand Down

0 comments on commit 83b2b0f

Please sign in to comment.