ci: autogen-banner #118

Merged
servostar merged 8 commits from ci/autogen-banner into main 2024-11-30 19:04:14 +00:00
6 changed files with 92 additions and 0 deletions
Showing only changes of commit 2cc6ea93a8 - Show all commits

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
*.pdf
*.log
images/

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 MiB

After

Width:  |  Height:  |  Size: 638 KiB

59
baker/banner.typ Normal file
View File

@ -0,0 +1,59 @@
#import "@preview/shadowed:0.1.2": shadowed
#let LE = 10cm
#let shadow = 0.25cm
#set page(margin: 0pt, width: 2 * LE, height: LE, fill: rgb(0, 0, 0, 0))
#place(
dx: 3cm,
dy: 1.1cm,
rotate(
-9deg,
shadowed(
radius: 0pt,
inset: 0pt,
blur: shadow,
image("./images/21.svg", height: LE * 0.6))))
#place(
dx: 1cm,
dy: 3.25cm,
rotate(
-20deg,
shadowed(
radius: 0pt,
inset: 0pt,
blur: shadow,
image("./images/51.svg", height: LE * 0.55))))
#place(
dx: 14cm,
dy: 1.5cm,
rotate(
6deg,
shadowed(
radius: 0pt,
inset: 0pt,
blur: shadow,
image("./images/41.svg", height: LE * 0.65))))
#place(
dx: 11cm,
dy: 2cm,
rotate(
25deg,
shadowed(
radius: 0pt,
inset: 0pt,
blur: shadow,
image("./images/31.svg", height: LE * 0.6))))
#place(
dx: 7cm,
dy: 0.75cm,
shadowed(
radius: 0pt,
inset: 0pt,
blur: shadow,
image("./images/11.svg", height: LE * 0.75)))

12
baker/run-bake-banner.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
mkdir images
# extract images from document created by action
mutool convert -o images/1.svg "$1" 1
mutool convert -o images/2.svg "$1" 2
mutool convert -o images/3.svg "$1" 5
mutool convert -o images/4.svg "$1" 15
mutool convert -o images/5.svg "$1" 16
typst compile banner.typ --ppi 220 ../assets/banner.png

14
baker/shell.nix Normal file
View File

@ -0,0 +1,14 @@
let
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-unstable";
pkgs = import nixpkgs { config = {}; overlays = []; };
in
pkgs.mkShellNoCC {
packages = with pkgs; [
python312
python312Packages.pyyaml
typst
typstyle
mupdf-headless
];
}

6
run-bake-assets.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
cd baker
echo "==> generate banner image"
nix-shell --run "./run-bake-banner.sh ../example.pdf"