mirror of
https://github.com/typst/typst
synced 2024-10-18 16:12:24 +00: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::model::*;
|
||||
|
||||
use std::collections::HashSet;
|
||||
|
||||
use ecow::{eco_format, EcoString};
|
||||
use once_cell::sync::Lazy;
|
||||
use serde::Deserialize;
|
||||
|
@ -245,6 +247,18 @@ fn category_page(resolver: &dyn Resolver, category: Category) -> PageModel {
|
|||
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.
|
||||
let scope = module.scope();
|
||||
for (name, value, _) in scope.iter() {
|
||||
|
@ -252,16 +266,8 @@ fn category_page(resolver: &dyn Resolver, category: Category) -> PageModel {
|
|||
continue;
|
||||
}
|
||||
|
||||
if category == MATH {
|
||||
// Skip grouped functions.
|
||||
if GROUPS.iter().flat_map(|group| &group.filter).any(|f| f == name) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Already documented in the text category.
|
||||
if name == "text" {
|
||||
continue;
|
||||
}
|
||||
if skip.contains(name.as_str()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
match value {
|
||||
|
|
Loading…
Reference in a new issue