mirror of
https://github.com/typst/typst
synced 2025-05-14 17:15:28 +08:00
Remove redundant doc comments on standard arguments (#5725)
This commit is contained in:
parent
c22c47b9c9
commit
b90ad470d6
@ -305,8 +305,6 @@ impl Args {
|
|||||||
/// ```
|
/// ```
|
||||||
#[func(constructor)]
|
#[func(constructor)]
|
||||||
pub fn construct(
|
pub fn construct(
|
||||||
/// The real arguments (the other argument is just for the docs).
|
|
||||||
/// The docs argument cannot be called `args`.
|
|
||||||
args: &mut Args,
|
args: &mut Args,
|
||||||
/// The arguments to construct.
|
/// The arguments to construct.
|
||||||
#[external]
|
#[external]
|
||||||
|
@ -301,9 +301,7 @@ impl Array {
|
|||||||
#[func]
|
#[func]
|
||||||
pub fn find(
|
pub fn find(
|
||||||
&self,
|
&self,
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// The callsite context.
|
|
||||||
context: Tracked<Context>,
|
context: Tracked<Context>,
|
||||||
/// The function to apply to each item. Must return a boolean.
|
/// The function to apply to each item. Must return a boolean.
|
||||||
searcher: Func,
|
searcher: Func,
|
||||||
@ -325,9 +323,7 @@ impl Array {
|
|||||||
#[func]
|
#[func]
|
||||||
pub fn position(
|
pub fn position(
|
||||||
&self,
|
&self,
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// The callsite context.
|
|
||||||
context: Tracked<Context>,
|
context: Tracked<Context>,
|
||||||
/// The function to apply to each item. Must return a boolean.
|
/// The function to apply to each item. Must return a boolean.
|
||||||
searcher: Func,
|
searcher: Func,
|
||||||
@ -363,8 +359,6 @@ impl Array {
|
|||||||
/// ```
|
/// ```
|
||||||
#[func]
|
#[func]
|
||||||
pub fn range(
|
pub fn range(
|
||||||
/// The real arguments (the other arguments are just for the docs, this
|
|
||||||
/// function is a bit involved, so we parse the arguments manually).
|
|
||||||
args: &mut Args,
|
args: &mut Args,
|
||||||
/// The start of the range (inclusive).
|
/// The start of the range (inclusive).
|
||||||
#[external]
|
#[external]
|
||||||
@ -402,9 +396,7 @@ impl Array {
|
|||||||
#[func]
|
#[func]
|
||||||
pub fn filter(
|
pub fn filter(
|
||||||
&self,
|
&self,
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// The callsite context.
|
|
||||||
context: Tracked<Context>,
|
context: Tracked<Context>,
|
||||||
/// The function to apply to each item. Must return a boolean.
|
/// The function to apply to each item. Must return a boolean.
|
||||||
test: Func,
|
test: Func,
|
||||||
@ -427,9 +419,7 @@ impl Array {
|
|||||||
#[func]
|
#[func]
|
||||||
pub fn map(
|
pub fn map(
|
||||||
self,
|
self,
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// The callsite context.
|
|
||||||
context: Tracked<Context>,
|
context: Tracked<Context>,
|
||||||
/// The function to apply to each item.
|
/// The function to apply to each item.
|
||||||
mapper: Func,
|
mapper: Func,
|
||||||
@ -481,8 +471,6 @@ impl Array {
|
|||||||
#[func]
|
#[func]
|
||||||
pub fn zip(
|
pub fn zip(
|
||||||
self,
|
self,
|
||||||
/// The real arguments (the `others` arguments are just for the docs, this
|
|
||||||
/// function is a bit involved, so we parse the positional arguments manually).
|
|
||||||
args: &mut Args,
|
args: &mut Args,
|
||||||
/// Whether all arrays have to have the same length.
|
/// Whether all arrays have to have the same length.
|
||||||
/// For example, `{(1, 2).zip((1, 2, 3), exact: true)}` produces an
|
/// For example, `{(1, 2).zip((1, 2, 3), exact: true)}` produces an
|
||||||
@ -569,9 +557,7 @@ impl Array {
|
|||||||
#[func]
|
#[func]
|
||||||
pub fn fold(
|
pub fn fold(
|
||||||
self,
|
self,
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// The callsite context.
|
|
||||||
context: Tracked<Context>,
|
context: Tracked<Context>,
|
||||||
/// The initial value to start with.
|
/// The initial value to start with.
|
||||||
init: Value,
|
init: Value,
|
||||||
@ -631,9 +617,7 @@ impl Array {
|
|||||||
#[func]
|
#[func]
|
||||||
pub fn any(
|
pub fn any(
|
||||||
self,
|
self,
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// The callsite context.
|
|
||||||
context: Tracked<Context>,
|
context: Tracked<Context>,
|
||||||
/// The function to apply to each item. Must return a boolean.
|
/// The function to apply to each item. Must return a boolean.
|
||||||
test: Func,
|
test: Func,
|
||||||
@ -651,9 +635,7 @@ impl Array {
|
|||||||
#[func]
|
#[func]
|
||||||
pub fn all(
|
pub fn all(
|
||||||
self,
|
self,
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// The callsite context.
|
|
||||||
context: Tracked<Context>,
|
context: Tracked<Context>,
|
||||||
/// The function to apply to each item. Must return a boolean.
|
/// The function to apply to each item. Must return a boolean.
|
||||||
test: Func,
|
test: Func,
|
||||||
@ -831,11 +813,8 @@ impl Array {
|
|||||||
#[func]
|
#[func]
|
||||||
pub fn sorted(
|
pub fn sorted(
|
||||||
self,
|
self,
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// The callsite context.
|
|
||||||
context: Tracked<Context>,
|
context: Tracked<Context>,
|
||||||
/// The callsite span.
|
|
||||||
span: Span,
|
span: Span,
|
||||||
/// If given, applies this function to the elements in the array to
|
/// If given, applies this function to the elements in the array to
|
||||||
/// determine the keys to sort by.
|
/// determine the keys to sort by.
|
||||||
@ -881,9 +860,7 @@ impl Array {
|
|||||||
#[func(title = "Deduplicate")]
|
#[func(title = "Deduplicate")]
|
||||||
pub fn dedup(
|
pub fn dedup(
|
||||||
self,
|
self,
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// The callsite context.
|
|
||||||
context: Tracked<Context>,
|
context: Tracked<Context>,
|
||||||
/// If given, applies this function to the elements in the array to
|
/// If given, applies this function to the elements in the array to
|
||||||
/// determine the keys to deduplicate by.
|
/// determine the keys to deduplicate by.
|
||||||
@ -967,9 +944,7 @@ impl Array {
|
|||||||
#[func]
|
#[func]
|
||||||
pub fn reduce(
|
pub fn reduce(
|
||||||
self,
|
self,
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// The callsite context.
|
|
||||||
context: Tracked<Context>,
|
context: Tracked<Context>,
|
||||||
/// The reducing function. Must have two parameters: One for the
|
/// The reducing function. Must have two parameters: One for the
|
||||||
/// accumulated value and one for an item.
|
/// accumulated value and one for an item.
|
||||||
|
@ -97,7 +97,6 @@ cast! {
|
|||||||
/// ```
|
/// ```
|
||||||
#[func(title = "Power")]
|
#[func(title = "Power")]
|
||||||
pub fn pow(
|
pub fn pow(
|
||||||
/// The callsite span.
|
|
||||||
span: Span,
|
span: Span,
|
||||||
/// The base of the power.
|
/// The base of the power.
|
||||||
///
|
///
|
||||||
@ -159,7 +158,6 @@ pub fn pow(
|
|||||||
/// ```
|
/// ```
|
||||||
#[func(title = "Exponential")]
|
#[func(title = "Exponential")]
|
||||||
pub fn exp(
|
pub fn exp(
|
||||||
/// The callsite span.
|
|
||||||
span: Span,
|
span: Span,
|
||||||
/// The exponent of the power.
|
/// The exponent of the power.
|
||||||
exponent: Spanned<Num>,
|
exponent: Spanned<Num>,
|
||||||
@ -412,7 +410,6 @@ pub fn tanh(
|
|||||||
/// ```
|
/// ```
|
||||||
#[func(title = "Logarithm")]
|
#[func(title = "Logarithm")]
|
||||||
pub fn log(
|
pub fn log(
|
||||||
/// The callsite span.
|
|
||||||
span: Span,
|
span: Span,
|
||||||
/// The number whose logarithm to calculate. Must be strictly positive.
|
/// The number whose logarithm to calculate. Must be strictly positive.
|
||||||
value: Spanned<Num>,
|
value: Spanned<Num>,
|
||||||
@ -454,7 +451,6 @@ pub fn log(
|
|||||||
/// ```
|
/// ```
|
||||||
#[func(title = "Natural Logarithm")]
|
#[func(title = "Natural Logarithm")]
|
||||||
pub fn ln(
|
pub fn ln(
|
||||||
/// The callsite span.
|
|
||||||
span: Span,
|
span: Span,
|
||||||
/// The number whose logarithm to calculate. Must be strictly positive.
|
/// The number whose logarithm to calculate. Must be strictly positive.
|
||||||
value: Spanned<Num>,
|
value: Spanned<Num>,
|
||||||
@ -782,7 +778,6 @@ pub fn round(
|
|||||||
/// ```
|
/// ```
|
||||||
#[func]
|
#[func]
|
||||||
pub fn clamp(
|
pub fn clamp(
|
||||||
/// The callsite span.
|
|
||||||
span: Span,
|
span: Span,
|
||||||
/// The number to clamp.
|
/// The number to clamp.
|
||||||
value: DecNum,
|
value: DecNum,
|
||||||
@ -815,7 +810,6 @@ pub fn clamp(
|
|||||||
/// ```
|
/// ```
|
||||||
#[func(title = "Minimum")]
|
#[func(title = "Minimum")]
|
||||||
pub fn min(
|
pub fn min(
|
||||||
/// The callsite span.
|
|
||||||
span: Span,
|
span: Span,
|
||||||
/// The sequence of values from which to extract the minimum.
|
/// The sequence of values from which to extract the minimum.
|
||||||
/// Must not be empty.
|
/// Must not be empty.
|
||||||
@ -833,7 +827,6 @@ pub fn min(
|
|||||||
/// ```
|
/// ```
|
||||||
#[func(title = "Maximum")]
|
#[func(title = "Maximum")]
|
||||||
pub fn max(
|
pub fn max(
|
||||||
/// The callsite span.
|
|
||||||
span: Span,
|
span: Span,
|
||||||
/// The sequence of values from which to extract the maximum.
|
/// The sequence of values from which to extract the maximum.
|
||||||
/// Must not be empty.
|
/// Must not be empty.
|
||||||
@ -911,7 +904,6 @@ pub fn odd(
|
|||||||
/// ```
|
/// ```
|
||||||
#[func(title = "Remainder")]
|
#[func(title = "Remainder")]
|
||||||
pub fn rem(
|
pub fn rem(
|
||||||
/// The span of the function call.
|
|
||||||
span: Span,
|
span: Span,
|
||||||
/// The dividend of the remainder.
|
/// The dividend of the remainder.
|
||||||
dividend: DecNum,
|
dividend: DecNum,
|
||||||
@ -950,7 +942,6 @@ pub fn rem(
|
|||||||
/// ```
|
/// ```
|
||||||
#[func(title = "Euclidean Division")]
|
#[func(title = "Euclidean Division")]
|
||||||
pub fn div_euclid(
|
pub fn div_euclid(
|
||||||
/// The callsite span.
|
|
||||||
span: Span,
|
span: Span,
|
||||||
/// The dividend of the division.
|
/// The dividend of the division.
|
||||||
dividend: DecNum,
|
dividend: DecNum,
|
||||||
@ -994,7 +985,6 @@ pub fn div_euclid(
|
|||||||
/// ```
|
/// ```
|
||||||
#[func(title = "Euclidean Remainder", keywords = ["modulo", "modulus"])]
|
#[func(title = "Euclidean Remainder", keywords = ["modulo", "modulus"])]
|
||||||
pub fn rem_euclid(
|
pub fn rem_euclid(
|
||||||
/// The callsite span.
|
|
||||||
span: Span,
|
span: Span,
|
||||||
/// The dividend of the remainder.
|
/// The dividend of the remainder.
|
||||||
dividend: DecNum,
|
dividend: DecNum,
|
||||||
@ -1031,7 +1021,6 @@ pub fn rem_euclid(
|
|||||||
/// ```
|
/// ```
|
||||||
#[func(title = "Quotient")]
|
#[func(title = "Quotient")]
|
||||||
pub fn quo(
|
pub fn quo(
|
||||||
/// The span of the function call.
|
|
||||||
span: Span,
|
span: Span,
|
||||||
/// The dividend of the quotient.
|
/// The dividend of the quotient.
|
||||||
dividend: DecNum,
|
dividend: DecNum,
|
||||||
|
@ -318,7 +318,6 @@ impl Datetime {
|
|||||||
/// ```
|
/// ```
|
||||||
#[func]
|
#[func]
|
||||||
pub fn today(
|
pub fn today(
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// An offset to apply to the current UTC date. If set to `{auto}`, the
|
/// An offset to apply to the current UTC date. If set to `{auto}`, the
|
||||||
/// offset will be the local offset.
|
/// offset will be the local offset.
|
||||||
|
@ -334,8 +334,6 @@ impl Func {
|
|||||||
#[func]
|
#[func]
|
||||||
pub fn with(
|
pub fn with(
|
||||||
self,
|
self,
|
||||||
/// The real arguments (the other argument is just for the docs).
|
|
||||||
/// The docs argument cannot be called `args`.
|
|
||||||
args: &mut Args,
|
args: &mut Args,
|
||||||
/// The arguments to apply to the function.
|
/// The arguments to apply to the function.
|
||||||
#[external]
|
#[external]
|
||||||
@ -361,8 +359,6 @@ impl Func {
|
|||||||
#[func]
|
#[func]
|
||||||
pub fn where_(
|
pub fn where_(
|
||||||
self,
|
self,
|
||||||
/// The real arguments (the other argument is just for the docs).
|
|
||||||
/// The docs argument cannot be called `args`.
|
|
||||||
args: &mut Args,
|
args: &mut Args,
|
||||||
/// The fields to filter for.
|
/// The fields to filter for.
|
||||||
#[variadic]
|
#[variadic]
|
||||||
|
@ -266,7 +266,6 @@ impl assert {
|
|||||||
/// ```
|
/// ```
|
||||||
#[func(title = "Evaluate")]
|
#[func(title = "Evaluate")]
|
||||||
pub fn eval(
|
pub fn eval(
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// A string of Typst code to evaluate.
|
/// A string of Typst code to evaluate.
|
||||||
source: Spanned<String>,
|
source: Spanned<String>,
|
||||||
|
@ -152,7 +152,6 @@ impl Plugin {
|
|||||||
/// Creates a new plugin from a WebAssembly file.
|
/// Creates a new plugin from a WebAssembly file.
|
||||||
#[func(constructor)]
|
#[func(constructor)]
|
||||||
pub fn construct(
|
pub fn construct(
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// A path to a WebAssembly file or raw WebAssembly bytes.
|
/// A path to a WebAssembly file or raw WebAssembly bytes.
|
||||||
///
|
///
|
||||||
|
@ -425,9 +425,7 @@ impl Str {
|
|||||||
#[func]
|
#[func]
|
||||||
pub fn replace(
|
pub fn replace(
|
||||||
&self,
|
&self,
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// The callsite context.
|
|
||||||
context: Tracked<Context>,
|
context: Tracked<Context>,
|
||||||
/// The pattern to search for.
|
/// The pattern to search for.
|
||||||
pattern: StrPattern,
|
pattern: StrPattern,
|
||||||
|
@ -187,7 +187,6 @@ impl Symbol {
|
|||||||
/// ```
|
/// ```
|
||||||
#[func(constructor)]
|
#[func(constructor)]
|
||||||
pub fn construct(
|
pub fn construct(
|
||||||
/// The callsite span.
|
|
||||||
span: Span,
|
span: Span,
|
||||||
/// The variants of the symbol.
|
/// The variants of the symbol.
|
||||||
///
|
///
|
||||||
|
@ -30,9 +30,6 @@ pub struct TargetElem {
|
|||||||
|
|
||||||
/// Returns the current compilation target.
|
/// Returns the current compilation target.
|
||||||
#[func(contextual)]
|
#[func(contextual)]
|
||||||
pub fn target(
|
pub fn target(context: Tracked<Context>) -> HintedStrResult<Target> {
|
||||||
/// The callsite context.
|
|
||||||
context: Tracked<Context>,
|
|
||||||
) -> HintedStrResult<Target> {
|
|
||||||
Ok(TargetElem::target_in(context.styles()?))
|
Ok(TargetElem::target_in(context.styles()?))
|
||||||
}
|
}
|
||||||
|
@ -428,11 +428,8 @@ impl Counter {
|
|||||||
#[func(contextual)]
|
#[func(contextual)]
|
||||||
pub fn get(
|
pub fn get(
|
||||||
&self,
|
&self,
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// The callsite context.
|
|
||||||
context: Tracked<Context>,
|
context: Tracked<Context>,
|
||||||
/// The callsite span.
|
|
||||||
span: Span,
|
span: Span,
|
||||||
) -> SourceResult<CounterState> {
|
) -> SourceResult<CounterState> {
|
||||||
let loc = context.location().at(span)?;
|
let loc = context.location().at(span)?;
|
||||||
@ -444,11 +441,8 @@ impl Counter {
|
|||||||
#[func(contextual)]
|
#[func(contextual)]
|
||||||
pub fn display(
|
pub fn display(
|
||||||
self,
|
self,
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// The callsite context.
|
|
||||||
context: Tracked<Context>,
|
context: Tracked<Context>,
|
||||||
/// The call span of the display.
|
|
||||||
span: Span,
|
span: Span,
|
||||||
/// A [numbering pattern or a function]($numbering), which specifies how
|
/// A [numbering pattern or a function]($numbering), which specifies how
|
||||||
/// to display the counter. If given a function, that function receives
|
/// to display the counter. If given a function, that function receives
|
||||||
@ -482,11 +476,8 @@ impl Counter {
|
|||||||
#[func(contextual)]
|
#[func(contextual)]
|
||||||
pub fn at(
|
pub fn at(
|
||||||
&self,
|
&self,
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// The callsite context.
|
|
||||||
context: Tracked<Context>,
|
context: Tracked<Context>,
|
||||||
/// The callsite span.
|
|
||||||
span: Span,
|
span: Span,
|
||||||
/// The place at which the counter's value should be retrieved.
|
/// The place at which the counter's value should be retrieved.
|
||||||
selector: LocatableSelector,
|
selector: LocatableSelector,
|
||||||
@ -500,11 +491,8 @@ impl Counter {
|
|||||||
#[func(contextual)]
|
#[func(contextual)]
|
||||||
pub fn final_(
|
pub fn final_(
|
||||||
&self,
|
&self,
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// The callsite context.
|
|
||||||
context: Tracked<Context>,
|
context: Tracked<Context>,
|
||||||
/// The callsite span.
|
|
||||||
span: Span,
|
span: Span,
|
||||||
) -> SourceResult<CounterState> {
|
) -> SourceResult<CounterState> {
|
||||||
context.introspect().at(span)?;
|
context.introspect().at(span)?;
|
||||||
@ -528,7 +516,6 @@ impl Counter {
|
|||||||
#[func]
|
#[func]
|
||||||
pub fn step(
|
pub fn step(
|
||||||
self,
|
self,
|
||||||
/// The call span of the update.
|
|
||||||
span: Span,
|
span: Span,
|
||||||
/// The depth at which to step the counter. Defaults to `{1}`.
|
/// The depth at which to step the counter. Defaults to `{1}`.
|
||||||
#[named]
|
#[named]
|
||||||
@ -545,7 +532,6 @@ impl Counter {
|
|||||||
#[func]
|
#[func]
|
||||||
pub fn update(
|
pub fn update(
|
||||||
self,
|
self,
|
||||||
/// The call span of the update.
|
|
||||||
span: Span,
|
span: Span,
|
||||||
/// If given an integer or array of integers, sets the counter to that
|
/// If given an integer or array of integers, sets the counter to that
|
||||||
/// value. If given a function, that function receives the previous
|
/// value. If given a function, that function receives the previous
|
||||||
|
@ -44,9 +44,6 @@ use crate::introspection::Location;
|
|||||||
/// ```
|
/// ```
|
||||||
/// Refer to the [`selector`] type for more details on before/after selectors.
|
/// Refer to the [`selector`] type for more details on before/after selectors.
|
||||||
#[func(contextual)]
|
#[func(contextual)]
|
||||||
pub fn here(
|
pub fn here(context: Tracked<Context>) -> HintedStrResult<Location> {
|
||||||
/// The callsite context.
|
|
||||||
context: Tracked<Context>,
|
|
||||||
) -> HintedStrResult<Location> {
|
|
||||||
context.location()
|
context.location()
|
||||||
}
|
}
|
||||||
|
@ -24,9 +24,7 @@ use crate::introspection::Location;
|
|||||||
/// ```
|
/// ```
|
||||||
#[func(contextual)]
|
#[func(contextual)]
|
||||||
pub fn locate(
|
pub fn locate(
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// The callsite context.
|
|
||||||
context: Tracked<Context>,
|
context: Tracked<Context>,
|
||||||
/// A selector that should match exactly one element. This element will be
|
/// A selector that should match exactly one element. This element will be
|
||||||
/// located.
|
/// located.
|
||||||
|
@ -136,9 +136,7 @@ use crate::foundations::{func, Array, Context, LocatableSelector, Value};
|
|||||||
/// ```
|
/// ```
|
||||||
#[func(contextual)]
|
#[func(contextual)]
|
||||||
pub fn query(
|
pub fn query(
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// The callsite context.
|
|
||||||
context: Tracked<Context>,
|
context: Tracked<Context>,
|
||||||
/// Can be
|
/// Can be
|
||||||
/// - an element function like a `heading` or `figure`,
|
/// - an element function like a `heading` or `figure`,
|
||||||
|
@ -289,11 +289,8 @@ impl State {
|
|||||||
#[func(contextual)]
|
#[func(contextual)]
|
||||||
pub fn get(
|
pub fn get(
|
||||||
&self,
|
&self,
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// The callsite context.
|
|
||||||
context: Tracked<Context>,
|
context: Tracked<Context>,
|
||||||
/// The callsite span.
|
|
||||||
span: Span,
|
span: Span,
|
||||||
) -> SourceResult<Value> {
|
) -> SourceResult<Value> {
|
||||||
let loc = context.location().at(span)?;
|
let loc = context.location().at(span)?;
|
||||||
@ -309,11 +306,8 @@ impl State {
|
|||||||
#[func(contextual)]
|
#[func(contextual)]
|
||||||
pub fn at(
|
pub fn at(
|
||||||
&self,
|
&self,
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// The callsite context.
|
|
||||||
context: Tracked<Context>,
|
context: Tracked<Context>,
|
||||||
/// The callsite span.
|
|
||||||
span: Span,
|
span: Span,
|
||||||
/// The place at which the state's value should be retrieved.
|
/// The place at which the state's value should be retrieved.
|
||||||
selector: LocatableSelector,
|
selector: LocatableSelector,
|
||||||
@ -326,11 +320,8 @@ impl State {
|
|||||||
#[func(contextual)]
|
#[func(contextual)]
|
||||||
pub fn final_(
|
pub fn final_(
|
||||||
&self,
|
&self,
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// The callsite context.
|
|
||||||
context: Tracked<Context>,
|
context: Tracked<Context>,
|
||||||
/// The callsite span.
|
|
||||||
span: Span,
|
span: Span,
|
||||||
) -> SourceResult<Value> {
|
) -> SourceResult<Value> {
|
||||||
context.introspect().at(span)?;
|
context.introspect().at(span)?;
|
||||||
@ -349,7 +340,6 @@ impl State {
|
|||||||
#[func]
|
#[func]
|
||||||
pub fn update(
|
pub fn update(
|
||||||
self,
|
self,
|
||||||
/// The span of the `update` call.
|
|
||||||
span: Span,
|
span: Span,
|
||||||
/// If given a non function-value, sets the state to that value. If
|
/// If given a non function-value, sets the state to that value. If
|
||||||
/// given a function, that function receives the previous state and has
|
/// given a function, that function receives the previous state and has
|
||||||
|
@ -54,7 +54,6 @@ use crate::layout::{BlockElem, Size};
|
|||||||
/// corresponding page dimension is set to `{auto}`.
|
/// corresponding page dimension is set to `{auto}`.
|
||||||
#[func]
|
#[func]
|
||||||
pub fn layout(
|
pub fn layout(
|
||||||
/// The call span of this function.
|
|
||||||
span: Span,
|
span: Span,
|
||||||
/// A function to call with the outer container's size. Its return value is
|
/// A function to call with the outer container's size. Its return value is
|
||||||
/// displayed in the document.
|
/// displayed in the document.
|
||||||
|
@ -43,11 +43,8 @@ use crate::layout::{Abs, Axes, Length, Region, Size};
|
|||||||
/// `height`, both of type [`length`].
|
/// `height`, both of type [`length`].
|
||||||
#[func(contextual)]
|
#[func(contextual)]
|
||||||
pub fn measure(
|
pub fn measure(
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// The callsite context.
|
|
||||||
context: Tracked<Context>,
|
context: Tracked<Context>,
|
||||||
/// The callsite span.
|
|
||||||
span: Span,
|
span: Span,
|
||||||
/// The width available to layout the content.
|
/// The width available to layout the content.
|
||||||
///
|
///
|
||||||
|
@ -19,7 +19,6 @@ use crate::loading::{DataSource, Load};
|
|||||||
/// floating point numbers, which may result in an approximative value.
|
/// floating point numbers, which may result in an approximative value.
|
||||||
#[func(scope, title = "CBOR")]
|
#[func(scope, title = "CBOR")]
|
||||||
pub fn cbor(
|
pub fn cbor(
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// A path to a CBOR file or raw CBOR bytes.
|
/// A path to a CBOR file or raw CBOR bytes.
|
||||||
///
|
///
|
||||||
@ -40,7 +39,6 @@ impl cbor {
|
|||||||
/// directly.
|
/// directly.
|
||||||
#[func(title = "Decode CBOR")]
|
#[func(title = "Decode CBOR")]
|
||||||
pub fn decode(
|
pub fn decode(
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// CBOR data.
|
/// CBOR data.
|
||||||
data: Spanned<Bytes>,
|
data: Spanned<Bytes>,
|
||||||
|
@ -25,7 +25,6 @@ use crate::loading::{DataSource, Load, Readable};
|
|||||||
/// ```
|
/// ```
|
||||||
#[func(scope, title = "CSV")]
|
#[func(scope, title = "CSV")]
|
||||||
pub fn csv(
|
pub fn csv(
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// Path to a CSV file or raw CSV bytes.
|
/// Path to a CSV file or raw CSV bytes.
|
||||||
///
|
///
|
||||||
@ -102,7 +101,6 @@ impl csv {
|
|||||||
/// directly.
|
/// directly.
|
||||||
#[func(title = "Decode CSV")]
|
#[func(title = "Decode CSV")]
|
||||||
pub fn decode(
|
pub fn decode(
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// CSV data.
|
/// CSV data.
|
||||||
data: Spanned<Readable>,
|
data: Spanned<Readable>,
|
||||||
|
@ -50,7 +50,6 @@ use crate::loading::{DataSource, Load, Readable};
|
|||||||
/// ```
|
/// ```
|
||||||
#[func(scope, title = "JSON")]
|
#[func(scope, title = "JSON")]
|
||||||
pub fn json(
|
pub fn json(
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// Path to a JSON file or raw JSON bytes.
|
/// Path to a JSON file or raw JSON bytes.
|
||||||
///
|
///
|
||||||
@ -71,7 +70,6 @@ impl json {
|
|||||||
/// directly.
|
/// directly.
|
||||||
#[func(title = "Decode JSON")]
|
#[func(title = "Decode JSON")]
|
||||||
pub fn decode(
|
pub fn decode(
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// JSON data.
|
/// JSON data.
|
||||||
data: Spanned<Readable>,
|
data: Spanned<Readable>,
|
||||||
|
@ -24,7 +24,6 @@ use crate::World;
|
|||||||
/// ```
|
/// ```
|
||||||
#[func]
|
#[func]
|
||||||
pub fn read(
|
pub fn read(
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// Path to a file.
|
/// Path to a file.
|
||||||
///
|
///
|
||||||
|
@ -28,7 +28,6 @@ use crate::loading::{DataSource, Load, Readable};
|
|||||||
/// ```
|
/// ```
|
||||||
#[func(scope, title = "TOML")]
|
#[func(scope, title = "TOML")]
|
||||||
pub fn toml(
|
pub fn toml(
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// A path to a TOML file or raw TOML bytes.
|
/// A path to a TOML file or raw TOML bytes.
|
||||||
///
|
///
|
||||||
@ -50,7 +49,6 @@ impl toml {
|
|||||||
/// directly.
|
/// directly.
|
||||||
#[func(title = "Decode TOML")]
|
#[func(title = "Decode TOML")]
|
||||||
pub fn decode(
|
pub fn decode(
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// TOML data.
|
/// TOML data.
|
||||||
data: Spanned<Readable>,
|
data: Spanned<Readable>,
|
||||||
|
@ -57,7 +57,6 @@ use crate::loading::{DataSource, Load, Readable};
|
|||||||
/// ```
|
/// ```
|
||||||
#[func(scope, title = "XML")]
|
#[func(scope, title = "XML")]
|
||||||
pub fn xml(
|
pub fn xml(
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// A path to an XML file or raw XML bytes.
|
/// A path to an XML file or raw XML bytes.
|
||||||
///
|
///
|
||||||
@ -83,7 +82,6 @@ impl xml {
|
|||||||
/// directly.
|
/// directly.
|
||||||
#[func(title = "Decode XML")]
|
#[func(title = "Decode XML")]
|
||||||
pub fn decode(
|
pub fn decode(
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// XML data.
|
/// XML data.
|
||||||
data: Spanned<Readable>,
|
data: Spanned<Readable>,
|
||||||
|
@ -40,7 +40,6 @@ use crate::loading::{DataSource, Load, Readable};
|
|||||||
/// ```
|
/// ```
|
||||||
#[func(scope, title = "YAML")]
|
#[func(scope, title = "YAML")]
|
||||||
pub fn yaml(
|
pub fn yaml(
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// A path to a YAML file or raw YAML bytes.
|
/// A path to a YAML file or raw YAML bytes.
|
||||||
///
|
///
|
||||||
@ -61,7 +60,6 @@ impl yaml {
|
|||||||
/// directly.
|
/// directly.
|
||||||
#[func(title = "Decode YAML")]
|
#[func(title = "Decode YAML")]
|
||||||
pub fn decode(
|
pub fn decode(
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// YAML data.
|
/// YAML data.
|
||||||
data: Spanned<Readable>,
|
data: Spanned<Readable>,
|
||||||
|
@ -10,7 +10,6 @@ use crate::math::Mathy;
|
|||||||
/// ```
|
/// ```
|
||||||
#[func(title = "Square Root")]
|
#[func(title = "Square Root")]
|
||||||
pub fn sqrt(
|
pub fn sqrt(
|
||||||
/// The call span of this function.
|
|
||||||
span: Span,
|
span: Span,
|
||||||
/// The expression to take the square root of.
|
/// The expression to take the square root of.
|
||||||
radicand: Content,
|
radicand: Content,
|
||||||
|
@ -53,9 +53,7 @@ use crate::text::Case;
|
|||||||
/// ```
|
/// ```
|
||||||
#[func]
|
#[func]
|
||||||
pub fn numbering(
|
pub fn numbering(
|
||||||
/// The engine.
|
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// The callsite context.
|
|
||||||
context: Tracked<Context>,
|
context: Tracked<Context>,
|
||||||
/// Defines how the numbering works.
|
/// Defines how the numbering works.
|
||||||
///
|
///
|
||||||
|
@ -248,8 +248,6 @@ impl Color {
|
|||||||
/// ```
|
/// ```
|
||||||
#[func]
|
#[func]
|
||||||
pub fn luma(
|
pub fn luma(
|
||||||
/// The real arguments (the other arguments are just for the docs, this
|
|
||||||
/// function is a bit involved, so we parse the arguments manually).
|
|
||||||
args: &mut Args,
|
args: &mut Args,
|
||||||
/// The lightness component.
|
/// The lightness component.
|
||||||
#[external]
|
#[external]
|
||||||
@ -300,8 +298,6 @@ impl Color {
|
|||||||
/// ```
|
/// ```
|
||||||
#[func]
|
#[func]
|
||||||
pub fn oklab(
|
pub fn oklab(
|
||||||
/// The real arguments (the other arguments are just for the docs, this
|
|
||||||
/// function is a bit involved, so we parse the arguments manually).
|
|
||||||
args: &mut Args,
|
args: &mut Args,
|
||||||
/// The lightness component.
|
/// The lightness component.
|
||||||
#[external]
|
#[external]
|
||||||
@ -358,8 +354,6 @@ impl Color {
|
|||||||
/// ```
|
/// ```
|
||||||
#[func]
|
#[func]
|
||||||
pub fn oklch(
|
pub fn oklch(
|
||||||
/// The real arguments (the other arguments are just for the docs, this
|
|
||||||
/// function is a bit involved, so we parse the arguments manually).
|
|
||||||
args: &mut Args,
|
args: &mut Args,
|
||||||
/// The lightness component.
|
/// The lightness component.
|
||||||
#[external]
|
#[external]
|
||||||
@ -420,8 +414,6 @@ impl Color {
|
|||||||
/// ```
|
/// ```
|
||||||
#[func(title = "Linear RGB")]
|
#[func(title = "Linear RGB")]
|
||||||
pub fn linear_rgb(
|
pub fn linear_rgb(
|
||||||
/// The real arguments (the other arguments are just for the docs, this
|
|
||||||
/// function is a bit involved, so we parse the arguments manually).
|
|
||||||
args: &mut Args,
|
args: &mut Args,
|
||||||
/// The red component.
|
/// The red component.
|
||||||
#[external]
|
#[external]
|
||||||
@ -477,8 +469,6 @@ impl Color {
|
|||||||
/// ```
|
/// ```
|
||||||
#[func(title = "RGB")]
|
#[func(title = "RGB")]
|
||||||
pub fn rgb(
|
pub fn rgb(
|
||||||
/// The real arguments (the other arguments are just for the docs, this
|
|
||||||
/// function is a bit involved, so we parse the arguments manually).
|
|
||||||
args: &mut Args,
|
args: &mut Args,
|
||||||
/// The red component.
|
/// The red component.
|
||||||
#[external]
|
#[external]
|
||||||
@ -555,8 +545,6 @@ impl Color {
|
|||||||
/// ```
|
/// ```
|
||||||
#[func(title = "CMYK")]
|
#[func(title = "CMYK")]
|
||||||
pub fn cmyk(
|
pub fn cmyk(
|
||||||
/// The real arguments (the other arguments are just for the docs, this
|
|
||||||
/// function is a bit involved, so we parse the arguments manually).
|
|
||||||
args: &mut Args,
|
args: &mut Args,
|
||||||
/// The cyan component.
|
/// The cyan component.
|
||||||
#[external]
|
#[external]
|
||||||
@ -614,8 +602,6 @@ impl Color {
|
|||||||
/// ```
|
/// ```
|
||||||
#[func(title = "HSL")]
|
#[func(title = "HSL")]
|
||||||
pub fn hsl(
|
pub fn hsl(
|
||||||
/// The real arguments (the other arguments are just for the docs, this
|
|
||||||
/// function is a bit involved, so we parse the arguments manually).
|
|
||||||
args: &mut Args,
|
args: &mut Args,
|
||||||
/// The hue angle.
|
/// The hue angle.
|
||||||
#[external]
|
#[external]
|
||||||
@ -673,8 +659,6 @@ impl Color {
|
|||||||
/// ```
|
/// ```
|
||||||
#[func(title = "HSV")]
|
#[func(title = "HSV")]
|
||||||
pub fn hsv(
|
pub fn hsv(
|
||||||
/// The real arguments (the other arguments are just for the docs, this
|
|
||||||
/// function is a bit involved, so we parse the arguments manually).
|
|
||||||
args: &mut Args,
|
args: &mut Args,
|
||||||
/// The hue angle.
|
/// The hue angle.
|
||||||
#[external]
|
#[external]
|
||||||
@ -898,7 +882,6 @@ impl Color {
|
|||||||
#[func]
|
#[func]
|
||||||
pub fn saturate(
|
pub fn saturate(
|
||||||
self,
|
self,
|
||||||
/// The call span
|
|
||||||
span: Span,
|
span: Span,
|
||||||
/// The factor to saturate the color by.
|
/// The factor to saturate the color by.
|
||||||
factor: Ratio,
|
factor: Ratio,
|
||||||
@ -924,7 +907,6 @@ impl Color {
|
|||||||
#[func]
|
#[func]
|
||||||
pub fn desaturate(
|
pub fn desaturate(
|
||||||
self,
|
self,
|
||||||
/// The call span
|
|
||||||
span: Span,
|
span: Span,
|
||||||
/// The factor to desaturate the color by.
|
/// The factor to desaturate the color by.
|
||||||
factor: Ratio,
|
factor: Ratio,
|
||||||
@ -1001,7 +983,6 @@ impl Color {
|
|||||||
#[func]
|
#[func]
|
||||||
pub fn rotate(
|
pub fn rotate(
|
||||||
self,
|
self,
|
||||||
/// The call span
|
|
||||||
span: Span,
|
span: Span,
|
||||||
/// The angle to rotate the hue by.
|
/// The angle to rotate the hue by.
|
||||||
angle: Angle,
|
angle: Angle,
|
||||||
|
@ -200,9 +200,7 @@ impl Gradient {
|
|||||||
/// ```
|
/// ```
|
||||||
#[func(title = "Linear Gradient")]
|
#[func(title = "Linear Gradient")]
|
||||||
pub fn linear(
|
pub fn linear(
|
||||||
/// The args of this function.
|
|
||||||
args: &mut Args,
|
args: &mut Args,
|
||||||
/// The call site of this function.
|
|
||||||
span: Span,
|
span: Span,
|
||||||
/// The color [stops](#stops) of the gradient.
|
/// The color [stops](#stops) of the gradient.
|
||||||
#[variadic]
|
#[variadic]
|
||||||
@ -292,7 +290,6 @@ impl Gradient {
|
|||||||
/// ```
|
/// ```
|
||||||
#[func]
|
#[func]
|
||||||
fn radial(
|
fn radial(
|
||||||
/// The call site of this function.
|
|
||||||
span: Span,
|
span: Span,
|
||||||
/// The color [stops](#stops) of the gradient.
|
/// The color [stops](#stops) of the gradient.
|
||||||
#[variadic]
|
#[variadic]
|
||||||
@ -407,7 +404,6 @@ impl Gradient {
|
|||||||
/// ```
|
/// ```
|
||||||
#[func]
|
#[func]
|
||||||
pub fn conic(
|
pub fn conic(
|
||||||
/// The call site of this function.
|
|
||||||
span: Span,
|
span: Span,
|
||||||
/// The color [stops](#stops) of the gradient.
|
/// The color [stops](#stops) of the gradient.
|
||||||
#[variadic]
|
#[variadic]
|
||||||
|
@ -112,7 +112,6 @@ impl ImageElem {
|
|||||||
/// ```
|
/// ```
|
||||||
#[func(title = "Decode Image")]
|
#[func(title = "Decode Image")]
|
||||||
pub fn decode(
|
pub fn decode(
|
||||||
/// The call span of this function.
|
|
||||||
span: Span,
|
span: Span,
|
||||||
/// The data to decode as an image. Can be a string for SVGs.
|
/// The data to decode as an image. Can be a string for SVGs.
|
||||||
data: Readable,
|
data: Readable,
|
||||||
|
@ -67,8 +67,8 @@ impl PolygonElem {
|
|||||||
/// ```
|
/// ```
|
||||||
#[func(title = "Regular Polygon")]
|
#[func(title = "Regular Polygon")]
|
||||||
pub fn regular(
|
pub fn regular(
|
||||||
/// The call span of this function.
|
|
||||||
span: Span,
|
span: Span,
|
||||||
|
|
||||||
/// How to fill the polygon. See the general
|
/// How to fill the polygon. See the general
|
||||||
/// [polygon's documentation]($polygon.fill) for more details.
|
/// [polygon's documentation]($polygon.fill) for more details.
|
||||||
#[named]
|
#[named]
|
||||||
|
@ -97,8 +97,6 @@ impl Stroke {
|
|||||||
/// ```
|
/// ```
|
||||||
#[func(constructor)]
|
#[func(constructor)]
|
||||||
pub fn construct(
|
pub fn construct(
|
||||||
/// The real arguments (the other arguments are just for the docs, this
|
|
||||||
/// function is a bit involved, so we parse the arguments manually).
|
|
||||||
args: &mut Args,
|
args: &mut Args,
|
||||||
|
|
||||||
/// The color or gradient to use for the stroke.
|
/// The color or gradient to use for the stroke.
|
||||||
|
@ -138,7 +138,6 @@ impl Tiling {
|
|||||||
#[func(constructor)]
|
#[func(constructor)]
|
||||||
pub fn construct(
|
pub fn construct(
|
||||||
engine: &mut Engine,
|
engine: &mut Engine,
|
||||||
/// The callsite span.
|
|
||||||
span: Span,
|
span: Span,
|
||||||
/// The bounding box of each cell of the tiling.
|
/// The bounding box of each cell of the tiling.
|
||||||
#[named]
|
#[named]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user