chore: allow passing commit hash through inputs
All checks were successful
Compile manual / ci (pull_request) Successful in 1m45s

This commit is contained in:
2026-07-07 19:07:52 +02:00
parent 496413415f
commit 9fdc003a71
4 changed files with 745 additions and 736 deletions

View File

@@ -37,6 +37,7 @@ jobs:
typst compile \ typst compile \
--root . \ --root . \
--font-path ~/.fontist/fonts \ --font-path ~/.fontist/fonts \
--input hash=${{ gitea.sha }} \
docs/manual.typ \ docs/manual.typ \
docs/manual.pdf docs/manual.pdf

File diff suppressed because it is too large Load Diff

View File

@@ -8,8 +8,17 @@
#import "@preview/gentle-clues:1.3.1" as gc #import "@preview/gentle-clues:1.3.1" as gc
#let midas-version = toml("../pyproject.toml").project.version #let midas-version = toml("../pyproject.toml").project.version
#let head-ref = read("../.git/HEAD").split(":").at(1).trim()
#let commit-hash = read("../.git/" + head-ref).slice(0, 8) #let commit-hash = if "hash" in sys.inputs {
sys.inputs.hash.slice(0, 8)
} else {
let head-ref = read("../.git/HEAD").split(":").at(1, default: "").trim()
if head-ref.len() != 0 {
read("../.git/" + head-ref).slice(0, 8)
} else {
none
}
}
#show: project.with( #show: project.with(
title: [Midas User Manual], title: [Midas User Manual],

View File

@@ -52,7 +52,7 @@
title: none, title: none,
author: none, author: none,
version: "0.0.1", version: "0.0.1",
hash: "abcdefgh", hash: none,
icon-path: none, icon-path: none,
doc, doc,
) = { ) = {
@@ -69,13 +69,17 @@
set raw(syntaxes: path("midas.sublime-syntax")) set raw(syntaxes: path("midas.sublime-syntax"))
let front-page() = { let front-page() = {
let version-name = [v#version]
if hash != none {
version-name = [#version-name - #hash]
}
align(center)[ align(center)[
#{ #{
set text(size: 1.5em) set text(size: 1.5em)
std.title() std.title()
} }
v#version - #hash #version-name
#if icon-path != none { #if icon-path != none {
v(1cm) v(1cm)