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