-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Overhaul manual and asset workflow
- Completely overhauls the manual to use `mantys:1.0.0`. - Updates the just file for simpler example generation - Removes examples from repo - Updates github workflow
- Loading branch information
Showing
49 changed files
with
883 additions
and
490 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,35 +12,28 @@ jobs: | |
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Probe runner package cache | ||
uses: awalsh128/cache-apt-pkgs-action@latest | ||
with: | ||
packages: imagemagick cargo | ||
version: 1.0 | ||
|
||
- name: Install nu from crates.io | ||
- name: Install oxipng from crates.io | ||
uses: baptiste0928/[email protected] | ||
with: | ||
crate: nu | ||
crate: oxipng | ||
|
||
- name: Install just from crates.io | ||
uses: baptiste0928/[email protected] | ||
with: | ||
crate: just | ||
|
||
- name: Install typst-test from github | ||
- name: Install tytanic from crates.io | ||
uses: baptiste0928/[email protected] | ||
with: | ||
crate: typst-test | ||
git: https://github.com/tingerrr/typst-test.git | ||
tag: ci-semi-stable | ||
crate: tytanic | ||
version: 0.1.0 | ||
|
||
- name: Setup typst | ||
uses: yusancky/setup-typst@v2 | ||
with: | ||
version: 'v0.12.0' | ||
|
||
- name: Run test suite | ||
- name: Run test suite and check assets | ||
run: just ci | ||
|
||
- name: Archive artifacts | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# fonts are currently temporary | ||
/assets/fonts/** | ||
|
||
# all out diretories are temporary | ||
/**/out/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,83 @@ | ||
set shell := ['nu', '-c'] | ||
_doc := 'doc' | ||
_assets := 'assets' | ||
_examples := _assets / 'examples' | ||
_showcase := _assets / 'showcase' | ||
|
||
export TYPST_ROOT := justfile_directory() | ||
export TYPST_FONT_PATHS := justfile_directory() / 'assets' / 'fonts' | ||
|
||
# list recipes | ||
[private] | ||
default: | ||
just --list | ||
|
||
# generate example images | ||
gen-examples: | ||
rm --recursive --force pages examples/pages | ||
mkdir examples/pages | ||
typst compile --ppi 300 examples/pages.typ examples/pages/{n}.png | ||
typst compile examples/main.typ examples/example.png | ||
rm --recursive --force pages examples/pages | ||
oxipng --opt max examples/example.png | ||
|
||
# generate doc examples | ||
gen-doc-examples: | ||
#! /usr/bin/env nu | ||
ls doc/examples | ||
| where type == dir | ||
| get name | ||
| each {|it| | ||
cd $it | ||
rm --recursive --force out | ||
mkdir out | ||
[a b] | each {|it| | ||
(typst compile | ||
$"($it).typ" | ||
$"out/($it){n}.png") | ||
}; | ||
let pages = (ls out | length) / 2 | into int; | ||
{ pages: $pages } | to toml | save -f out.toml | ||
} | ||
| ignore | ||
|
||
oxipng --recursive --opt max doc | ||
|
||
# generate the manual | ||
doc: gen-doc-examples | ||
typst compile doc/manual.typ doc/manual.pdf | ||
@just --list --unsorted | ||
|
||
# run the test suite | ||
[positional-arguments] | ||
test *args: | ||
typst-test run {{ args }} | ||
tt run "$@" | ||
|
||
# update the test suite | ||
[positional-arguments] | ||
update *args: | ||
typst-test update {{ args }} | ||
tt update "$@" | ||
|
||
# clean all output directories | ||
clean: | ||
rm --recursive --force {{ _doc / 'out' }} | ||
rm --recursive --force {{ _examples / 'book' / 'out' }} | ||
rm --recursive --force {{ _examples / 'skip' / 'out' }} | ||
rm --recursive --force {{ _showcase / 'out' }} | ||
tt util clean | ||
|
||
# run the ci checks locally | ||
ci: generate-doc generate-showcase (test '--no-fail-fast') | ||
|
||
# update the showcase image | ||
update-showcase: generate-showcase | ||
oxipng --opt max {{ _showcase / 'out' / 'showcase.png' }} | ||
cp {{ _showcase / 'out' / 'showcase.png' }} {{ _assets / 'showcase.png' }} | ||
|
||
# generate the showcase image | ||
generate-showcase: (clear-directory (_showcase / 'out')) | ||
typst compile \ | ||
--ppi 300 \ | ||
{{ _showcase / 'pages.typ' }} \ | ||
{{ _showcase / 'out' / '{n}.png' }} | ||
typst compile \ | ||
{{ _showcase / 'showcase.typ' }} \ | ||
{{ _showcase / 'out' / 'showcase.png' }} | ||
|
||
# generate all doc examples | ||
generate-examples: (generate-example 'book') (generate-example 'skip') | ||
|
||
# run the ci test suite | ||
ci: | ||
# run one single test first to avoid a race condition on package downloads | ||
typst-test run regressions/scoped-search | ||
typst-test run | ||
# generate a single doc example | ||
generate-example example: (clear-directory (_examples / example / 'out')) | ||
typst compile \ | ||
--ppi 300 \ | ||
{{ _examples / example / 'a.typ' }} \ | ||
{{ _examples / example / 'out' / 'a{n}.png' }} | ||
typst compile \ | ||
--ppi 300 \ | ||
{{ _examples / example / 'b.typ' }} \ | ||
{{ _examples / example / 'out' / 'b{n}.png' }} | ||
|
||
# generate a new manual and update it | ||
update-doc: generate-doc | ||
cp {{ _doc / 'out' / 'manual.pdf' }} {{ _assets / 'manual.pdf' }} | ||
|
||
# generate the manual | ||
generate-doc: (clear-directory (_doc / 'out')) generate-examples | ||
typst compile \ | ||
{{ _doc / 'manual.typ' }} \ | ||
{{ _doc / 'out' / 'manual.pdf' }} | ||
|
||
# watch the manual | ||
watch-doc: (clear-directory (_doc / 'out')) generate-examples | ||
typst watch \ | ||
{{ _doc / 'manual.typ' }} \ | ||
{{ _doc / 'out' / 'manual.pdf' }} | ||
|
||
[private] | ||
clear-directory dir: | ||
rm --recursive --force {{ dir }} | ||
mkdir {{ dir }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fonts/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#import "/doc/examples/template.typ": example | ||
#import "../template.typ": example | ||
#show: example.with(book: false) | ||
#include "content.typ" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#import "/doc/examples/template.typ": example | ||
#import "../template.typ": example | ||
#show: example.with(book: true) | ||
#include "content.typ" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#import "/doc/examples/template.typ": example | ||
#import "../template.typ": example | ||
#show: example.with(skip-starting: true) | ||
#include "content.typ" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#import "/doc/examples/template.typ": example | ||
#import "../template.typ": example | ||
#show: example.with(skip-starting: false) | ||
#include "content.typ" |
File renamed without changes.
File renamed without changes.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.