diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-03-14 22:35:31 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-03-14 22:53:54 +0100 |
| commit | 89f44f220de2972452dd816fe59836ba76953d59 (patch) | |
| tree | 2749428e8e10252588bb68c0e8e9bfd150f28a9c /src/eval | |
| parent | 2a86e4db0bb3894d1cc3b94e1a1af31a6cd87b80 (diff) | |
Bibliography and citations
Diffstat (limited to 'src/eval')
| -rw-r--r-- | src/eval/library.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/eval/library.rs b/src/eval/library.rs index d3f7547d..1240d9bb 100644 --- a/src/eval/library.rs +++ b/src/eval/library.rs @@ -2,6 +2,7 @@ use std::fmt::{self, Debug, Formatter}; use std::hash::{Hash, Hasher}; use std::num::NonZeroUsize; +use comemo::Tracked; use ecow::EcoString; use once_cell::sync::OnceCell; @@ -9,8 +10,9 @@ use super::Module; use crate::diag::SourceResult; use crate::doc::Document; use crate::geom::{Abs, Dir}; -use crate::model::{Content, Label, NodeId, StyleChain, StyleMap, Vt}; +use crate::model::{Content, Introspector, Label, NodeId, StyleChain, StyleMap, Vt}; use crate::util::hash128; +use crate::World; /// Definition of Typst's standard library. #[derive(Debug, Clone, Hash)] @@ -61,6 +63,11 @@ pub struct LangItems { pub link: fn(url: EcoString) -> Content, /// A reference: `@target`, `@target[..]`. pub reference: fn(target: Label, supplement: Option<Content>) -> Content, + /// The keys contained in the bibliography and short descriptions of them. + pub bibliography_keys: fn( + world: Tracked<dyn World>, + introspector: Tracked<Introspector>, + ) -> Vec<(EcoString, Option<EcoString>)>, /// A section heading: `= Introduction`. pub heading: fn(level: NonZeroUsize, body: Content) -> Content, /// An item in a bullet list: `- ...`. |
