From fea67022a933d8c55b89c1c96bc3a62661c1fd6e Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 19 Oct 2025 11:12:21 +0900 Subject: first commit --- .envrc | 5 +++ .gitignore | 1 + assets/deco.svg | 27 +++++++++++++ assets/me.svg | 61 ++++++++++++++++++++++++++++ flake.lock | 64 ++++++++++++++++++++++++++++++ flake.nix | 21 ++++++++++ justfile | 2 + setoka.typ | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ slides.typ | 27 +++++++++++++ 9 files changed, 328 insertions(+) create mode 100644 .envrc create mode 100644 .gitignore create mode 100644 assets/deco.svg create mode 100644 assets/me.svg create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 justfile create mode 100644 setoka.typ create mode 100644 slides.typ diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..2fe7020 --- /dev/null +++ b/.envrc @@ -0,0 +1,5 @@ +# shellcheck shell=bash +if ! has nix_direnv_version || ! nix_direnv_version 3.1.0; then + source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.1.0/direnvrc" "sha256-yMJ2OVMzrFaDPn7q8nCBZFRYpL/f0RcHzhmw/i6btJM=" +fi +use flake diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9b6fc77 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/slides.pdf diff --git a/assets/deco.svg b/assets/deco.svg new file mode 100644 index 0000000..2071659 --- /dev/null +++ b/assets/deco.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/me.svg b/assets/me.svg new file mode 100644 index 0000000..3eebcd7 --- /dev/null +++ b/assets/me.svg @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..dc73124 --- /dev/null +++ b/flake.lock @@ -0,0 +1,64 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": [ + "systems" + ] + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1760596604, + "narHash": "sha256-J/i5K6AAz/y5dBePHQOuzC7MbhyTOKsd/GLezSbEFiM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3cbe716e2346710d6e1f7c559363d14e11c32a43", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "systems": "systems" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..3bc1509 --- /dev/null +++ b/flake.nix @@ -0,0 +1,21 @@ +{ + description = "A basic flake with a shell"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + inputs.systems.url = "github:nix-systems/default"; + inputs.flake-utils = { + url = "github:numtide/flake-utils"; + inputs.systems.follows = "systems"; + }; + + outputs = + { nixpkgs, flake-utils, ... }: + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + { + devShells.default = pkgs.mkShell { packages = [ pkgs.typst ]; }; + } + ); +} diff --git a/justfile b/justfile new file mode 100644 index 0000000..0a01ca2 --- /dev/null +++ b/justfile @@ -0,0 +1,2 @@ +build: + typst compile slides.typ diff --git a/setoka.typ b/setoka.typ new file mode 100644 index 0000000..5dffea8 --- /dev/null +++ b/setoka.typ @@ -0,0 +1,120 @@ +#import "@preview/touying:0.6.1": * + +#let slide(..args) = touying-slide-wrapper(self => { + let header(self) = { + set align(top) + set text(size: 0.3em) + place( + left + top, + dx: 0.7em, + dy: 0.7em, + image("./assets/deco.svg", width: 2em, height: 2em), + ) + place( + left + top, + dx: 3em, + dy: 0.7em, + image("./assets/deco.svg", width: 1em, height: 1em), + ) + } + let footer(self) = { + set align(bottom) + set text(fill: self.colors.neutral-darkest, size: 0.3em) + pad(x: 0.7em, y: 0.7em, { + h(1fr) + context utils.slide-counter.display() + " / " + utils.last-slide-number + }) + } + self = utils.merge-dicts( + self, + config-page( + header: header, + footer: footer, + ), + ) + touying-slide(self: self, ..args) +}) + +#let title-slide(..args) = touying-slide-wrapper(self => { + let info = self.info + args.named() + let body = { + set align(center) + components.cell( + fill: self.colors.neutral-darkest, + width: 100%, + height: 50%, + inset: 0.5em, + components.cell( + width: 80%, + height: 100%, + { + set align(bottom) + set text(size: 1em, fill: self.colors.neutral-lightest, weight: "bold") + info.title + }, + ), + ) + components.cell( + width: 100%, + height: 50%, + { + set align(horizon) + set text(fill: self.colors.neutral-darkest, size: 0.5em) + if info.author != none { + block(info.author) + } + block() + if info.subtitle != none { + block(info.subtitle) + } + if info.date != none { + block(utils.display-info-date(self)) + } + }, + ) + } + self = utils.merge-dicts( + self, + config-page( + margin: 0pt, + ), + ) + touying-slide(self: self, body) +}) + +#let about-slide(..args) = slide({ + set align(center + horizon) + [ + #text(size: 0.4em)[いまむら] \ + #text(size: 0.9em)[nsfisis] \ + ] + image("./assets/me.svg", width: 2em, height: 2em) +}) + +#let setoka-theme( + aspect-ratio: "16-9", + footer: none, + ..args, + body, +) = { + set text(size: 48pt) + + show: touying-slides.with( + config-page( + paper: "presentation-" + aspect-ratio, + margin: 2em, + ), + config-common( + slide-fn: slide, + slide-level: 0, + ), + config-colors( + primary: rgb("#ffa500"), + neutral-lightest: white, + neutral-darkest: black, + ), + ..args, + ) + + body +} diff --git a/slides.typ b/slides.typ new file mode 100644 index 0000000..3bf2fa9 --- /dev/null +++ b/slides.typ @@ -0,0 +1,27 @@ +#import "@preview/touying:0.6.1": * +#import "setoka.typ": * + +#show: setoka-theme.with( + aspect-ratio: "16-9", + config-info( + title: [ + 浮動小数点数の半開区間で \ + 単一値を指定する + ], + subtitle: [PHP 勉強会\@東京 第 180 回], + author: [nsfisis (いまむら)], + date: datetime(year: 2025, month: 10, day: 29), + ), +) + +#set text(font: "Noto Sans CJK JP") + +#title-slide() + +#about-slide() + +Hoge + +--- + +Piyo -- cgit v1.2.3-70-g09d2