From a90680ff4f1878046e9b2dfdf26e7a3a3ebe0c9a Mon Sep 17 00:00:00 2001 From: htfab Date: Mon, 6 May 2024 14:14:23 +0200 Subject: [PATCH] feat(datasheet): use mustache for shuttle_index --- docs/shuttle_index_header.md | 6 ------ docs/shuttle_index_header.md.mustache | 6 ++++++ documentation.py | 13 ++++++++----- 3 files changed, 14 insertions(+), 11 deletions(-) delete mode 100644 docs/shuttle_index_header.md create mode 100644 docs/shuttle_index_header.md.mustache diff --git a/docs/shuttle_index_header.md b/docs/shuttle_index_header.md deleted file mode 100644 index 5562f4c..0000000 --- a/docs/shuttle_index_header.md +++ /dev/null @@ -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 - diff --git a/docs/shuttle_index_header.md.mustache b/docs/shuttle_index_header.md.mustache new file mode 100644 index 0000000..5ccebe7 --- /dev/null +++ b/docs/shuttle_index_header.md.mustache @@ -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 + diff --git a/documentation.py b/documentation.py index 87ad5c4..ae7cef9 100644 --- a/documentation.py +++ b/documentation.py @@ -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")