Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
#!/bin/bash

echo "Building..."
# Get repo URL
REPOSITORY=`git remote -v | grep fetch | tail -1 | \
sed "s|.*\(github.com\):|https://\1/|g" | \
sed "s/\(.git\)\? (.*//g" | \
sed "s|.*\(https://github.com/\)|\1|g" | \
sed "s|.*\(https://github.com/\)|\1|g"`

echo "Repository set to '$REPOSITORY'"

# loop through all the files in the directory:
for file in src/*.typ
do
# run the compiler
typst compile --format=pdf "$file" --font-path src/fonts
typst compile --format=pdf "$file" --font-path src/fonts --input "repository=$REPOSITORY"
done

echo "... Done!"
3 changes: 1 addition & 2 deletions src/audit.typ
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
#show: report.with(
client: "XXXXX",
title: "XXXXX",
repo: "XXXXX",
date: "XXXXX",
// date: "XXXXX", // Default: Today.
audited_files: audited_files,
)

Expand Down
6 changes: 4 additions & 2 deletions src/templates/report.typ
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
link(url, underline(text(fill: rgb("#007bff"), content)))
}

#let repository = sys.inputs.at("repository", default: "GitHub remote")

#let create_table = (tuples) => {
table(
columns: 1,
Expand Down Expand Up @@ -53,9 +55,9 @@
client: "",
title: "",
authors: (),
date: none,
date: datetime.today().display("[day] [month repr:long] [year]"),
audited_files: (),
repo: "",
repo: repository,
is_draft: true,
body,
) = {
Expand Down