Skip to content

Commit

Permalink
update extra_docs
Browse files Browse the repository at this point in the history
  • Loading branch information
j042 committed Dec 11, 2023
1 parent 5a5545f commit aa0b3b9
Showing 1 changed file with 15 additions and 18 deletions.
33 changes: 15 additions & 18 deletions docs/source/extra_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@
if __name__ == "__main__":
here = os.path.dirname(os.path.abspath(__file__))

# here = pathlib.Path(__file__).parent.resolve()
# create md dir
md_path = os.path.abspath(os.path.join(here, "..", "md"))
# (here / "../md").resolve().mkdir(parents=True, exist_ok=True)
os.makedirs(md_path, exist_ok=True)

# 1. Show options.
Expand All @@ -25,19 +23,18 @@
derived = gus.helpers.options.ShowOption.__subclasses__()
for cls in derived:
f.write(f"## {cls.__qualname__}\n\n")
for backend, options in cls._valid_options.items():
f.write(f"### {backend}\n\n")
for option in options.values():
t_str = str(option.allowed_types)
t_str = (
t_str.replace("<class", "")
.replace("'", "")
.replace(">", "")
)
f.write(
f"<details><summary><strong>{option.key}"
"</strong></summary><p>\n"
)
f.write(f"\n{option.description} \n")
f.write(f"- _allowed types_: {t_str} \n")
f.write("</p></details> \n\n")
for option in cls._valid_options.values():
t_str = str(option.allowed_types)
t_str = (
t_str.replace("<class", "")
.replace("'", "")
.replace(">", "")
)
f.write(
f"<details><summary><strong>{option.key}"
"</strong></summary><p>\n"
)
f.write(f"\n{option.description} \n")
f.write(f"- _allowed types_: {t_str} \n")
f.write(f"- _default_: {option.default} \n")
f.write("</p></details> \n\n")

0 comments on commit aa0b3b9

Please sign in to comment.