mirror of
https://github.com/typst/typst
synced 2025-05-13 20:46:23 +08:00
Update remaining examples
This commit is contained in:
parent
c987f07b76
commit
c3b3bbb9f2
@ -111,7 +111,7 @@ fn minmax(args: &mut Args, goal: Ordering) -> SourceResult<Value> {
|
|||||||
/// ```
|
/// ```
|
||||||
/// #even(4) \
|
/// #even(4) \
|
||||||
/// #even(5) \
|
/// #even(5) \
|
||||||
/// { range(10).filter(even) }
|
/// #range(10).filter(even)
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// ## Parameters
|
/// ## Parameters
|
||||||
@ -134,7 +134,7 @@ pub fn even(args: &mut Args) -> SourceResult<Value> {
|
|||||||
/// ```
|
/// ```
|
||||||
/// #odd(4) \
|
/// #odd(4) \
|
||||||
/// #odd(5) \
|
/// #odd(5) \
|
||||||
/// { range(10).filter(odd) }
|
/// #range(10).filter(odd)
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
///
|
///
|
||||||
|
@ -16,7 +16,7 @@ use crate::prelude::*;
|
|||||||
/// #int(false) \
|
/// #int(false) \
|
||||||
/// #int(true) \
|
/// #int(true) \
|
||||||
/// #int(2.7) \
|
/// #int(2.7) \
|
||||||
/// { int("27") + int("4") }
|
/// #{ int("27") + int("4") }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// ## Parameters
|
/// ## Parameters
|
||||||
@ -331,7 +331,7 @@ pub fn label(args: &mut Args) -> SourceResult<Value> {
|
|||||||
/// The numbers 1 to 10.
|
/// The numbers 1 to 10.
|
||||||
///
|
///
|
||||||
/// // Works with string methods.
|
/// // Works with string methods.
|
||||||
/// { "a,b;c"
|
/// #{ "a,b;c"
|
||||||
/// .split(regex("[,;]")) }
|
/// .split(regex("[,;]")) }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
|
@ -166,7 +166,7 @@ fn format_csv_error(error: csv::Error) -> String {
|
|||||||
/// )
|
/// )
|
||||||
/// #h(6pt)
|
/// #h(6pt)
|
||||||
/// #set text(22pt, baseline: -8pt)
|
/// #set text(22pt, baseline: -8pt)
|
||||||
/// {day.temperature} °{day.unit}
|
/// #{day.temperature} °#{day.unit}
|
||||||
/// ]
|
/// ]
|
||||||
///
|
///
|
||||||
/// #forecast(json("monday.json"))
|
/// #forecast(json("monday.json"))
|
||||||
@ -253,7 +253,7 @@ fn format_json_error(error: serde_json::Error) -> String {
|
|||||||
/// heading(title.children.first())
|
/// heading(title.children.first())
|
||||||
/// text(10pt, weight: "medium")[
|
/// text(10pt, weight: "medium")[
|
||||||
/// Published by
|
/// Published by
|
||||||
/// {author.children.first()}
|
/// #{author.children.first()}
|
||||||
/// ]
|
/// ]
|
||||||
///
|
///
|
||||||
/// for p in pars.children {
|
/// for p in pars.children {
|
||||||
|
@ -110,13 +110,13 @@ impl Inline for BoxNode {}
|
|||||||
///
|
///
|
||||||
/// ## Example
|
/// ## Example
|
||||||
/// ```
|
/// ```
|
||||||
/// [
|
/// #[
|
||||||
/// #show heading: it => it.title
|
/// #show heading: it => it.title
|
||||||
/// = No block
|
/// = No block
|
||||||
/// Some text
|
/// Some text
|
||||||
/// ]
|
/// ]
|
||||||
///
|
///
|
||||||
/// [
|
/// #[
|
||||||
/// #show heading: it => block(it.title)
|
/// #show heading: it => block(it.title)
|
||||||
/// = Block
|
/// = Block
|
||||||
/// Some more text
|
/// Some more text
|
||||||
|
Loading…
x
Reference in New Issue
Block a user