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

build: bump typst package to 0.1.2 #88

Merged
merged 3 commits into from
Oct 26, 2024
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
613 changes: 282 additions & 331 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ include_dir = "0.7.3"
pathdiff = "0.2.1"

[patch.crates-io]
typst = { git = "https://github.com/Myriad-Dreamin/typst.git", tag = "typst.ts/v0.5.0-rc8-2" }
typst-syntax = { git = "https://github.com/Myriad-Dreamin/typst.git", tag = "typst.ts/v0.5.0-rc8-2" }
reflexo-vec2svg = { git = "https://github.com/Myriad-Dreamin/typst.ts", tag = "v0.5.0-rc8", package = "reflexo-vec2svg" }
reflexo-typst = { git = "https://github.com/Myriad-Dreamin/typst.ts", tag = "v0.5.0-rc8", package = "reflexo-typst" }
typst = { git = "https://github.com/Myriad-Dreamin/typst.git", branch = "typst.ts-v0.5.0-rc8-4" }
typst-syntax = { git = "https://github.com/Myriad-Dreamin/typst.git", branch = "typst.ts-v0.5.0-rc8-4" }
reflexo-vec2svg = { git = "https://github.com/Myriad-Dreamin/typst.ts", rev = "c52a054ca31989e13eddc6f2cffb6db2ba5faa5d", package = "reflexo-vec2svg" }
reflexo-typst = { git = "https://github.com/Myriad-Dreamin/typst.ts", rev = "c52a054ca31989e13eddc6f2cffb6db2ba5faa5d", package = "reflexo-typst" }

# typst = { path = "../typst/crates/typst" }
# typst-syntax = { path = "../typst/crates/typst-syntax" }
Expand Down
2 changes: 1 addition & 1 deletion cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use std::path::PathBuf;
use clap::{ArgAction, Parser, Subcommand, ValueEnum};

