Skip to content

Commit

Permalink
feat(datasheet): use mustache for shuttle_index
Browse files Browse the repository at this point in the history
  • Loading branch information
htfab committed May 6, 2024
1 parent f095b9d commit a2c7055
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
6 changes: 0 additions & 6 deletions docs/shuttle_index_header.md

This file was deleted.

6 changes: 6 additions & 0 deletions docs/shuttle_index_header.md.mustache
Original file line number Diff line number Diff line change
@@ -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

13 changes: 8 additions & 5 deletions documentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,16 @@ def __init__(self, config: Config, projects: List[Project]):
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")
Expand Down

0 comments on commit a2c7055

Please sign in to comment.