frontend: print the 参考文献 block as entries, not quotes
The card listed the quoted passage where the bibliography entry belongs, under
a `引用 #53` tag that named a database id rather than the work. It now prints
the server's `references` verbatim — one line per work, already formatted in
Springer's basic style — with the fields a complete entry still lacks shown as
「缺 责任者、出版年」, and the paragraphs that cite it underneath:
1 引言 / Introduction
2.1 技术主题识别 / Technology Topic Identification ×2
Each of those links carries the quoted passages for that paragraph in its
tooltip, which is where the quote belongs: it is evidence for a citation, not
the citation itself. The client formats nothing and groups nothing but the
paragraph labels — a second implementation of "which work is number 7" would
eventually disagree with the first.
The marker tooltip in the text stops saying `引用 #53` too and shows the entry
it points at, so hovering a `[7]` answers the question the number raises.
This commit is contained in:
@@ -32,6 +32,8 @@ const props = defineProps<{
|
||||
paragraph: PaperParagraph
|
||||
/** Citation id -> the number shown in the text, assigned by reading order. */
|
||||
citationIndex: Record<number, number>
|
||||
/** Reference id -> its formatted entry, so a marker can say what it points at. */
|
||||
referenceText: Record<number, string>
|
||||
}>()
|
||||
|
||||
defineEmits<{ edit: [paragraph: PaperParagraph] }>()
|
||||
@@ -106,12 +108,19 @@ const anchor = computed(() => `paragraph-${props.paragraph.paper_template_filed_
|
||||
>
|
||||
<template #content>
|
||||
<div class="cite-tip">
|
||||
<div class="cite-tip-head">
|
||||
[{{ citationIndex[citation.id] ?? '?' }}]
|
||||
<span v-if="citation.reference_id">引用 #{{ citation.reference_id }}</span>
|
||||
<span v-else class="cite-tip-unlinked">未关联引用 id</span>
|
||||
<div class="cite-tip-head">[{{ citationIndex[citation.id] ?? '?' }}]</div>
|
||||
<!-- What the number means: the entry as the bibliography prints
|
||||
it, not its database id. -->
|
||||
<div
|
||||
v-if="citation.reference_id != null && referenceText[citation.reference_id]"
|
||||
class="cite-tip-entry"
|
||||
>
|
||||
{{ referenceText[citation.reference_id] }}
|
||||
</div>
|
||||
<div class="cite-tip-quote">{{ citation.quote }}</div>
|
||||
<div v-else class="cite-tip-unlinked">
|
||||
这处引用还没有关联文献库条目
|
||||
</div>
|
||||
<div class="cite-tip-quote">「{{ citation.quote }}」</div>
|
||||
</div>
|
||||
</template>
|
||||
<sup class="cite-mark">{{ citationIndex[citation.id] ?? '?' }}</sup>
|
||||
@@ -222,7 +231,7 @@ const anchor = computed(() => `paragraph-${props.paragraph.paper_template_filed_
|
||||
}
|
||||
|
||||
.cite-tip {
|
||||
max-width: 320px;
|
||||
max-width: 380px;
|
||||
}
|
||||
|
||||
.cite-tip-head {
|
||||
@@ -232,7 +241,15 @@ const anchor = computed(() => `paragraph-${props.paragraph.paper_template_filed_
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* The bibliography entry: the whole point of the tooltip. It is set as a
|
||||
paragraph of running text because that is how it prints in the list. */
|
||||
.cite-tip-entry {
|
||||
margin-top: 4px;
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
.cite-tip-unlinked {
|
||||
margin-top: 4px;
|
||||
font-weight: 400;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user