Skip to content

Commit

Permalink
natively support boards-n-pieces
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesrswift committed Jul 13, 2024
1 parent c62b0ea commit 7cf0658
Show file tree
Hide file tree
Showing 17 changed files with 71 additions and 4 deletions.
5 changes: 4 additions & 1 deletion Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,8 @@ thumbnails:
typst c template/main.typ thumbnails/{n}.png --root ./ --font-path ./
oxipng -o 4 --strip safe --alpha thumbnails/*.png

example:
typst c template/main.typ example.pdf --root ./ --font-path ./

# run ci suite
ci: test doc
ci: test doc thumbnails example
Binary file added docs/manual.pdf
Binary file not shown.
Binary file modified example.pdf
Binary file not shown.
7 changes: 5 additions & 2 deletions src/lib.typ
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#import "impl.typ": template, sidecaption
#import "impl.typ": template
#import "package/ctheorems.typ" as ctheorems
#import "package/gentle-clues.typ" as gentle-clues
#import "package/dining-table.typ" as dining-table
#import "models/asterism.typ"
#import "package/board-n-pieces.typ" as board-n-pieces

#import "models/asterism.typ"
#import "models/sidecaption.typ": sidecaption
16 changes: 16 additions & 0 deletions src/package/board-n-pieces.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#import "@preview/board-n-pieces:0.4.0": *

#let board = board.with(

white-square-fill: white,
highlighted-white-square-fill: rgb("#aee9da"),

black-square-fill: luma(50%),
highlighted-black-square-fill: rgb("#326b67"),

arrow-stroke: .35em + green,

stroke: 0.5pt,
display-numbers: true,
square-size: 2em,
)
Binary file added tests/board-n-pieces/ref/1.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 added tests/board-n-pieces/ref/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions tests/board-n-pieces/test.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#import "../../src/lib.typ" as springer-spaniel
#import springer-spaniel.board-n-pieces: *

#show: springer-spaniel.template(
title: [Towards Swifter Interstellar Mail Delivery],
authors: (
(
name: "Joana Swift",
institute: "Primary Logistics Departmen",
address: "Delivery Institute, Berlin, Germany",
email: "[email protected]"
),
(
name: "Egon Stellaris",
institute: "Communications Group",
address: "Space Institute, Florence, Italy",
email: "[email protected]"
),
(
name: "Oliver Liam",
institute: "Missing Letters Task Force",
address: "Mail Institute, Budapest, Hungary",
email: "[email protected]"
)
),
abstract: lorem(75),
)


#pagebreak()

= Board 'n pieces
This section tests the template styling of the supported `board-n-pieces` package, as shown below; #lorem(50)

#springer-spaniel.sidecaption(
caption-width: 50%,
caption-padding: (top: 1.25em),
figure(
caption: lorem(50),
board(
fen("r4rk1/pp2Bpbp/1qp3p1/8/2BP2b1/Q1n2N2/P4PPP/3RK2R"),
highlighted-squares: "c7 c6 h6",
arrows: ("d8 c8", "d8 c7", "g1 g6", "h7 h6"),
)
)
)
Binary file removed tests/test1/ref/1.png
Binary file not shown.
1 change: 0 additions & 1 deletion tests/test1/test.typ

This file was deleted.

Binary file modified thumbnails/1.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 thumbnails/2.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 thumbnails/3.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 thumbnails/4.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 thumbnails/5.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 thumbnails/6.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 thumbnails/7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7cf0658

Please sign in to comment.