Skip to content

Commit 60a9fe9

Browse files
committed
Final (hopefully!) corrections to citation parsing
1 parent 55dea38 commit 60a9fe9

File tree

6 files changed

+32
-9
lines changed

6 files changed

+32
-9
lines changed

src/quarto-core/attribution/document.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ const kISSN = "issn";
5656
const kISBN = "isbn";
5757
const kPMCID = "pmcid";
5858
const kPMID = "pmid";
59-
const kFirstPage = "firstpage";
60-
const kLastPage = "lastpage";
59+
const kFirstPage = "page-first";
60+
const kLastPage = "page-last";
6161
const kPage = "page";
6262
const kNumber = "number";
6363
const kCustom = "custom";
@@ -386,7 +386,12 @@ export function documentCSL(
386386

387387
// Process anything extra
388388
const extras: CSLExtras = {};
389-
if (format.metadata.keywords) {
389+
390+
// Process keywords
391+
const kwString = citationMetadata.keyword;
392+
if (kwString && typeof (kwString) === "string") {
393+
extras.keywords = kwString.split(",");
394+
} else if (format.metadata.keywords) {
390395
const kw = format.metadata.keywords;
391396
extras.keywords = Array.isArray(kw) ? kw : [kw];
392397
}

src/resources/editor/tools/vs-code.mjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9692,7 +9692,7 @@ var require_yaml_intelligence_resources = __commonJS({
96929692
],
96939693
description: {
96949694
short: "The type of listing to create.",
9695-
long: "The type of listing to create. Choose one of:\n\n- `default`: A blog style list of items\n- `table`: A table of items\n- `grid`: A grid of item cards\n- `custom`: A custom template, provided by the `template` key\n"
9695+
long: "The type of listing to create. Choose one of:\n\n- `default`: A blog style list of items\n- `table`: A table of items\n- `grid`: A grid of item cards\n- `custom`: A custom template, provided by the `template` field\n"
96969696
}
96979697
},
96989698
contents: {
@@ -10415,6 +10415,11 @@ var require_yaml_intelligence_resources = __commonJS({
1041510415
description: "Title of the specific part of an item being cited."
1041610416
}
1041710417
},
10418+
"pdf-url": {
10419+
string: {
10420+
description: "A url to the pdf for this item."
10421+
}
10422+
},
1041810423
performer: {
1041910424
ref: "csl-person",
1042010425
description: "Performer of an item (e.g. an actor appearing in a film; a muscian performing a piece of music)."

src/resources/editor/tools/yaml/web-worker.js

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/resources/editor/tools/yaml/yaml-intelligence-resources.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2671,7 +2671,7 @@
26712671
],
26722672
"description": {
26732673
"short": "The type of listing to create.",
2674-
"long": "The type of listing to create. Choose one of:\n\n- `default`: A blog style list of items\n- `table`: A table of items\n- `grid`: A grid of item cards\n- `custom`: A custom template, provided by the `template` key\n"
2674+
"long": "The type of listing to create. Choose one of:\n\n- `default`: A blog style list of items\n- `table`: A table of items\n- `grid`: A grid of item cards\n- `custom`: A custom template, provided by the `template` field\n"
26752675
}
26762676
},
26772677
"contents": {
@@ -3394,6 +3394,11 @@
33943394
"description": "Title of the specific part of an item being cited."
33953395
}
33963396
},
3397+
"pdf-url": {
3398+
"string": {
3399+
"description": "A url to the pdf for this item."
3400+
}
3401+
},
33973402
"performer": {
33983403
"ref": "csl-person",
33993404
"description": "Performer of an item (e.g. an actor appearing in a film; a muscian performing a piece of music)."

src/resources/schema/definitions.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1665,6 +1665,9 @@
16651665
part-title:
16661666
string:
16671667
description: Title of the specific part of an item being cited.
1668+
pdf-url:
1669+
string:
1670+
description: A url to the pdf for this item.
16681671
performer:
16691672
ref: csl-person
16701673
description: Performer of an item (e.g. an actor appearing in a film; a muscian performing a piece of music).

tests/docs/scholar/test.qmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ author:
44
- name: Charles Teague
55
affiliation: Macalester College
66
date: 2020/05/21
7-
keywords: [keyword1, keyword2]
87
abstract: |
98
Just so you know, i am always playing your covers in my restaurant. Its snowing now, everything is calm. Everyone is quiet, drinking their teas and coffees. Fire is burning and the woods are cracking. The river flows below and everyone is looking outside the window. Your covers bring memories to people, it makes them think about life. You sir are not only playing a guitar, you are hitting every single note in our minds. Thank you for your hard work and dedication.
109
google-scholar: true
@@ -18,16 +17,17 @@ citation:
1817
issued: 2021/05/23
1918
volume: 1
2019
number: 7
21-
page-first: 23
22-
page-last: 29
20+
page: 23-29
2321
type: report
2422
doi: 10-12312-123
2523
editor:
2624
- Don Draper
2725
abstract-url: https://www.google.org/abstract
2826
public-url: https://www.quarto.org/public
27+
pdf-url: https://www.quarto.org/public/pdf
2928
fulltext-url: https://www.quarto.org/fulltext
3029
collection-title: foo
30+
keyword: 'foo, bar'
3131

3232
---
3333

0 commit comments

Comments
 (0)