mirror of
https://github.com/typst/typst
synced 2025-06-28 16:22:53 +08:00
Rescue math.binom
docs (#5087)
This commit is contained in:
parent
ae7787c820
commit
698ae870e7
@ -9,6 +9,8 @@ pub use self::contribs::*;
|
|||||||
pub use self::html::*;
|
pub use self::html::*;
|
||||||
pub use self::model::*;
|
pub use self::model::*;
|
||||||
|
|
||||||
|
use std::collections::HashSet;
|
||||||
|
|
||||||
use ecow::{eco_format, EcoString};
|
use ecow::{eco_format, EcoString};
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
@ -245,6 +247,18 @@ fn category_page(resolver: &dyn Resolver, category: Category) -> PageModel {
|
|||||||
shorthands = Some(ShorthandsModel { markup, math });
|
shorthands = Some(ShorthandsModel { markup, math });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let mut skip = HashSet::new();
|
||||||
|
if category == MATH {
|
||||||
|
// Already documented in the text category.
|
||||||
|
skip.insert("text");
|
||||||
|
skip = GROUPS
|
||||||
|
.iter()
|
||||||
|
.filter(|g| g.category == category.name())
|
||||||
|
.flat_map(|g| &g.filter)
|
||||||
|
.map(|s| s.as_str())
|
||||||
|
.collect();
|
||||||
|
}
|
||||||
|
|
||||||
// Add values and types.
|
// Add values and types.
|
||||||
let scope = module.scope();
|
let scope = module.scope();
|
||||||
for (name, value, _) in scope.iter() {
|
for (name, value, _) in scope.iter() {
|
||||||
@ -252,16 +266,8 @@ fn category_page(resolver: &dyn Resolver, category: Category) -> PageModel {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if category == MATH {
|
if skip.contains(name.as_str()) {
|
||||||
// Skip grouped functions.
|
continue;
|
||||||
if GROUPS.iter().flat_map(|group| &group.filter).any(|f| f == name) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Already documented in the text category.
|
|
||||||
if name == "text" {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
match value {
|
match value {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user