summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2023-03-23 16:39:19 +0700
committerGitHub <[email protected]>2023-03-23 16:39:19 +0700
commit7440782afb8841332005000aa72241300ddccd53 (patch)
tree130f6ffc6ea1fe3678ee024bab1e9987b47dea46 /tools
parentcd0fdc32644f21a4946563c065c9bddfa32d60ee (diff)
parentf80d11301ea03746d86dd64c651b31bd600772f7 (diff)
Merge pull request #1975 from hathach/update-doc
update doc and generate deps list
Diffstat (limited to 'tools')
-rw-r--r--tools/gen_doc.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/tools/gen_doc.py b/tools/gen_doc.py
new file mode 100644
index 000000000..db11e2cfb
--- /dev/null
+++ b/tools/gen_doc.py
@@ -0,0 +1,33 @@
+import pandas as pd
+from tabulate import tabulate
+from pathlib import Path
+from get_deps import deps_all
+
+# TOP is tinyusb root dir
+TOP = Path(__file__).parent.parent.resolve()
+
+###########################################
+# Dependencies
+###########################################
+def gen_deps_doc():
+ deps_rst = Path(TOP) / "docs/reference/dependencies.rst"
+ df = pd.DataFrame.from_dict(deps_all, orient='index', columns=['Commit', 'Project'])
+ df = df[['Project', 'Commit']].sort_index()
+ df = df.rename_axis("Path")
+
+ outstr = f"""\
+************
+Dependencies
+************
+
+MCU low-level peripheral driver and external libraries for building TinyUSB examples
+
+{tabulate(df, headers="keys", tablefmt='rst')}
+"""
+
+ with deps_rst.open('w') as f:
+ f.write(outstr)
+
+
+if __name__ == "__main__":
+ gen_deps_doc()