#[derive(Debug, Parser)]
#[clap(name = "shiroa", version = "0.1.1")]
#[clap(name = "shiroa", version = "0.1.2")]
pub struct Opts {
/// Print Version
#[arg(short = 'V', long, group = "version-dump")]
Expand Down
4 changes: 2 additions & 2 deletions cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ async fn init(args: InitArgs) -> ZResult<()> {
dir.join("book.typ"),
format!(
r##"
#import "@preview/shiroa:0.1.1": *
#import "@preview/shiroa:0.1.2": *

#show: book

Expand Down Expand Up @@ -135,7 +135,7 @@ Sample page
write_file(
dir.join("ebook.typ"),
format!(
r##"#import "@preview/shiroa:0.1.1": *
r##"#import "@preview/shiroa:0.1.2": *

#import "{ebook_template}"

Expand Down
6 changes: 3 additions & 3 deletions cli/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,12 @@ impl Project {

let package_meta = res
.first()
.ok_or_else(|| error_once!("no internal-package meta in book.typ (are you using old book package?, please import @preview/shiroa:0.1.1; or do you forget the show rule `#show: book`?)"))?;
.ok_or_else(|| error_once!("no internal-package meta in book.typ (are you using old book package?, please import @preview/shiroa:0.1.2; or do you forget the show rule `#show: book`?)"))?;

let InternalPackageMeta::Package { version } = &package_meta.value;
if version != "0.1.1" {
if version != "0.1.2" {
return Err(error_once!(
"outdated book package, please import @preview/shiroa:0.1.1", importing_version: version,
"outdated book package, please import @preview/shiroa:0.1.2", importing_version: version,
));
}
}
Expand Down
2 changes: 1 addition & 1 deletion contrib/typst/gh-ebook.typ
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#import "@preview/shiroa:0.1.1": *
#import "@preview/shiroa:0.1.2": *
#import "/contrib/typst/gh-pages.typ": project, part-style

#let _page-project = project
Expand Down
2 changes: 1 addition & 1 deletion contrib/typst/gh-pages.typ
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This is important for shiroa to produce a responsive layout
// and multiple targets.
#import "@preview/shiroa:0.1.1": get-page-width, target, is-web-target, is-pdf-target, plain-text, templates
#import "@preview/shiroa:0.1.2": get-page-width, target, is-web-target, is-pdf-target, plain-text, templates
#import templates: *

// Metadata
Expand Down
2 changes: 1 addition & 1 deletion github-pages/docs/book.typ
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#import "@preview/shiroa:0.1.1": *
#import "@preview/shiroa:0.1.2": *

#show: book

Expand Down
6 changes: 3 additions & 3 deletions github-pages/docs/cli/init.typ
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ shiroa build my-book/ # memoryized dest-dir
The harder way, by creating the book without `init` command, your `book.typ` should at least provides a `book-meta`, as #cross-link("/guide/get-started.typ")[Get Started] shown.

```typ
#import "@preview/shiroa:0.1.1": *
#import "@preview/shiroa:0.1.2": *
#show: book

#book-meta(
Expand All @@ -43,10 +43,10 @@ The harder way, by creating the book without `init` command, your `book.typ` sho
)
```

Your `template.typ` must import and respect the `page-width` and `target` variable from `@preview/shiroa:0.1.1` to this time. The two variables will be used by the tool for rendering responsive layout and multiple targets.
Your `template.typ` must import and respect the `get-page-width` and `target` variable from `@preview/shiroa:0.1.2` to this time. The two variables will be used by the tool for rendering responsive layout and multiple targets.

```typ
#import "@preview/shiroa:0.1.1": get-page-width, target, is-web-target, is-pdf-target
#import "@preview/shiroa:0.1.2": get-page-width, target, is-web-target, is-pdf-target

// Metadata
#let page-width = get-page-width()
Expand Down
7 changes: 3 additions & 4 deletions github-pages/docs/format/theme.typ
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Currently we have no much design on theme's html part. But you can still configu
Your `book.typ` should at least provides a `book-meta`, as #t shown.

```typ
#import "@preview/shiroa:0.1.1": *
#import "@preview/shiroa:0.1.2": *
#show: book

#book-meta(
Expand All @@ -28,11 +28,10 @@ Your `book.typ` should at least provides a `book-meta`, as #t shown.
)
```

// todo: update it
What is arguable, your `template.typ` must import and respect the `page-width` and `target` variable from `@preview/typst-ts-variables:0.1.1` to this time.
To support specialized rendering for web pages and different page layouts, Your `template.typ` can import and respect the `page-width` and `target` variable from `@preview/shiroa:0.1.2` to this time.

```typ
#import "@preview/typst-ts-variables:0.1.1": page-width, target
#import "@preview/shiroa:0.1.2": page-width, target

#let project(body) = {
// set web/pdf page properties
Expand Down
2 changes: 1 addition & 1 deletion github-pages/docs/guide/get-started.typ
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Before a chapter can be viewed, it must be added to this list.
Here's a basic summary file with a few chapters:

```typ
#import "@preview/shiroa:0.1.1": *
#import "@preview/shiroa:0.1.2": *
#show: book

#book-meta( // put metadata of your book like book.toml of mdbook
Expand Down
2 changes: 1 addition & 1 deletion github-pages/docs/pdf.typ
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#import "@preview/shiroa:0.1.1": *
#import "@preview/shiroa:0.1.2": *

#import "/contrib/typst/gh-ebook.typ"
#let ebook = gh-ebook
Expand Down
2 changes: 0 additions & 2 deletions packages/shiroa-tests/test-summary.typ
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,4 @@
]
#res.push(t)

#res.push(t)

#res
2 changes: 1 addition & 1 deletion packages/shiroa/typst.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "shiroa"
version = "0.1.1"
version = "0.1.2"
entrypoint = "lib.typ"
authors = ["Myriad-Dreamin <https://github.com/Myriad-Dreamin>"]
license = "Apache-2.0"
Expand Down
Loading