feat(datasheet): use mustache for shuttle_index

This commit is contained in:
htfab
2024-05-06 23:21:17 +03:00
committed by Uri Shaked
parent 2246e7882a
commit 6ee5119ca2
3 changed files with 14 additions and 11 deletions
-6
View File
@@ -1,6 +0,0 @@
# {name}
This repository contains the GDS file for the [{name}](https://tinytapeout.com) project. It was generated from {git_repo}@{git_commit}.
## Project Index
+6
View File
@@ -0,0 +1,6 @@
# {{name}}
This repository contains the GDS file for the [{{name}}](https://tinytapeout.com) project. It was generated from {{git_repo}}@{{git_commit}}.
## Project Index
+8 -5
View File
@@ -24,13 +24,16 @@ class Docs:
def build_index(self, filename: str = "shuttle_index.md"):
logging.info(f"building {filename}")
repo = git.Repo(".")
readme = self.load_doc_template("shuttle_index_header.md")
readme = self.load_doc_template("shuttle_index_header.md.mustache")
with open(filename, "w") as fh:
fh.write(
readme.format(
name=self.config["name"],
git_repo=get_first_remote(repo),
git_commit=repo.head.commit.hexsha,
chevron.render(
readme,
{
"name": self.config["name"],
"git_repo": get_first_remote(repo),
"git_commit": repo.head.commit.hexsha,
},
)
)
fh.write("| Address | Author | Title | Type | Git Repo |\n")