mirror of
https://github.com/typst/typst
synced 2025-08-17 08:28:33 +08:00
Compare commits
6 Commits
76d3afb84b
...
7982ba3e3d
Author | SHA1 | Date | |
---|---|---|---|
|
7982ba3e3d | ||
|
f51cb4b03e | ||
|
0c12828c9a | ||
|
b1a091a236 | ||
|
f7070b57eb | ||
|
09d35c8254 |
@ -46,7 +46,7 @@ impl i64 {
|
||||
/// or smaller than the minimum 64-bit signed integer.
|
||||
///
|
||||
/// - Booleans are converted to `0` or `1`.
|
||||
/// - Floats and decimals are truncated to the next 64-bit integer.
|
||||
/// - Floats and decimals are rounded to the next 64-bit integer towards zero.
|
||||
/// - Strings are parsed in base 10.
|
||||
///
|
||||
/// ```example
|
||||
|
@ -38,12 +38,12 @@ pub use crate::__select_where as select_where;
|
||||
/// A filter for selecting elements within the document.
|
||||
///
|
||||
/// You can construct a selector in the following ways:
|
||||
/// - you can use an element [function]
|
||||
/// - you can filter for an element function with
|
||||
/// - use an element [function]
|
||||
/// - filter for an element function with
|
||||
/// [specific fields]($function.where)
|
||||
/// - you can use a [string]($str) or [regular expression]($regex)
|
||||
/// - you can use a [`{<label>}`]($label)
|
||||
/// - you can use a [`location`]
|
||||
/// - use a [string]($str) or [regular expression]($regex)
|
||||
/// - use a [`{<label>}`]($label)
|
||||
/// - use a [`location`]
|
||||
/// - call the [`selector`] constructor to convert any of the above types into a
|
||||
/// selector value and use the methods below to refine it
|
||||
///
|
||||
@ -148,7 +148,9 @@ impl Selector {
|
||||
impl Selector {
|
||||
/// Turns a value into a selector. The following values are accepted:
|
||||
/// - An element function like a `heading` or `figure`.
|
||||
/// - A [string]($str) or [regular expression]($regex).
|
||||
/// - A `{<label>}`.
|
||||
/// - A [`location`].
|
||||
/// - A more complex selector like `{heading.where(level: 1)}`.
|
||||
#[func(constructor)]
|
||||
pub fn construct(
|
||||
|
@ -20,8 +20,8 @@ use crate::text::{FontFamily, FontList, FontWeight, LocalName, TextElem};
|
||||
/// A mathematical equation.
|
||||
///
|
||||
/// Can be displayed inline with text or as a separate block. An equation
|
||||
/// becomes block-level through the presence of at least one space after the
|
||||
/// opening dollar sign and one space before the closing dollar sign.
|
||||
/// becomes block-level through the presence of whitespace after the opening
|
||||
/// dollar sign and whitespace before the closing dollar sign.
|
||||
///
|
||||
/// # Example
|
||||
/// ```example
|
||||
@ -41,9 +41,9 @@ use crate::text::{FontFamily, FontList, FontWeight, LocalName, TextElem};
|
||||
///
|
||||
/// # Syntax
|
||||
/// This function also has dedicated syntax: Write mathematical markup within
|
||||
/// dollar signs to create an equation. Starting and ending the equation with at
|
||||
/// least one space lifts it into a separate block that is centered
|
||||
/// horizontally. For more details about math syntax, see the
|
||||
/// dollar signs to create an equation. Starting and ending the equation with
|
||||
/// whitespace lifts it into a separate block that is centered horizontally.
|
||||
/// For more details about math syntax, see the
|
||||
/// [main math page]($category/math).
|
||||
#[elem(Locatable, Synthesize, ShowSet, Count, LocalName, Refable, Outlinable)]
|
||||
pub struct EquationElem {
|
||||
|
@ -92,7 +92,7 @@ pub(super) fn define(global: &mut Scope) {
|
||||
/// ```
|
||||
#[elem(Debug, Construct, PlainText, Repr)]
|
||||
pub struct TextElem {
|
||||
/// A font family descriptor or priority list of font family descriptor.
|
||||
/// A font family descriptor or priority list of font family descriptors.
|
||||
///
|
||||
/// A font family descriptor can be a plain string representing the family
|
||||
/// name or a dictionary with the following keys:
|
||||
|
Loading…
x
Reference in New Issue
Block a user