mirror of
https://github.com/typst/typst
synced 2025-05-14 17:15:28 +08:00
Document how to import func (#3889)
Co-authored-by: Laurenz <laurmaedje@gmail.com>
This commit is contained in:
parent
2663f42442
commit
7ea55ec9a0
@ -102,6 +102,12 @@ pub use typst_macros::func;
|
|||||||
/// ]
|
/// ]
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
|
/// # Importing functions
|
||||||
|
/// Functions can be imported from one file ([`module`]($scripting/#modules)) into
|
||||||
|
/// another using `{import}`. For example, assume that we have defined the `alert`
|
||||||
|
/// function from the previous example in a file called `foo.typ`. We can import
|
||||||
|
/// it into another file by writing `{import "foo.typ": alert}`.
|
||||||
|
///
|
||||||
/// # Unnamed functions { #unnamed }
|
/// # Unnamed functions { #unnamed }
|
||||||
/// You can also created an unnamed function without creating a binding by
|
/// You can also created an unnamed function without creating a binding by
|
||||||
/// specifying a parameter list followed by `=>` and the function body. If your
|
/// specifying a parameter list followed by `=>` and the function body. If your
|
||||||
|
Loading…
x
Reference in New Issue
Block a user