Skip to content

Commit

Permalink
better script
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Feb 19, 2024
1 parent 89c4900 commit ba989c3
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions docs/scripts/mkdocs_tx.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ def read_config(file_path: str):
def nav_config(config):
_nav_config = []

def add_nav_entry(_title, _content):
if type(_content) == str:
_nav_config.append(_title)
else:
for _entry in _content:
for title, content in _entry.items():
add_nav_entry(title, content)
def add_nav_entry(title, content):
if title:
_nav_config.append(title)
for _entry in content:
if type(_entry) == str:
# this is pointing to a page directly, skipping
continue
for _title, _content in _entry.items():
add_nav_entry(_title, _content)

add_nav_entry(None, config["nav"])

Expand Down

0 comments on commit ba989c3

Please sign in to comment.