diff --git a/api/documentation/gen-nav.py b/api/documentation/gen-nav.py new file mode 100644 index 0000000..4f63b64 --- /dev/null +++ b/api/documentation/gen-nav.py @@ -0,0 +1,52 @@ +""" Generate a YAML representation of a directory structure for mkdocs nav config + mkocs nav Docs: https://www.mkdocs.org/user-guide/writing-your-docs/#file-layout + Inpsire by: https://github.com/mkdocs/mkdocs/issues/714#issuecomment-626226113 +""" + +import yaml +import os +from pprint import pprint + +################################################################################ +# Configuration +################################################################################ +mkdocs_config_file = "mkdocs.yml" + + +################################################################################ +# Helper Functions +################################################################################ +def dir_to_dict(path): + directory = {} + for dirname, dirnames, filenames in os.walk(path): + dn = os.path.basename(dirname) + directory[dn] = [] + + if dirnames: + for d in dirnames: + directory[dn].append(dir_to_dict(path=os.path.join(path, d))) + for f in filenames: + directory[dn].append(f) + else: + directory[dn] = filenames + + return directory + + + +################################################################################ +# Script +################################################################################ + +if __name__ == "__main__": + + rootdir = './docs' + dir_tree = dir_to_dict(rootdir) + yaml_dir_tree = yaml.dump(dir_tree) + print(yaml_dir_tree) + + # with open(mkdocs_config_file) as config_file: + # mkdocs_config = yaml.full_load(config_file) + + # with open(mkdocs_config_file, "w") as config_file: + # config_dump = yaml.dump(mkdocs_config, config_file) \ No newline at end of file diff --git a/api/documentation/mkdocs.yml.bak b/api/documentation/mkdocs.yml.bak new file mode 100644 index 0000000..60c50b1 --- /dev/null +++ b/api/documentation/mkdocs.yml.bak @@ -0,0 +1,66 @@ +################################################################################ +# mkdocs Settings +# See: https://www.mkdocs.org/user-guide/configuration/ +################################################################################ + +site_name: webqueue2 API +repo_url: https://github.itap.purdue.edu/ECN/webqueue2 +plugins: + - search +markdown_extensions: + - toc: + permalink: ⚓︎ + - admonition + - pymdownx.details + - pymdownx.superfences + - pymdownx.highlight: + use_pygments: false + - pymdownx.inlinehilite + - pymdownx.tabbed + - pymdownx.emoji: + emoji_index: !!python/name:materialx.emoji.twemoji + emoji_generator: !!python/name:materialx.emoji.to_svg + - mkautodoc + + + +################################################################################ +# Material for mkdocs Settings +# See: https://squidfunk.github.io/mkdocs-material/setup/changing-the-colors/ +################################################################################ + +# TODO: Implement offline search +# See: https://squidfunk.github.io/mkdocs-material/setup/setting-up-site-search/#offline-search +# TODO: Implement versioning +# See: https://squidfunk.github.io/mkdocs-material/setup/setting-up-versioning/#versioning + +theme: + name: material + palette: + # Used to toggle dark mode. + # scheme: slate + primary: deep purple + accent: teal + icon: + logo: material/book-open + # The favicon is symlinked from the ReactJS public folder + favicon: images/favicon.ico + features: + - navigation.sections + +extra: + social: + - icon: fontawesome/brands/slack + link: https://purdueecn.slack.com/archives/C019K7PSPNW + name: webqueue2 on Slack + - icon: fontawesome/brands/github + link: https://github.itap.purdue.edu/ECN/webqueue2 + name: webqueue2 on GitHub + +extra_javascript: + - https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js + - javascript/highlight.js + - https://cdnjs.cloudflare.com/ajax/libs/tablesort/5.2.1/tablesort.min.js + - javascript/tablesort.js +extra_css: + - https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/default.min.css \ No newline at end of file