Compare commits

..

4 Commits

Author SHA1 Message Date
mkorje
5bee8ff434
Add test 2025-07-03 20:36:13 +10:00
mkorje
5e678d6d24
Update docs 2025-07-03 20:30:57 +10:00
mkorje
27413c4f21
Add math.scr 2025-07-03 20:30:55 +10:00
mkorje
fa0174f3cf
Move math styling to codex 2025-07-03 20:30:52 +10:00
7 changed files with 9 additions and 21 deletions

View File

@ -199,7 +199,7 @@ impl PackageStorage {
// The place at which the specific package version will live in the end.
let package_dir = base_dir.join(format!("{}", spec.version));
// To prevent multiple Typst instances from interfering, we download
// To prevent multiple Typst instances from interferring, we download
// into a temporary directory first and then move this directory to
// its final destination.
//

View File

@ -94,7 +94,7 @@ impl Array {
}
/// Iterate over references to the contained values.
pub fn iter(&self) -> std::slice::Iter<'_, Value> {
pub fn iter(&self) -> std::slice::Iter<Value> {
self.0.iter()
}

View File

@ -114,7 +114,7 @@ impl Dict {
}
/// Iterate over pairs of references to the contained keys and values.
pub fn iter(&self) -> indexmap::map::Iter<'_, Str, Value> {
pub fn iter(&self) -> indexmap::map::Iter<Str, Value> {
self.0.iter()
}

View File

@ -497,8 +497,7 @@ mod callbacks {
macro_rules! callback {
($name:ident = ($($param:ident: $param_ty:ty),* $(,)?) -> $ret:ty) => {
#[derive(Debug, Clone, Hash)]
#[allow(clippy::derived_hash_with_manual_eq)]
#[derive(Debug, Clone, PartialEq, Hash)]
pub struct $name {
captured: Content,
f: fn(&Content, $($param_ty),*) -> $ret,
@ -536,19 +535,6 @@ mod callbacks {
(self.f)(&self.captured, $($param),*)
}
}
impl PartialEq for $name {
fn eq(&self, other: &Self) -> bool {
// Comparing function pointers is problematic. Since for
// each type of content, there is typically just one
// callback, we skip it. It barely matters anyway since
// getting into a comparison codepath for inline & block
// elements containing callback bodies is close to
// impossible (as these are generally generated in show
// rules).
self.captured.eq(&other.captured)
}
}
};
}

View File

@ -47,12 +47,12 @@ impl Fragment {
}
/// Iterate over the contained frames.
pub fn iter(&self) -> std::slice::Iter<'_, Frame> {
pub fn iter(&self) -> std::slice::Iter<Frame> {
self.0.iter()
}
/// Iterate over the contained frames.
pub fn iter_mut(&mut self) -> std::slice::IterMut<'_, Frame> {
pub fn iter_mut(&mut self) -> std::slice::IterMut<Frame> {
self.0.iter_mut()
}
}

View File

@ -936,7 +936,7 @@ cast! {
}
/// Resolve a prioritized iterator over the font families.
pub fn families(styles: StyleChain<'_>) -> impl Iterator<Item = &'_ FontFamily> + Clone {
pub fn families(styles: StyleChain) -> impl Iterator<Item = &FontFamily> + Clone {
let fallbacks = singleton!(Vec<FontFamily>, {
[
"libertinus serif",

View File

@ -22,6 +22,8 @@ pub(crate) fn build_metadata(gc: &GlobalContext) -> Metadata {
.keywords(gc.document.info.keywords.iter().map(EcoString::to_string).collect())
.authors(gc.document.info.author.iter().map(EcoString::to_string).collect());
let lang = gc.languages.iter().max_by_key(|(_, &count)| count).map(|(&l, _)| l);
if let Some(lang) = lang {
metadata = metadata.language(lang.as_str().to_string());
}