mirror of
https://github.com/typst/typst
synced 2025-08-19 17:38:32 +08:00
Merge dc1c1ebb8fcbe8e26005664bdec1c51beeb56a22 into d1deb80bb8b4d5fad348c23a3e079e4854aa57e4
This commit is contained in:
commit
7ce5486469
6
Cargo.lock
generated
6
Cargo.lock
generated
@ -327,8 +327,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "citationberg"
|
name = "citationberg"
|
||||||
version = "0.5.0"
|
version = "0.5.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://github.com/typst/citationberg.git?rev=67db988c7155f17b2e0aff9aabcd9a00745e4c04#67db988c7155f17b2e0aff9aabcd9a00745e4c04"
|
||||||
checksum = "e4595e03beafb40235070080b5286d3662525efc622cca599585ff1d63f844fa"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"quick-xml 0.36.2",
|
"quick-xml 0.36.2",
|
||||||
"serde",
|
"serde",
|
||||||
@ -946,8 +945,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "hayagriva"
|
name = "hayagriva"
|
||||||
version = "0.8.1"
|
version = "0.8.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://github.com/wkordalski/hayagriva.git?branch=transparent-locator-payload-with-discrimination-ids#63c73bd163b997218fccd2713bdbf211bc7051cb"
|
||||||
checksum = "954907554bb7fcba29a4f917c2d43e289ec21b69d872ccf97db160eca6caeed8"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"biblatex",
|
"biblatex",
|
||||||
"ciborium",
|
"ciborium",
|
||||||
|
@ -162,3 +162,6 @@ manual_range_contains = "allow"
|
|||||||
mutable_key_type = "allow"
|
mutable_key_type = "allow"
|
||||||
uninlined_format_args = "warn"
|
uninlined_format_args = "warn"
|
||||||
wildcard_in_or_patterns = "allow"
|
wildcard_in_or_patterns = "allow"
|
||||||
|
|
||||||
|
[patch.crates-io]
|
||||||
|
hayagriva = { git = "https://github.com/wkordalski/hayagriva.git", branch = "transparent-locator-payload-with-discrimination-ids" }
|
||||||
|
@ -663,6 +663,9 @@ impl<'a> Generator<'a> {
|
|||||||
let database = &self.bibliography.sources.derived;
|
let database = &self.bibliography.sources.derived;
|
||||||
let bibliography_style = &self.bibliography.style(StyleChain::default()).derived;
|
let bibliography_style = &self.bibliography.style(StyleChain::default()).derived;
|
||||||
|
|
||||||
|
let mut supplement_ids = HashMap::new();
|
||||||
|
let mut next_supplement_id: u64 = 0;
|
||||||
|
|
||||||
// Process all citation groups.
|
// Process all citation groups.
|
||||||
let mut driver = BibliographyDriver::new();
|
let mut driver = BibliographyDriver::new();
|
||||||
for elem in &self.groups {
|
for elem in &self.groups {
|
||||||
@ -690,10 +693,16 @@ impl<'a> Generator<'a> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let supplement = child.supplement(StyleChain::default());
|
let supplement = child.supplement(StyleChain::default());
|
||||||
let locator = supplement.as_ref().map(|_| {
|
let locator = supplement.as_ref().map(|c| {
|
||||||
|
let id = *supplement_ids.entry(c.plain_text()).or_insert_with(|| {
|
||||||
|
let id = next_supplement_id;
|
||||||
|
next_supplement_id += 1;
|
||||||
|
id
|
||||||
|
});
|
||||||
|
|
||||||
SpecificLocator(
|
SpecificLocator(
|
||||||
citationberg::taxonomy::Locator::Custom,
|
citationberg::taxonomy::Locator::Custom,
|
||||||
hayagriva::LocatorPayload::Transparent,
|
hayagriva::LocatorPayload::Transparent(id),
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user