Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package script updates #322

Merged
merged 3 commits into from
Nov 10, 2023
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
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ jobs:
- uses: yusancky/setup-typst@v2
id: setup-typst
with:
version: 'v0.8.0'
version: 'v0.9.0'
- run: |
just install
just install @local
just install @preview
just test
just manual
just gallery
Binary file modified gallery/barchart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified gallery/karls-picture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions gallery/karls-picture.typ
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

for (x, ct) in ((-1, $ -1 $), (-0.5, $ -1/2 $), (1, $ 1 $)) {
line((x, 3pt), (x, -3pt))
content((), anchor: "above", ct)
content((), anchor: "north", ct)
}

for (y, ct) in ((-1, $ -1 $), (-0.5, $ -1/2 $), (0.5, $ 1/2 $), (1, $ 1 $)) {
Expand All @@ -47,9 +47,9 @@
set-style(stroke: (thickness: 1.2pt))

line((30deg, 1), ((), "|-", (0,0)), stroke: (paint: red), name: "sin")
content("sin", text(red)[$ sin alpha $], anchor: "east")
content(("sin.start", .5, "sin.end"), text(red)[$ sin alpha $])
line("sin.end", (0,0), stroke: (paint: blue), name: "cos")
content("cos", text(blue)[$ cos alpha $], anchor: "north")
content(("cos.start", .5, "cos.end"), text(blue)[$ cos alpha $], anchor: "north")
line((1, 0), (1, calc.tan(30deg)), name: "tan", stroke: (paint: orange))
content("tan", $ text(#orange, tan alpha) = text(#red, sin alpha) / text(#blue, cos alpha) $, anchor: "west")
content("tan.end", $ text(#orange, tan alpha) = text(#red, sin alpha) / text(#blue, cos alpha) $, anchor: "west")
})
Binary file modified gallery/pie-chart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified gallery/plot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 8 additions & 6 deletions gallery/plot.typ
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,24 @@

#set page(width: auto, height: auto, margin: .5cm)

#let style = (stroke: black, fill: rgb(0, 0, 200, 75))

#canvas(length: 1cm, {
plot.plot(size: (8, 6),
x-tick-step: none,
x-ticks: ((-calc.pi, $-pi$), (0, $0$), (calc.pi, $pi$)),
y-tick-step: 1,
{
plot.add(
style: plot.palette.blue,
domain: (-calc.pi, calc.pi), x => calc.sin(x * 1rad))
style: style,
domain: (-calc.pi, calc.pi), calc.sin)
plot.add(
hypograph: true,
style: plot.palette.blue,
domain: (-calc.pi, calc.pi), x => calc.cos(x * 1rad))
style: style,
domain: (-calc.pi, calc.pi), calc.cos)
plot.add(
hypograph: true,
style: plot.palette.blue,
domain: (-calc.pi, calc.pi), x => calc.cos((x + calc.pi) * 1rad))
style: style,
domain: (-calc.pi, calc.pi), x => calc.cos(x + calc.pi))
})
})
Binary file modified gallery/tree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ test_dir := "./tests"
package target:
./scripts/package "{{target}}"

install:
./scripts/package "@local"
install target="@local":
./scripts/package "{{target}}"

test *filter:
./scripts/test test {{filter}}
Expand Down
7 changes: 5 additions & 2 deletions scripts/package
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ if (( $# < 1 )) || [[ "${1:-}" == "help" ]]; then
echo ""
echo "Packages all relevant files into a directory named '${PKG_PREFIX}/<version>'"
echo "at TARGET. If TARGET is set to @local, the local Typst package directory"
echo "will be used so that the package gets installed for local use."
echo "will be used so that the package gets installed for local use, if @preview"
echo "is used, Typsts preview cache dir will be used."
echo "The version is read from 'typst.toml' in the project root."
echo ""
echo "Local package prefix: $DATA_DIR/typst/package/local"
Expand All @@ -49,8 +50,10 @@ VERSION="$(read-toml "$SOURCE/typst.toml" "version")"

if [[ "$TARGET" == "@local" ]] || [[ "$TARGET" == "install" ]]; then
TARGET="${DATA_DIR}/typst/packages/local/"
echo "Install dir: $TARGET"
elif [[ "$TARGET" == "@preview" ]]; then
TARGET="${DATA_DIR}/typst/packages/preview/"
fi
echo "Install dir: $TARGET"

TMP="$(mktemp -d)"

Expand Down
Loading