diff --git a/crates/typst-library/src/meta/counter.rs b/crates/typst-library/src/meta/counter.rs index ca4f3bc5d..35afd2f8d 100644 --- a/crates/typst-library/src/meta/counter.rs +++ b/crates/typst-library/src/meta/counter.rs @@ -267,12 +267,13 @@ use crate::prelude::*; /// array of integers, even if the counter has just one number. /// /// - location: location (positional, required) -/// Can be any location. Why is it required then? Typst has to evaluate parts -/// of your code multiple times to determine all counter values. By only -/// allowing this method within [`locate`]($func/locate) calls, the amount of -/// code that can depend on the method's result is reduced. If you could call -/// `final` directly at the top level of a module, the evaluation of the whole -/// module and its exports could depend on the counter's value. +/// Can be an arbitrary location, as its value is irrelevant for the method's +/// return value. Why is it required then? Typst has to evaluate parts of your +/// code multiple times to determine all counter values. By only allowing this +/// method within [`locate`]($func/locate) calls, the amount of code that can +/// depend on the method's result is reduced. If you could call `final` +/// directly at the top level of a module, the evaluation of the whole module +/// and its exports could depend on the counter's value. /// /// - returns: array /// diff --git a/crates/typst-library/src/meta/query.rs b/crates/typst-library/src/meta/query.rs index a644000d7..eb5208969 100644 --- a/crates/typst-library/src/meta/query.rs +++ b/crates/typst-library/src/meta/query.rs @@ -140,9 +140,10 @@ pub fn query( /// have an explicit label attached to them. This limitation will be /// resolved in the future. target: LocatableSelector, - /// Can be any location. Why is it required then? As noted before, Typst has - /// to evaluate parts of your code multiple times to determine the values of - /// all state. By only allowing this function within + /// Can be an arbitrary location, as its value is irrelevant for the + /// function's return value. Why is it required then? As noted before, Typst + /// has to evaluate parts of your code multiple times to determine the + /// values of all state. By only allowing this function within /// [`locate`]($func/locate) calls, the amount of code that can depend on /// the query's result is reduced. If you could call it directly at the top /// level of a module, the evaluation of the whole module and its exports diff --git a/crates/typst-library/src/meta/state.rs b/crates/typst-library/src/meta/state.rs index 5b3049728..ee2a6e32e 100644 --- a/crates/typst-library/src/meta/state.rs +++ b/crates/typst-library/src/meta/state.rs @@ -222,13 +222,14 @@ use crate::prelude::*; /// Gets the value of the state at the end of the document. /// /// - location: location (positional, required) -/// Can be any location. Why is it required then? As noted before, Typst has -/// to evaluate parts of your code multiple times to determine the values of -/// all state. By only allowing this method within [`locate`]($func/locate) -/// calls, the amount of code that can depend on the method's result is -/// reduced. If you could call `final` directly at the top level of a module, -/// the evaluation of the whole module and its exports could depend on the -/// state's value. +/// Can be an arbitrary location, as its value is irrelevant for the method's +/// return value. Why is it required then? As noted before, Typst has to +/// evaluate parts of your code multiple times to determine the values of all +/// state. By only allowing this method within [`locate`]($func/locate) calls, +/// the amount of code that can depend on the method's result is reduced. If +/// you could call `final` directly at the top level of a module, the +/// evaluation of the whole module and its exports could depend on the state's +/// value. /// /// - returns: any ///