mirror of
https://github.com/typst/typst
synced 2025-05-14 17:15:28 +08:00
Fix docs example with type/string comparison (#5987)
This commit is contained in:
parent
cfb3b1a270
commit
66679920b2
@ -34,14 +34,14 @@ use crate::loading::{DataSource, Load, Readable};
|
|||||||
/// let author = find-child(elem, "author")
|
/// let author = find-child(elem, "author")
|
||||||
/// let pars = find-child(elem, "content")
|
/// let pars = find-child(elem, "content")
|
||||||
///
|
///
|
||||||
/// heading(title.children.first())
|
/// [= #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 {
|
||||||
/// if (type(p) == "dictionary") {
|
/// if type(p) == dictionary {
|
||||||
/// parbreak()
|
/// parbreak()
|
||||||
/// p.children.first()
|
/// p.children.first()
|
||||||
/// }
|
/// }
|
||||||
@ -50,7 +50,7 @@ use crate::loading::{DataSource, Load, Readable};
|
|||||||
///
|
///
|
||||||
/// #let data = xml("example.xml")
|
/// #let data = xml("example.xml")
|
||||||
/// #for elem in data.first().children {
|
/// #for elem in data.first().children {
|
||||||
/// if (type(elem) == "dictionary") {
|
/// if type(elem) == dictionary {
|
||||||
/// article(elem)
|
/// article(elem)
|
||||||
/// }
|
/// }
|
||||||
/// }
|
/// }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user