mirror of
https://github.com/typst/typst
synced 2025-08-13 06:37:57 +08:00
Compare commits
4 Commits
840d36f8ae
...
9941a1e4ff
Author | SHA1 | Date | |
---|---|---|---|
|
9941a1e4ff | ||
|
5661c20580 | ||
|
7897e86bcc | ||
|
8e0e0f1a3b |
17
Cargo.lock
generated
17
Cargo.lock
generated
@ -748,9 +748,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "flate2"
|
||||
version = "1.1.0"
|
||||
version = "1.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "11faaf5a5236997af9848be0bef4db95824b1d534ebc64d0f0c6cf3e67bd38dc"
|
||||
checksum = "4a3d7db9596fecd151c5f638c0ee5d5bd487b6e0ea232e5dc96d5250f6f94b1d"
|
||||
dependencies = [
|
||||
"crc32fast",
|
||||
"libz-rs-sys",
|
||||
@ -1469,9 +1469,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "libz-rs-sys"
|
||||
version = "0.4.2"
|
||||
version = "0.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "902bc563b5d65ad9bba616b490842ef0651066a1a1dc3ce1087113ffcb873c8d"
|
||||
checksum = "172a788537a2221661b480fee8dc5f96c580eb34fa88764d3205dc356c7e4221"
|
||||
dependencies = [
|
||||
"zlib-rs",
|
||||
]
|
||||
@ -3932,13 +3932,12 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "zip"
|
||||
version = "2.5.0"
|
||||
version = "4.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "27c03817464f64e23f6f37574b4fdc8cf65925b5bfd2b0f2aedf959791941f88"
|
||||
checksum = "9aed4ac33e8eb078c89e6cbb1d5c4c7703ec6d299fc3e7c3695af8f8b423468b"
|
||||
dependencies = [
|
||||
"arbitrary",
|
||||
"crc32fast",
|
||||
"crossbeam-utils",
|
||||
"flate2",
|
||||
"indexmap 2.7.1",
|
||||
"memchr",
|
||||
@ -3947,9 +3946,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "zlib-rs"
|
||||
version = "0.4.2"
|
||||
version = "0.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8b20717f0917c908dc63de2e44e97f1e6b126ca58d0e391cee86d504eb8fbd05"
|
||||
checksum = "626bd9fa9734751fc50d6060752170984d7053f5a39061f524cda68023d4db8a"
|
||||
|
||||
[[package]]
|
||||
name = "zopfli"
|
||||
|
@ -143,7 +143,7 @@ xmlparser = "0.13.5"
|
||||
xmlwriter = "0.1.0"
|
||||
xz2 = { version = "0.1", features = ["static"] }
|
||||
yaml-front-matter = "0.1"
|
||||
zip = { version = "2.5", default-features = false, features = ["deflate"] }
|
||||
zip = { version = "4.3", default-features = false, features = ["deflate"] }
|
||||
|
||||
[profile.dev.package."*"]
|
||||
opt-level = 2
|
||||
|
@ -37,13 +37,12 @@ pub use crate::__select_where as select_where;
|
||||
|
||||
/// A filter for selecting elements within the document.
|
||||
///
|
||||
/// You can construct a selector in the following ways:
|
||||
/// - you can use an element [function]
|
||||
/// - you can filter for an element function with
|
||||
/// [specific fields]($function.where)
|
||||
/// - you can use a [string]($str) or [regular expression]($regex)
|
||||
/// - you can use a [`{<label>}`]($label)
|
||||
/// - you can use a [`location`]
|
||||
/// To construct a selector you can:
|
||||
/// - use an element [function]
|
||||
/// - filter for an element function with [specific fields]($function.where)
|
||||
/// - use a [string]($str) or [regular expression]($regex)
|
||||
/// - use a [`{<label>}`]($label)
|
||||
/// - use a [`location`]
|
||||
/// - call the [`selector`] constructor to convert any of the above types into a
|
||||
/// selector value and use the methods below to refine it
|
||||
///
|
||||
@ -148,7 +147,9 @@ impl Selector {
|
||||
impl Selector {
|
||||
/// Turns a value into a selector. The following values are accepted:
|
||||
/// - An element function like a `heading` or `figure`.
|
||||
/// - A [string]($str) or [regular expression]($regex).
|
||||
/// - A `{<label>}`.
|
||||
/// - A [`location`].
|
||||
/// - A more complex selector like `{heading.where(level: 1)}`.
|
||||
#[func(constructor)]
|
||||
pub fn construct(
|
||||
|
@ -374,9 +374,11 @@ fn visit_show_rules<'a>(
|
||||
}
|
||||
|
||||
// Apply a built-in show rule.
|
||||
ShowStep::Builtin(rule) => rule
|
||||
.apply(&output, s.engine, chained)
|
||||
.map(|content| content.spanned(output.span())),
|
||||
ShowStep::Builtin(rule) => {
|
||||
let _scope = typst_timing::TimingScope::new(output.elem().name());
|
||||
rule.apply(&output, s.engine, chained)
|
||||
.map(|content| content.spanned(output.span()))
|
||||
}
|
||||
};
|
||||
|
||||
// Errors in show rules don't terminate compilation immediately. We just
|
||||
|
Loading…
x
Reference in New Issue
Block a user