mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-08-03 17:58:17 +00:00
fix: bad route to reference pages (#1641)
* test: add tests * fix: bad route
This commit is contained in:
parent
5c6d9a5dee
commit
fcb060280d
4 changed files with 445 additions and 13 deletions
|
@ -170,8 +170,8 @@
|
|||
category: symbols
|
||||
path: ["emoji"]
|
||||
details: |
|
||||
Named emoji.
|
||||
Named emojis.
|
||||
|
||||
For example, `#emoji.face` produces the 😀 emoji. If you frequently use
|
||||
certain emojis, you can also import them from the `emoji` module (`[#import
|
||||
emoji: face]`) to use them without the `#emoji.` prefix.
|
||||
emoji: face]`) to use them without the `emoji.` prefix.
|
||||
|
|
|
@ -12,7 +12,7 @@ use typst::{
|
|||
introspection::MetadataElem,
|
||||
syntax::Span,
|
||||
text::{FontInfo, FontStyle},
|
||||
Library, World,
|
||||
Category, Library, World,
|
||||
};
|
||||
|
||||
mod tooltip;
|
||||
|
@ -309,11 +309,7 @@ static ROUTE_MAPS: LazyLock<HashMap<CatKey, String>> = LazyLock::new(|| {
|
|||
|
||||
crate::log_debug_ct!("func: {func:?} -> {cat:?}");
|
||||
|
||||
let route = if let Some(parent_name) = &parent_name {
|
||||
format!("reference/{}/{parent_name}/#definitions-{name}", cat.name())
|
||||
} else {
|
||||
format!("reference/{}/{name}/", cat.name())
|
||||
};
|
||||
let route = format_route(parent_name.as_deref(), name, &cat);
|
||||
|
||||
map.insert(CatKey::Func(func.clone()), route);
|
||||
}
|
||||
|
@ -325,11 +321,7 @@ static ROUTE_MAPS: LazyLock<HashMap<CatKey, String>> = LazyLock::new(|| {
|
|||
if let Some(cat) = cat {
|
||||
crate::log_debug_ct!("type: {t:?} -> {cat:?}");
|
||||
|
||||
let route = if let Some(parent_name) = &parent_name {
|
||||
format!("reference/{}/{parent_name}/#definitions-{name}", cat.name())
|
||||
} else {
|
||||
format!("reference/{}/{name}/", cat.name())
|
||||
};
|
||||
let route = format_route(parent_name.as_deref(), &name, &cat);
|
||||
map.insert(CatKey::Type(*t), route);
|
||||
}
|
||||
scope_to_finds.push((t.scope(), Some(name), cat));
|
||||
|
@ -344,6 +336,15 @@ static ROUTE_MAPS: LazyLock<HashMap<CatKey, String>> = LazyLock::new(|| {
|
|||
map
|
||||
});
|
||||
|
||||
fn format_route(parent_name: Option<&str>, name: &str, cat: &Category) -> String {
|
||||
match parent_name {
|
||||
Some(parent_name) if parent_name != cat.name() => {
|
||||
format!("reference/{}/{parent_name}/#definitions-{name}", cat.name())
|
||||
}
|
||||
Some(_) | None => format!("reference/{}/{name}/", cat.name()),
|
||||
}
|
||||
}
|
||||
|
||||
/// Turn a title into an URL fragment.
|
||||
pub(crate) fn urlify(title: &str) -> EcoString {
|
||||
title
|
||||
|
@ -462,6 +463,8 @@ pub fn with_vm<T>(
|
|||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::upstream::ROUTE_MAPS;
|
||||
|
||||
#[test]
|
||||
fn docs_test() {
|
||||
assert_eq!(
|
||||
|
@ -485,4 +488,423 @@ mod tests {
|
|||
super::plain_docs_sentence("[citation][cite](test)[cite2]")
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn routes() {
|
||||
let access = |route: &String| format!("https://typst.app/docs/{route}");
|
||||
let mut values = ROUTE_MAPS.values().map(access).collect::<Vec<_>>();
|
||||
values.sort();
|
||||
|
||||
insta::assert_snapshot!(values.as_slice().join("\n"), @r###"
|
||||
https://typst.app/docs/reference/data-loading/cbor/
|
||||
https://typst.app/docs/reference/data-loading/cbor/#definitions-decode
|
||||
https://typst.app/docs/reference/data-loading/cbor/#definitions-encode
|
||||
https://typst.app/docs/reference/data-loading/csv/
|
||||
https://typst.app/docs/reference/data-loading/csv/#definitions-decode
|
||||
https://typst.app/docs/reference/data-loading/json/
|
||||
https://typst.app/docs/reference/data-loading/json/#definitions-decode
|
||||
https://typst.app/docs/reference/data-loading/json/#definitions-encode
|
||||
https://typst.app/docs/reference/data-loading/read/
|
||||
https://typst.app/docs/reference/data-loading/toml/
|
||||
https://typst.app/docs/reference/data-loading/toml/#definitions-decode
|
||||
https://typst.app/docs/reference/data-loading/toml/#definitions-encode
|
||||
https://typst.app/docs/reference/data-loading/xml/
|
||||
https://typst.app/docs/reference/data-loading/xml/#definitions-decode
|
||||
https://typst.app/docs/reference/data-loading/yaml/
|
||||
https://typst.app/docs/reference/data-loading/yaml/#definitions-decode
|
||||
https://typst.app/docs/reference/data-loading/yaml/#definitions-encode
|
||||
https://typst.app/docs/reference/foundations/arguments/
|
||||
https://typst.app/docs/reference/foundations/arguments/#definitions-at
|
||||
https://typst.app/docs/reference/foundations/arguments/#definitions-named
|
||||
https://typst.app/docs/reference/foundations/arguments/#definitions-pos
|
||||
https://typst.app/docs/reference/foundations/array/
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-all
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-any
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-at
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-chunks
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-contains
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-dedup
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-enumerate
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-filter
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-find
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-first
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-flatten
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-fold
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-insert
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-intersperse
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-join
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-last
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-len
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-map
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-pop
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-position
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-product
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-push
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-range
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-reduce
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-remove
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-rev
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-slice
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-sorted
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-split
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-sum
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-to-dict
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-windows
|
||||
https://typst.app/docs/reference/foundations/array/#definitions-zip
|
||||
https://typst.app/docs/reference/foundations/assert/
|
||||
https://typst.app/docs/reference/foundations/assert/#definitions-eq
|
||||
https://typst.app/docs/reference/foundations/assert/#definitions-ne
|
||||
https://typst.app/docs/reference/foundations/bool/
|
||||
https://typst.app/docs/reference/foundations/bytes/
|
||||
https://typst.app/docs/reference/foundations/bytes/#definitions-at
|
||||
https://typst.app/docs/reference/foundations/bytes/#definitions-len
|
||||
https://typst.app/docs/reference/foundations/bytes/#definitions-slice
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-abs
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-acos
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-asin
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-atan
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-atan2
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-binom
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-ceil
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-clamp
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-cos
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-cosh
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-div-euclid
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-even
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-exp
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-fact
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-floor
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-fract
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-gcd
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-lcm
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-ln
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-log
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-max
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-min
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-norm
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-odd
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-perm
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-pow
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-quo
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-rem
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-rem-euclid
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-root
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-round
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-sin
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-sinh
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-sqrt
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-tan
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-tanh
|
||||
https://typst.app/docs/reference/foundations/calc/#functions-trunc
|
||||
https://typst.app/docs/reference/foundations/content/
|
||||
https://typst.app/docs/reference/foundations/content/#definitions-at
|
||||
https://typst.app/docs/reference/foundations/content/#definitions-fields
|
||||
https://typst.app/docs/reference/foundations/content/#definitions-func
|
||||
https://typst.app/docs/reference/foundations/content/#definitions-has
|
||||
https://typst.app/docs/reference/foundations/content/#definitions-location
|
||||
https://typst.app/docs/reference/foundations/datetime/
|
||||
https://typst.app/docs/reference/foundations/datetime/#definitions-day
|
||||
https://typst.app/docs/reference/foundations/datetime/#definitions-display
|
||||
https://typst.app/docs/reference/foundations/datetime/#definitions-hour
|
||||
https://typst.app/docs/reference/foundations/datetime/#definitions-minute
|
||||
https://typst.app/docs/reference/foundations/datetime/#definitions-month
|
||||
https://typst.app/docs/reference/foundations/datetime/#definitions-ordinal
|
||||
https://typst.app/docs/reference/foundations/datetime/#definitions-second
|
||||
https://typst.app/docs/reference/foundations/datetime/#definitions-today
|
||||
https://typst.app/docs/reference/foundations/datetime/#definitions-weekday
|
||||
https://typst.app/docs/reference/foundations/datetime/#definitions-year
|
||||
https://typst.app/docs/reference/foundations/decimal/
|
||||
https://typst.app/docs/reference/foundations/dictionary/
|
||||
https://typst.app/docs/reference/foundations/dictionary/#definitions-at
|
||||
https://typst.app/docs/reference/foundations/dictionary/#definitions-insert
|
||||
https://typst.app/docs/reference/foundations/dictionary/#definitions-keys
|
||||
https://typst.app/docs/reference/foundations/dictionary/#definitions-len
|
||||
https://typst.app/docs/reference/foundations/dictionary/#definitions-pairs
|
||||
https://typst.app/docs/reference/foundations/dictionary/#definitions-remove
|
||||
https://typst.app/docs/reference/foundations/dictionary/#definitions-values
|
||||
https://typst.app/docs/reference/foundations/duration/
|
||||
https://typst.app/docs/reference/foundations/duration/#definitions-days
|
||||
https://typst.app/docs/reference/foundations/duration/#definitions-hours
|
||||
https://typst.app/docs/reference/foundations/duration/#definitions-minutes
|
||||
https://typst.app/docs/reference/foundations/duration/#definitions-seconds
|
||||
https://typst.app/docs/reference/foundations/duration/#definitions-weeks
|
||||
https://typst.app/docs/reference/foundations/eval/
|
||||
https://typst.app/docs/reference/foundations/float/
|
||||
https://typst.app/docs/reference/foundations/float/#definitions-from-bytes
|
||||
https://typst.app/docs/reference/foundations/float/#definitions-is-infinite
|
||||
https://typst.app/docs/reference/foundations/float/#definitions-is-nan
|
||||
https://typst.app/docs/reference/foundations/float/#definitions-signum
|
||||
https://typst.app/docs/reference/foundations/float/#definitions-to-bytes
|
||||
https://typst.app/docs/reference/foundations/function/
|
||||
https://typst.app/docs/reference/foundations/function/#definitions-where
|
||||
https://typst.app/docs/reference/foundations/function/#definitions-with
|
||||
https://typst.app/docs/reference/foundations/int/
|
||||
https://typst.app/docs/reference/foundations/int/#definitions-bit-and
|
||||
https://typst.app/docs/reference/foundations/int/#definitions-bit-lshift
|
||||
https://typst.app/docs/reference/foundations/int/#definitions-bit-not
|
||||
https://typst.app/docs/reference/foundations/int/#definitions-bit-or
|
||||
https://typst.app/docs/reference/foundations/int/#definitions-bit-rshift
|
||||
https://typst.app/docs/reference/foundations/int/#definitions-bit-xor
|
||||
https://typst.app/docs/reference/foundations/int/#definitions-from-bytes
|
||||
https://typst.app/docs/reference/foundations/int/#definitions-signum
|
||||
https://typst.app/docs/reference/foundations/int/#definitions-to-bytes
|
||||
https://typst.app/docs/reference/foundations/label/
|
||||
https://typst.app/docs/reference/foundations/module/
|
||||
https://typst.app/docs/reference/foundations/panic/
|
||||
https://typst.app/docs/reference/foundations/plugin/
|
||||
https://typst.app/docs/reference/foundations/plugin/#definitions-transition
|
||||
https://typst.app/docs/reference/foundations/regex/
|
||||
https://typst.app/docs/reference/foundations/repr/
|
||||
https://typst.app/docs/reference/foundations/selector/
|
||||
https://typst.app/docs/reference/foundations/selector/#definitions-after
|
||||
https://typst.app/docs/reference/foundations/selector/#definitions-and
|
||||
https://typst.app/docs/reference/foundations/selector/#definitions-before
|
||||
https://typst.app/docs/reference/foundations/selector/#definitions-or
|
||||
https://typst.app/docs/reference/foundations/str/
|
||||
https://typst.app/docs/reference/foundations/str/#definitions-at
|
||||
https://typst.app/docs/reference/foundations/str/#definitions-clusters
|
||||
https://typst.app/docs/reference/foundations/str/#definitions-codepoints
|
||||
https://typst.app/docs/reference/foundations/str/#definitions-contains
|
||||
https://typst.app/docs/reference/foundations/str/#definitions-ends-with
|
||||
https://typst.app/docs/reference/foundations/str/#definitions-find
|
||||
https://typst.app/docs/reference/foundations/str/#definitions-first
|
||||
https://typst.app/docs/reference/foundations/str/#definitions-from-unicode
|
||||
https://typst.app/docs/reference/foundations/str/#definitions-last
|
||||
https://typst.app/docs/reference/foundations/str/#definitions-len
|
||||
https://typst.app/docs/reference/foundations/str/#definitions-match
|
||||
https://typst.app/docs/reference/foundations/str/#definitions-matches
|
||||
https://typst.app/docs/reference/foundations/str/#definitions-position
|
||||
https://typst.app/docs/reference/foundations/str/#definitions-replace
|
||||
https://typst.app/docs/reference/foundations/str/#definitions-rev
|
||||
https://typst.app/docs/reference/foundations/str/#definitions-slice
|
||||
https://typst.app/docs/reference/foundations/str/#definitions-split
|
||||
https://typst.app/docs/reference/foundations/str/#definitions-starts-with
|
||||
https://typst.app/docs/reference/foundations/str/#definitions-to-unicode
|
||||
https://typst.app/docs/reference/foundations/str/#definitions-trim
|
||||
https://typst.app/docs/reference/foundations/symbol/
|
||||
https://typst.app/docs/reference/foundations/type/
|
||||
https://typst.app/docs/reference/foundations/version/
|
||||
https://typst.app/docs/reference/foundations/version/#definitions-at
|
||||
https://typst.app/docs/reference/introspection/counter/
|
||||
https://typst.app/docs/reference/introspection/counter/#definitions-at
|
||||
https://typst.app/docs/reference/introspection/counter/#definitions-display
|
||||
https://typst.app/docs/reference/introspection/counter/#definitions-final
|
||||
https://typst.app/docs/reference/introspection/counter/#definitions-get
|
||||
https://typst.app/docs/reference/introspection/counter/#definitions-step
|
||||
https://typst.app/docs/reference/introspection/counter/#definitions-update
|
||||
https://typst.app/docs/reference/introspection/here/
|
||||
https://typst.app/docs/reference/introspection/locate/
|
||||
https://typst.app/docs/reference/introspection/location/
|
||||
https://typst.app/docs/reference/introspection/location/#definitions-page
|
||||
https://typst.app/docs/reference/introspection/location/#definitions-page-numbering
|
||||
https://typst.app/docs/reference/introspection/location/#definitions-position
|
||||
https://typst.app/docs/reference/introspection/metadata/
|
||||
https://typst.app/docs/reference/introspection/query/
|
||||
https://typst.app/docs/reference/introspection/state/
|
||||
https://typst.app/docs/reference/introspection/state/#definitions-at
|
||||
https://typst.app/docs/reference/introspection/state/#definitions-final
|
||||
https://typst.app/docs/reference/introspection/state/#definitions-get
|
||||
https://typst.app/docs/reference/introspection/state/#definitions-update
|
||||
https://typst.app/docs/reference/layout/align/
|
||||
https://typst.app/docs/reference/layout/alignment/
|
||||
https://typst.app/docs/reference/layout/alignment/#definitions-axis
|
||||
https://typst.app/docs/reference/layout/alignment/#definitions-inv
|
||||
https://typst.app/docs/reference/layout/angle/
|
||||
https://typst.app/docs/reference/layout/angle/#definitions-deg
|
||||
https://typst.app/docs/reference/layout/angle/#definitions-rad
|
||||
https://typst.app/docs/reference/layout/block/
|
||||
https://typst.app/docs/reference/layout/box/
|
||||
https://typst.app/docs/reference/layout/colbreak/
|
||||
https://typst.app/docs/reference/layout/columns/
|
||||
https://typst.app/docs/reference/layout/direction/
|
||||
https://typst.app/docs/reference/layout/direction/#definitions-axis
|
||||
https://typst.app/docs/reference/layout/direction/#definitions-end
|
||||
https://typst.app/docs/reference/layout/direction/#definitions-inv
|
||||
https://typst.app/docs/reference/layout/direction/#definitions-start
|
||||
https://typst.app/docs/reference/layout/fraction/
|
||||
https://typst.app/docs/reference/layout/grid/
|
||||
https://typst.app/docs/reference/layout/grid/#definitions-cell
|
||||
https://typst.app/docs/reference/layout/grid/#definitions-footer
|
||||
https://typst.app/docs/reference/layout/grid/#definitions-header
|
||||
https://typst.app/docs/reference/layout/grid/#definitions-hline
|
||||
https://typst.app/docs/reference/layout/grid/#definitions-vline
|
||||
https://typst.app/docs/reference/layout/h/
|
||||
https://typst.app/docs/reference/layout/hide/
|
||||
https://typst.app/docs/reference/layout/layout/
|
||||
https://typst.app/docs/reference/layout/length/
|
||||
https://typst.app/docs/reference/layout/length/#definitions-cm
|
||||
https://typst.app/docs/reference/layout/length/#definitions-inches
|
||||
https://typst.app/docs/reference/layout/length/#definitions-mm
|
||||
https://typst.app/docs/reference/layout/length/#definitions-pt
|
||||
https://typst.app/docs/reference/layout/length/#definitions-to-absolute
|
||||
https://typst.app/docs/reference/layout/measure/
|
||||
https://typst.app/docs/reference/layout/move/
|
||||
https://typst.app/docs/reference/layout/pad/
|
||||
https://typst.app/docs/reference/layout/page/
|
||||
https://typst.app/docs/reference/layout/pagebreak/
|
||||
https://typst.app/docs/reference/layout/place/
|
||||
https://typst.app/docs/reference/layout/place/#definitions-flush
|
||||
https://typst.app/docs/reference/layout/ratio/
|
||||
https://typst.app/docs/reference/layout/relative/
|
||||
https://typst.app/docs/reference/layout/repeat/
|
||||
https://typst.app/docs/reference/layout/rotate/
|
||||
https://typst.app/docs/reference/layout/scale/
|
||||
https://typst.app/docs/reference/layout/skew/
|
||||
https://typst.app/docs/reference/layout/stack/
|
||||
https://typst.app/docs/reference/layout/v/
|
||||
https://typst.app/docs/reference/math/accent/
|
||||
https://typst.app/docs/reference/math/attach/#functions-attach
|
||||
https://typst.app/docs/reference/math/attach/#functions-limits
|
||||
https://typst.app/docs/reference/math/attach/#functions-scripts
|
||||
https://typst.app/docs/reference/math/binom/
|
||||
https://typst.app/docs/reference/math/cancel/
|
||||
https://typst.app/docs/reference/math/cases/
|
||||
https://typst.app/docs/reference/math/class/
|
||||
https://typst.app/docs/reference/math/equation/
|
||||
https://typst.app/docs/reference/math/frac/
|
||||
https://typst.app/docs/reference/math/lr/#functions-abs
|
||||
https://typst.app/docs/reference/math/lr/#functions-lr
|
||||
https://typst.app/docs/reference/math/lr/#functions-mid
|
||||
https://typst.app/docs/reference/math/lr/#functions-norm
|
||||
https://typst.app/docs/reference/math/lr/#functions-round
|
||||
https://typst.app/docs/reference/math/mat/
|
||||
https://typst.app/docs/reference/math/op/
|
||||
https://typst.app/docs/reference/math/primes/
|
||||
https://typst.app/docs/reference/math/roots/#functions-root
|
||||
https://typst.app/docs/reference/math/roots/#functions-sqrt
|
||||
https://typst.app/docs/reference/math/sizes/#functions-display
|
||||
https://typst.app/docs/reference/math/sizes/#functions-inline
|
||||
https://typst.app/docs/reference/math/sizes/#functions-script
|
||||
https://typst.app/docs/reference/math/sizes/#functions-sscript
|
||||
https://typst.app/docs/reference/math/stretch/
|
||||
https://typst.app/docs/reference/math/styles/#functions-bold
|
||||
https://typst.app/docs/reference/math/styles/#functions-italic
|
||||
https://typst.app/docs/reference/math/styles/#functions-upright
|
||||
https://typst.app/docs/reference/math/text/
|
||||
https://typst.app/docs/reference/math/underover/#functions-overbrace
|
||||
https://typst.app/docs/reference/math/underover/#functions-overbracket
|
||||
https://typst.app/docs/reference/math/underover/#functions-overline
|
||||
https://typst.app/docs/reference/math/underover/#functions-overparen
|
||||
https://typst.app/docs/reference/math/underover/#functions-overshell
|
||||
https://typst.app/docs/reference/math/underover/#functions-underbrace
|
||||
https://typst.app/docs/reference/math/underover/#functions-underbracket
|
||||
https://typst.app/docs/reference/math/underover/#functions-underline
|
||||
https://typst.app/docs/reference/math/underover/#functions-underparen
|
||||
https://typst.app/docs/reference/math/underover/#functions-undershell
|
||||
https://typst.app/docs/reference/math/variants/#functions-bb
|
||||
https://typst.app/docs/reference/math/variants/#functions-cal
|
||||
https://typst.app/docs/reference/math/variants/#functions-frak
|
||||
https://typst.app/docs/reference/math/variants/#functions-mono
|
||||
https://typst.app/docs/reference/math/variants/#functions-sans
|
||||
https://typst.app/docs/reference/math/variants/#functions-serif
|
||||
https://typst.app/docs/reference/math/vec/
|
||||
https://typst.app/docs/reference/model/bibliography/
|
||||
https://typst.app/docs/reference/model/cite/
|
||||
https://typst.app/docs/reference/model/document/
|
||||
https://typst.app/docs/reference/model/emph/
|
||||
https://typst.app/docs/reference/model/entry/#definitions-body
|
||||
https://typst.app/docs/reference/model/entry/#definitions-indented
|
||||
https://typst.app/docs/reference/model/entry/#definitions-inner
|
||||
https://typst.app/docs/reference/model/entry/#definitions-page
|
||||
https://typst.app/docs/reference/model/entry/#definitions-prefix
|
||||
https://typst.app/docs/reference/model/enum/
|
||||
https://typst.app/docs/reference/model/enum/#definitions-item
|
||||
https://typst.app/docs/reference/model/figure/
|
||||
https://typst.app/docs/reference/model/figure/#definitions-caption
|
||||
https://typst.app/docs/reference/model/footnote/
|
||||
https://typst.app/docs/reference/model/footnote/#definitions-entry
|
||||
https://typst.app/docs/reference/model/heading/
|
||||
https://typst.app/docs/reference/model/link/
|
||||
https://typst.app/docs/reference/model/list/
|
||||
https://typst.app/docs/reference/model/list/#definitions-item
|
||||
https://typst.app/docs/reference/model/numbering/
|
||||
https://typst.app/docs/reference/model/outline/
|
||||
https://typst.app/docs/reference/model/outline/#definitions-entry
|
||||
https://typst.app/docs/reference/model/par/
|
||||
https://typst.app/docs/reference/model/par/#definitions-line
|
||||
https://typst.app/docs/reference/model/parbreak/
|
||||
https://typst.app/docs/reference/model/quote/
|
||||
https://typst.app/docs/reference/model/ref/
|
||||
https://typst.app/docs/reference/model/strong/
|
||||
https://typst.app/docs/reference/model/table/
|
||||
https://typst.app/docs/reference/model/table/#definitions-cell
|
||||
https://typst.app/docs/reference/model/table/#definitions-footer
|
||||
https://typst.app/docs/reference/model/table/#definitions-header
|
||||
https://typst.app/docs/reference/model/table/#definitions-hline
|
||||
https://typst.app/docs/reference/model/table/#definitions-vline
|
||||
https://typst.app/docs/reference/model/terms/
|
||||
https://typst.app/docs/reference/model/terms/#definitions-item
|
||||
https://typst.app/docs/reference/pdf/embed/
|
||||
https://typst.app/docs/reference/text/highlight/
|
||||
https://typst.app/docs/reference/text/linebreak/
|
||||
https://typst.app/docs/reference/text/lorem/
|
||||
https://typst.app/docs/reference/text/lower/
|
||||
https://typst.app/docs/reference/text/overline/
|
||||
https://typst.app/docs/reference/text/raw/
|
||||
https://typst.app/docs/reference/text/raw/#definitions-line
|
||||
https://typst.app/docs/reference/text/smallcaps/
|
||||
https://typst.app/docs/reference/text/smartquote/
|
||||
https://typst.app/docs/reference/text/strike/
|
||||
https://typst.app/docs/reference/text/sub/
|
||||
https://typst.app/docs/reference/text/super/
|
||||
https://typst.app/docs/reference/text/underline/
|
||||
https://typst.app/docs/reference/text/upper/
|
||||
https://typst.app/docs/reference/visualize/circle/
|
||||
https://typst.app/docs/reference/visualize/color/
|
||||
https://typst.app/docs/reference/visualize/color/#definitions-cmyk
|
||||
https://typst.app/docs/reference/visualize/color/#definitions-components
|
||||
https://typst.app/docs/reference/visualize/color/#definitions-darken
|
||||
https://typst.app/docs/reference/visualize/color/#definitions-desaturate
|
||||
https://typst.app/docs/reference/visualize/color/#definitions-hsl
|
||||
https://typst.app/docs/reference/visualize/color/#definitions-hsv
|
||||
https://typst.app/docs/reference/visualize/color/#definitions-lighten
|
||||
https://typst.app/docs/reference/visualize/color/#definitions-linear-rgb
|
||||
https://typst.app/docs/reference/visualize/color/#definitions-luma
|
||||
https://typst.app/docs/reference/visualize/color/#definitions-mix
|
||||
https://typst.app/docs/reference/visualize/color/#definitions-negate
|
||||
https://typst.app/docs/reference/visualize/color/#definitions-oklab
|
||||
https://typst.app/docs/reference/visualize/color/#definitions-oklch
|
||||
https://typst.app/docs/reference/visualize/color/#definitions-opacify
|
||||
https://typst.app/docs/reference/visualize/color/#definitions-rgb
|
||||
https://typst.app/docs/reference/visualize/color/#definitions-rotate
|
||||
https://typst.app/docs/reference/visualize/color/#definitions-saturate
|
||||
https://typst.app/docs/reference/visualize/color/#definitions-space
|
||||
https://typst.app/docs/reference/visualize/color/#definitions-to-hex
|
||||
https://typst.app/docs/reference/visualize/color/#definitions-transparentize
|
||||
https://typst.app/docs/reference/visualize/curve/
|
||||
https://typst.app/docs/reference/visualize/curve/#definitions-close
|
||||
https://typst.app/docs/reference/visualize/curve/#definitions-cubic
|
||||
https://typst.app/docs/reference/visualize/curve/#definitions-line
|
||||
https://typst.app/docs/reference/visualize/curve/#definitions-move
|
||||
https://typst.app/docs/reference/visualize/curve/#definitions-quad
|
||||
https://typst.app/docs/reference/visualize/ellipse/
|
||||
https://typst.app/docs/reference/visualize/gradient/
|
||||
https://typst.app/docs/reference/visualize/gradient/#definitions-angle
|
||||
https://typst.app/docs/reference/visualize/gradient/#definitions-center
|
||||
https://typst.app/docs/reference/visualize/gradient/#definitions-conic
|
||||
https://typst.app/docs/reference/visualize/gradient/#definitions-focal-center
|
||||
https://typst.app/docs/reference/visualize/gradient/#definitions-focal-radius
|
||||
https://typst.app/docs/reference/visualize/gradient/#definitions-kind
|
||||
https://typst.app/docs/reference/visualize/gradient/#definitions-linear
|
||||
https://typst.app/docs/reference/visualize/gradient/#definitions-radial
|
||||
https://typst.app/docs/reference/visualize/gradient/#definitions-radius
|
||||
https://typst.app/docs/reference/visualize/gradient/#definitions-relative
|
||||
https://typst.app/docs/reference/visualize/gradient/#definitions-repeat
|
||||
https://typst.app/docs/reference/visualize/gradient/#definitions-sample
|
||||
https://typst.app/docs/reference/visualize/gradient/#definitions-samples
|
||||
https://typst.app/docs/reference/visualize/gradient/#definitions-sharp
|
||||
https://typst.app/docs/reference/visualize/gradient/#definitions-space
|
||||
https://typst.app/docs/reference/visualize/gradient/#definitions-stops
|
||||
https://typst.app/docs/reference/visualize/image/
|
||||
https://typst.app/docs/reference/visualize/image/#definitions-decode
|
||||
https://typst.app/docs/reference/visualize/line/
|
||||
https://typst.app/docs/reference/visualize/path/
|
||||
https://typst.app/docs/reference/visualize/pattern/
|
||||
https://typst.app/docs/reference/visualize/polygon/
|
||||
https://typst.app/docs/reference/visualize/polygon/#definitions-regular
|
||||
https://typst.app/docs/reference/visualize/rect/
|
||||
https://typst.app/docs/reference/visualize/square/
|
||||
https://typst.app/docs/reference/visualize/stroke/
|
||||
"###);
|
||||
}
|
||||
}
|
||||
|
|
1
crates/tinymist-query/src/fixtures/hover/cases_doc.typ
Normal file
1
crates/tinymist-query/src/fixtures/hover/cases_doc.typ
Normal file
|
@ -0,0 +1 @@
|
|||
$ /* ident after */ cases $
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
source: crates/tinymist-query/src/hover.rs
|
||||
expression: "JsonRepr::new_redacted(result, &REDACT_LOC)"
|
||||
input_file: crates/tinymist-query/src/fixtures/hover/cases_doc.typ
|
||||
---
|
||||
{
|
||||
"contents": "```typc\nlet cases(\n ..children: content,\n delim: array | none | str | symbol = (\"{\", \"}\"),\n gap: relative = 0% + 0.2em,\n reverse: bool = false,\n);\n```\n\n---\n\nA case distinction.\n\nContent across different branches can be aligned with the `&` symbol.\n\n# Example\n```typ\n$ f(x, y) := cases(\n 1 \"if\" (x dot y)/2 <= 0,\n 2 \"if\" x \"is even\",\n 3 \"if\" x in NN,\n 4 \"else\",\n) $\n```\n\n---\n\nA case distinction.\n\nContent across different branches can be aligned with the `&` symbol.\n\n# Example\n```typ\n$ f(x, y) := cases(\n 1 \"if\" (x dot y)/2 <= 0,\n 2 \"if\" x \"is even\",\n 3 \"if\" x in NN,\n 4 \"else\",\n) $\n```\n\n# Rest Parameters\n\n## children\n\n```typc\ntype: content\n```\n\nThe branches of the case distinction.\n\n# Named Parameters\n\n## delim\n\n```typc\ntype: array | none | str | symbol\n```\n\nThe delimiter to use.\n\nCan be a single character specifying the left delimiter, in which case\nthe right delimiter is inferred. Otherwise, can be an array containing a\nleft and a right delimiter.\n\n```typ\n#set math.cases(delim: \"[\")\n$ x = cases(1, 2) $\n```\n\n## gap (named)\n\n```typc\ntype: relative\n```\n\nThe gap between branches.\n\n```typ\n#set math.cases(gap: 1em)\n$ x = cases(1, 2) $\n```\n\n## reverse (named)\n\n```typc\ntype: bool\n```\n\nWhether the direction of cases should be reversed.\n\n```typ\n#set math.cases(reverse: true)\n$ cases(1, 2) = x $\n```\n\n---\n\n[Open docs](https://typst.app/docs/reference/math/cases/)",
|
||||
"range": "0:20:0:25"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue