mirror of
https://github.com/typst/typst
synced 2025-05-14 17:15:28 +08:00
parent
4f1d97253d
commit
098ef5acbb
@ -358,7 +358,7 @@ pub fn symbols(stream: BoundaryStream) -> BoundaryStream {
|
|||||||
/// - `#[time(span = ..)]` to record the span, which will be used for the
|
/// - `#[time(span = ..)]` to record the span, which will be used for the
|
||||||
/// `EventKey`.
|
/// `EventKey`.
|
||||||
///
|
///
|
||||||
/// By default, all tracing is ommited using the `wasm32` target flag.
|
/// By default, all tracing is omitted using the `wasm32` target flag.
|
||||||
/// This is done to avoid bloating the web app which doesn't need tracing.
|
/// This is done to avoid bloating the web app which doesn't need tracing.
|
||||||
///
|
///
|
||||||
/// ```ignore
|
/// ```ignore
|
||||||
|
@ -1279,7 +1279,7 @@ impl<T> Deduplicator<T> {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Iterate over the the elements alongside their ids.
|
/// Iterate over the elements alongside their ids.
|
||||||
fn iter(&self) -> impl Iterator<Item = (Id, &T)> {
|
fn iter(&self) -> impl Iterator<Item = (Id, &T)> {
|
||||||
self.vec
|
self.vec
|
||||||
.iter()
|
.iter()
|
||||||
|
@ -1271,7 +1271,7 @@ node! {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Spread<'a> {
|
impl<'a> Spread<'a> {
|
||||||
/// The spreaded expression.
|
/// The spread expression.
|
||||||
///
|
///
|
||||||
/// This should only be accessed if this `Spread` is contained in an
|
/// This should only be accessed if this `Spread` is contained in an
|
||||||
/// `ArrayItem`, `DictItem`, or `Arg`.
|
/// `ArrayItem`, `DictItem`, or `Arg`.
|
||||||
|
@ -1161,7 +1161,7 @@ fn array_or_dict_item(p: &mut Parser, state: &mut GroupState) {
|
|||||||
let m = p.marker();
|
let m = p.marker();
|
||||||
|
|
||||||
if p.eat_if(SyntaxKind::Dots) {
|
if p.eat_if(SyntaxKind::Dots) {
|
||||||
// Parses a spreaded item: `..item`.
|
// Parses a spread item: `..item`.
|
||||||
code_expr(p);
|
code_expr(p);
|
||||||
p.wrap(m, SyntaxKind::Spread);
|
p.wrap(m, SyntaxKind::Spread);
|
||||||
state.maybe_just_parens = false;
|
state.maybe_just_parens = false;
|
||||||
@ -1249,7 +1249,7 @@ fn args(p: &mut Parser) {
|
|||||||
fn arg<'s>(p: &mut Parser<'s>, seen: &mut HashSet<&'s str>) {
|
fn arg<'s>(p: &mut Parser<'s>, seen: &mut HashSet<&'s str>) {
|
||||||
let m = p.marker();
|
let m = p.marker();
|
||||||
|
|
||||||
// Parses a spreaded argument: `..args`.
|
// Parses a spread argument: `..args`.
|
||||||
if p.eat_if(SyntaxKind::Dots) {
|
if p.eat_if(SyntaxKind::Dots) {
|
||||||
code_expr(p);
|
code_expr(p);
|
||||||
p.wrap(m, SyntaxKind::Spread);
|
p.wrap(m, SyntaxKind::Spread);
|
||||||
|
@ -181,7 +181,7 @@ impl Selector {
|
|||||||
Self::Or(others.into_iter().chain(Some(self)).collect())
|
Self::Or(others.into_iter().chain(Some(self)).collect())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Selects all elements that match this and all of the the other selectors.
|
/// Selects all elements that match this and all of the other selectors.
|
||||||
#[func]
|
#[func]
|
||||||
pub fn and(
|
pub fn and(
|
||||||
self,
|
self,
|
||||||
|
@ -25,7 +25,7 @@ use crate::introspection::Location;
|
|||||||
///
|
///
|
||||||
/// - On the first page the query for all headings before the current location
|
/// - On the first page the query for all headings before the current location
|
||||||
/// yields an empty array: There are no previous headings. We check for this
|
/// yields an empty array: There are no previous headings. We check for this
|
||||||
/// case and and just display "Typst Academy".
|
/// case and just display "Typst Academy".
|
||||||
///
|
///
|
||||||
/// - For the second page, we retrieve the last element from the query's result.
|
/// - For the second page, we retrieve the last element from the query's result.
|
||||||
/// This is the latest heading before the current position and as such, it is
|
/// This is the latest heading before the current position and as such, it is
|
||||||
|
@ -8,7 +8,7 @@ use crate::foundations::{repr, ty, Repr};
|
|||||||
use crate::layout::Abs;
|
use crate::layout::Abs;
|
||||||
use crate::util::{Numeric, Scalar};
|
use crate::util::{Numeric, Scalar};
|
||||||
|
|
||||||
/// Defines how the the remaining space in a layout is distributed.
|
/// Defines how the remaining space in a layout is distributed.
|
||||||
///
|
///
|
||||||
/// Each fractionally sized element gets space based on the ratio of its
|
/// Each fractionally sized element gets space based on the ratio of its
|
||||||
/// fraction to the sum of all fractions.
|
/// fraction to the sum of all fractions.
|
||||||
|
@ -920,7 +920,7 @@ fn nbsp_delta(font: &Font) -> Option<Em> {
|
|||||||
Some(font.advance(nbsp)? - font.advance(space)?)
|
Some(font.advance(nbsp)? - font.advance(space)?)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Process the language and and region of a style chain into a
|
/// Process the language and region of a style chain into a
|
||||||
/// rustybuzz-compatible BCP 47 language.
|
/// rustybuzz-compatible BCP 47 language.
|
||||||
fn language(styles: StyleChain) -> rustybuzz::Language {
|
fn language(styles: StyleChain) -> rustybuzz::Language {
|
||||||
let mut bcp: EcoString = TextElem::lang_in(styles).as_str().into();
|
let mut bcp: EcoString = TextElem::lang_in(styles).as_str().into();
|
||||||
|
@ -12,7 +12,7 @@ use crate::World;
|
|||||||
///
|
///
|
||||||
/// The XML file is parsed into an array of dictionaries and strings. XML nodes
|
/// The XML file is parsed into an array of dictionaries and strings. XML nodes
|
||||||
/// can be elements or strings. Elements are represented as dictionaries with
|
/// can be elements or strings. Elements are represented as dictionaries with
|
||||||
/// the the following keys:
|
/// the following keys:
|
||||||
///
|
///
|
||||||
/// - `tag`: The name of the element as a string.
|
/// - `tag`: The name of the element as a string.
|
||||||
/// - `attrs`: A dictionary of the element's attributes as strings.
|
/// - `attrs`: A dictionary of the element's attributes as strings.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user