react-cheminfo 0.72.0 → 0.74.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -8
- package/lib/citation/core/formats.d.ts.map +1 -1
- package/lib/citation/core/formats.js +65 -17
- package/lib/citation/core/formats.js.map +1 -1
- package/lib/citation/core/index.d.ts +3 -2
- package/lib/citation/core/index.d.ts.map +1 -1
- package/lib/citation/core/index.js +2 -1
- package/lib/citation/core/index.js.map +1 -1
- package/lib/citation/core/openChemistryPaper.d.ts +15 -0
- package/lib/citation/core/openChemistryPaper.d.ts.map +1 -0
- package/lib/citation/core/openChemistryPaper.js +33 -0
- package/lib/citation/core/openChemistryPaper.js.map +1 -0
- package/lib/citation/core/reference.d.ts +36 -3
- package/lib/citation/core/reference.d.ts.map +1 -1
- package/lib/citation/core/reference.js +11 -0
- package/lib/citation/core/reference.js.map +1 -1
- package/lib/citation/core/segments.d.ts +9 -2
- package/lib/citation/core/segments.d.ts.map +1 -1
- package/lib/citation/core/segments.js +74 -7
- package/lib/citation/core/segments.js.map +1 -1
- package/lib/citation/ui/CitationMenu.js +2 -2
- package/lib/citation/ui/CitationMenu.js.map +1 -1
- package/lib/citation/ui/WorkEntry.d.ts.map +1 -1
- package/lib/citation/ui/WorkEntry.js +4 -2
- package/lib/citation/ui/WorkEntry.js.map +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts +1 -1
- package/lib/i18n/core/chromeCatalog.d.ts.map +1 -1
- package/lib/locales/de.json +23 -0
- package/lib/locales/en.json +23 -0
- package/lib/locales/es.json +23 -0
- package/lib/locales/fr.json +23 -0
- package/lib/locales/it.json +23 -0
- package/lib/structure/core/fragmentIdCode.d.ts +15 -0
- package/lib/structure/core/fragmentIdCode.d.ts.map +1 -0
- package/lib/structure/core/fragmentIdCode.js +25 -0
- package/lib/structure/core/fragmentIdCode.js.map +1 -0
- package/lib/structure/core/index.d.ts +2 -0
- package/lib/structure/core/index.d.ts.map +1 -1
- package/lib/structure/core/index.js +1 -0
- package/lib/structure/core/index.js.map +1 -1
- package/lib/structure/core/structureSearch.d.ts +44 -0
- package/lib/structure/core/structureSearch.d.ts.map +1 -0
- package/lib/structure/core/structureSearch.js +31 -0
- package/lib/structure/core/structureSearch.js.map +1 -0
- package/lib/structure/core/substructureMatch.d.ts +33 -0
- package/lib/structure/core/substructureMatch.d.ts.map +1 -0
- package/lib/structure/core/substructureMatch.js +73 -0
- package/lib/structure/core/substructureMatch.js.map +1 -0
- package/lib/structure/ui/Structure.d.ts +18 -0
- package/lib/structure/ui/Structure.d.ts.map +1 -1
- package/lib/structure/ui/Structure.js +2 -2
- package/lib/structure/ui/Structure.js.map +1 -1
- package/lib/structure/ui/StructureSearchDialog.d.ts +55 -0
- package/lib/structure/ui/StructureSearchDialog.d.ts.map +1 -0
- package/lib/structure/ui/StructureSearchDialog.js +77 -0
- package/lib/structure/ui/StructureSearchDialog.js.map +1 -0
- package/lib/structure/ui/StructureSvg.d.ts +9 -0
- package/lib/structure/ui/StructureSvg.d.ts.map +1 -1
- package/lib/structure/ui/StructureSvg.js +7 -2
- package/lib/structure/ui/StructureSvg.js.map +1 -1
- package/lib/structure/ui/index.d.ts +4 -0
- package/lib/structure/ui/index.d.ts.map +1 -1
- package/lib/structure/ui/index.js +2 -0
- package/lib/structure/ui/index.js.map +1 -1
- package/lib/structure/ui/useStructureSearchModes.d.ts +18 -0
- package/lib/structure/ui/useStructureSearchModes.d.ts.map +1 -0
- package/lib/structure/ui/useStructureSearchModes.js +36 -0
- package/lib/structure/ui/useStructureSearchModes.js.map +1 -0
- package/package.json +12 -12
- package/src/citation/core/formats.ts +81 -18
- package/src/citation/core/index.ts +11 -2
- package/src/citation/core/openChemistryPaper.ts +37 -0
- package/src/citation/core/reference.ts +43 -3
- package/src/citation/core/segments.ts +92 -16
- package/src/citation/ui/CitationMenu.tsx +2 -2
- package/src/citation/ui/WorkEntry.tsx +7 -3
- package/src/locales/de.json +23 -0
- package/src/locales/en.json +23 -0
- package/src/locales/es.json +23 -0
- package/src/locales/fr.json +23 -0
- package/src/locales/it.json +23 -0
- package/src/structure/core/fragmentIdCode.ts +25 -0
- package/src/structure/core/index.ts +10 -0
- package/src/structure/core/structureSearch.ts +68 -0
- package/src/structure/core/substructureMatch.ts +85 -0
- package/src/structure/ui/Structure.tsx +24 -0
- package/src/structure/ui/StructureSearchDialog.tsx +218 -0
- package/src/structure/ui/StructureSvg.tsx +35 -0
- package/src/structure/ui/index.ts +4 -0
- package/src/structure/ui/useStructureSearchModes.ts +51 -0
- package/styles/chrome.css +31 -0
package/README.md
CHANGED
|
@@ -114,7 +114,7 @@ through a wildcard subpath exactly as `react-science` serves its own.
|
|
|
114
114
|
| **Site identity** | `siteById`, `findSiteByHost`, `siteTokensCss` | `SiteMark`, `Wordmark`, `SiteTheme`, `SiteTile`, `EcosystemButton`, `EcosystemLinks` |
|
|
115
115
|
| **Chrome** | — | `SiteHeader`, `SiteFooter`, `NavLink`, `NavMenuButton`, `MenuButton`, `AccountButton`, `useCompactHeader` |
|
|
116
116
|
| **Languages** | `LANGUAGES`, `DEFAULT_LANGUAGE`, `LANGUAGE_LABELS`, `isLanguage`, `MessageCatalog`, `CHROME_CATALOG`, `setMessageSession`, `loadCatalogs`, `LANGUAGE_PARAM`, `withLanguageParam` | `useT`, `useChromeT`, `useLanguage`, `LanguageSelect`, `SiteLanguage` |
|
|
117
|
-
| **Citation** | `formatCitation`, `formatCitations`, `citationSegments`, `downloadCitation`, `citedReferences`, `doiUrl`
|
|
117
|
+
| **Citation** | `formatCitation`, `formatCitations`, `citationSegments`, `downloadCitation`, `citedReferences`, `doiUrl`, `referenceVenue` | `CiteButton`, `CitationMenu`, `CitationPreview` |
|
|
118
118
|
| **Contact** | `CONTACT_FORM_URLS`, `contactFormUrl`, `contactUrl` | `ContactButton` |
|
|
119
119
|
| **Share & embed** | `parseShareConfig`, `applyShareConfig`, `buildShareUrl`, `buildEmbedCode`, `isHidden`, `visibleShareParts`, `applySharePreset`, `findSharePreset`, the param codecs, `syncPreferencesWithUrl`, `applyPreferencesFromSearch`, `writePreferencesToSearch`, sealed links: `openSealedAddress`, `sealShareUrl`, `sealQuery`, `unsealQuery` | `ShareDialog`, `ShareButton`, `HiddenPartsProvider`, `PagePart`, `useIsHidden`, `SealedLinkRefused` |
|
|
120
120
|
| **Routing & head** | `createTabRouter`, `readRoute`, `writeRoute`, `subscribeToRoute`, `adoptLegacyHashAddress`, `writeDocumentMeta`, `pageLocation`, `pageHistory` | `useTabRoute` |
|
|
@@ -241,14 +241,15 @@ sections below carry the whole set at once, so one copy pastes both citations an
|
|
|
241
241
|
one saved file holds both records (`references.ris`). Nothing changes for a site
|
|
242
242
|
asking for a single work.
|
|
243
243
|
|
|
244
|
-
The
|
|
245
|
-
|
|
246
|
-
|
|
244
|
+
The works the family shares are held here rather than copied into each site, so
|
|
245
|
+
none of them can name a different version of the same paper — import them from
|
|
246
|
+
`react-cheminfo/core` and put the site's own work first:
|
|
247
247
|
|
|
248
|
-
| Export
|
|
249
|
-
|
|
|
250
|
-
| `PLATFORM_PAPER` / `PLATFORM_WORK`
|
|
251
|
-
| `TEACHING_PAPER` / `TEACHING_WORK`
|
|
248
|
+
| Export | The work |
|
|
249
|
+
| ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
|
250
|
+
| `PLATFORM_PAPER` / `PLATFORM_WORK` | Chemical data processed in the browser, which is what makes these applications rather than queues of jobs. Every site. |
|
|
251
|
+
| `TEACHING_PAPER` / `TEACHING_WORK` | Two decades of online teaching, which is what the tutorials and the exercises are. The sites that teach. |
|
|
252
|
+
| `OPEN_CHEMISTRY_PAPER` / `OPEN_CHEMISTRY_WORK` | Chemistry's data published open and machine actionable. The sites that read research data where it was deposited. |
|
|
252
253
|
|
|
253
254
|
```tsx
|
|
254
255
|
import { PLATFORM_WORK, TEACHING_WORK } from 'react-cheminfo/core';
|
|
@@ -256,6 +257,26 @@ import { PLATFORM_WORK, TEACHING_WORK } from 'react-cheminfo/core';
|
|
|
256
257
|
<CiteButton works={[OWN_WORK, TEACHING_WORK, PLATFORM_WORK]} />;
|
|
257
258
|
```
|
|
258
259
|
|
|
260
|
+
A dataset is cited too. Give the reference `kind: 'dataset'` and a
|
|
261
|
+
`repository` in place of the journal, volume and pages: every style writes it
|
|
262
|
+
the way it writes data, BibTeX as a `@misc` entry and RIS as a `DATA` record,
|
|
263
|
+
and its entry opens the dataset rather than an article.
|
|
264
|
+
|
|
265
|
+
```tsx
|
|
266
|
+
const RECORD: DatasetReference = {
|
|
267
|
+
kind: 'dataset',
|
|
268
|
+
authors: [{ given: 'J.', family: 'Waser' }],
|
|
269
|
+
title: 'Raw data for the article "Accessing CF3-Cyclopropenes"',
|
|
270
|
+
repository: 'Zenodo',
|
|
271
|
+
year: 2026,
|
|
272
|
+
doi: '10.5281/zenodo.18380123',
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
<CiteButton
|
|
276
|
+
works={[{ reference: RECORD, what: 'This dataset' }, OPEN_CHEMISTRY_WORK]}
|
|
277
|
+
/>;
|
|
278
|
+
```
|
|
279
|
+
|
|
259
280
|
### `ContactButton`
|
|
260
281
|
|
|
261
282
|
The Contact entry of a site header. `SiteHeader` draws it after the site's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formats.d.ts","sourceRoot":"","sources":["../../../src/citation/core/formats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"formats.d.ts","sourceRoot":"","sources":["../../../src/citation/core/formats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,SAAS,EAEV,MAAM,gBAAgB,CAAC;AAGxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGrD,kDAAkD;AAClD,MAAM,MAAM,gBAAgB,GAC1B,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,QAAQ,GAAG,KAAK,GAAG,KAAK,CAAC;AAE1D,kCAAkC;AAClC,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,gBAAgB,CAAC;IACrB,0BAA0B;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;EAMiB,CAAC;AAE/C,8EAA8E;AAC9E,eAAO,MAAM,sBAAsB,EAAE,eAAuB,CAAC;AAE7D,0EAA0E;AAC1E,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,gBAAgB,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;EAeiB,CAAC;AAEjD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,MAAM,GAChB,MAAM,CAER;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,gBAAgB,EACxB,KAAK,GAAE,eAAwC,GAC9C,MAAM,CAiBR"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { doiUrl } from "./reference.js";
|
|
2
2
|
import { renderHtml, renderMarkdown, renderText } from "./render.js";
|
|
3
|
-
import { citationSegments, pageRange } from "./segments.js";
|
|
3
|
+
import { citationSegments, nameFamilyFirst, pageRange } from "./segments.js";
|
|
4
4
|
/**
|
|
5
5
|
* Every format offered, in the order the menu lists them. Plain text is not
|
|
6
6
|
* one of them: an HTML copy carries it as its second flavour, so a paste into
|
|
@@ -70,8 +70,18 @@ export function formatCitation(reference, format, style = DEFAULT_CITATION_STYLE
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
function formatBibTeX(reference) {
|
|
73
|
+
const fields = reference.kind === 'dataset'
|
|
74
|
+
? datasetBibTeXFields(reference)
|
|
75
|
+
: articleBibTeXFields(reference);
|
|
76
|
+
const body = fields
|
|
77
|
+
.map(([name, value]) => ` ${name} = {${value}},`)
|
|
78
|
+
.join('\n');
|
|
79
|
+
const type = reference.kind === 'dataset' ? 'misc' : 'article';
|
|
80
|
+
return `@${type}{${bibTeXKey(reference)},\n${body}\n}`;
|
|
81
|
+
}
|
|
82
|
+
function articleBibTeXFields(reference) {
|
|
73
83
|
const { title, journal, year, volume, issue, publisher, doi } = reference;
|
|
74
|
-
|
|
84
|
+
return [
|
|
75
85
|
['author', authorList(reference, ' and ')],
|
|
76
86
|
['title', title],
|
|
77
87
|
['journal', journal],
|
|
@@ -83,20 +93,38 @@ function formatBibTeX(reference) {
|
|
|
83
93
|
['doi', doi],
|
|
84
94
|
['url', doiUrl(reference)],
|
|
85
95
|
];
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* A dataset as the `@misc` entry every BibTeX style knows, its repository
|
|
99
|
+
* standing as the publisher.
|
|
100
|
+
* @param reference - Dataset to write.
|
|
101
|
+
* @returns The fields of the entry.
|
|
102
|
+
*/
|
|
103
|
+
function datasetBibTeXFields(reference) {
|
|
104
|
+
const { title, repository, year, version, doi } = reference;
|
|
105
|
+
return [
|
|
106
|
+
['author', authorList(reference, ' and ')],
|
|
107
|
+
['title', title],
|
|
108
|
+
['howpublished', repository],
|
|
109
|
+
['year', String(year)],
|
|
110
|
+
...(version === undefined ? [] : [['version', version]]),
|
|
111
|
+
['publisher', repository],
|
|
112
|
+
['doi', doi],
|
|
113
|
+
['url', doiUrl(reference)],
|
|
114
|
+
];
|
|
90
115
|
}
|
|
91
116
|
function formatRis(reference) {
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
117
|
+
const lines = reference.kind === 'dataset'
|
|
118
|
+
? datasetRisLines(reference)
|
|
119
|
+
: articleRisLines(reference);
|
|
120
|
+
return lines.map(([tag, value]) => `${tag} - ${value}`).join('\n');
|
|
121
|
+
}
|
|
122
|
+
function articleRisLines(reference) {
|
|
123
|
+
const { authors, title, journal, year, volume, issue } = reference;
|
|
124
|
+
const { firstPage, lastPage, publisher, doi } = reference;
|
|
125
|
+
return [
|
|
95
126
|
['TY', 'JOUR'],
|
|
96
|
-
...authors
|
|
97
|
-
'AU',
|
|
98
|
-
`${author.family}, ${author.given}`,
|
|
99
|
-
]),
|
|
127
|
+
...risAuthors(authors),
|
|
100
128
|
['TI', title],
|
|
101
129
|
['JO', journal],
|
|
102
130
|
['PY', String(year)],
|
|
@@ -109,12 +137,32 @@ function formatRis(reference) {
|
|
|
109
137
|
['UR', doiUrl(reference)],
|
|
110
138
|
['ER', ''],
|
|
111
139
|
];
|
|
112
|
-
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* A dataset as an RIS `DATA` record, its version where reference managers
|
|
143
|
+
* read one, the edition.
|
|
144
|
+
* @param reference - Dataset to write.
|
|
145
|
+
* @returns The lines of the record.
|
|
146
|
+
*/
|
|
147
|
+
function datasetRisLines(reference) {
|
|
148
|
+
const { authors, title, year, version, repository, doi } = reference;
|
|
149
|
+
return [
|
|
150
|
+
['TY', 'DATA'],
|
|
151
|
+
...risAuthors(authors),
|
|
152
|
+
['TI', title],
|
|
153
|
+
['PY', String(year)],
|
|
154
|
+
...(version === undefined ? [] : [['ET', version]]),
|
|
155
|
+
['PB', repository],
|
|
156
|
+
['DO', doi],
|
|
157
|
+
['UR', doiUrl(reference)],
|
|
158
|
+
['ER', ''],
|
|
159
|
+
];
|
|
160
|
+
}
|
|
161
|
+
function risAuthors(authors) {
|
|
162
|
+
return authors.map((author) => ['AU', nameFamilyFirst(author)]);
|
|
113
163
|
}
|
|
114
164
|
function authorList(reference, separator) {
|
|
115
|
-
return reference.authors
|
|
116
|
-
.map((author) => `${author.family}, ${author.given}`)
|
|
117
|
-
.join(separator);
|
|
165
|
+
return reference.authors.map(nameFamilyFirst).join(separator);
|
|
118
166
|
}
|
|
119
167
|
function bibTeXKey(reference) {
|
|
120
168
|
const first = reference.authors[0];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formats.js","sourceRoot":"","sources":["../../../src/citation/core/formats.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"formats.js","sourceRoot":"","sources":["../../../src/citation/core/formats.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAErE,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAoB7E;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,EAAE,IAAI,EAAE;IACtE,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,EAAE;IAC1E,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE;IAC/D,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,EAAE,KAAK,EAAE;IACnE,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE;CAChB,CAAC;AAE/C,8EAA8E;AAC9E,MAAM,CAAC,MAAM,sBAAsB,GAAoB,KAAK,CAAC;AAW7D;;;GAGG;A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,SAAoB,EAAE,SAAiB;IACzD,OAAO,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAChE,CAAC;AAED,SAAS,SAAS,CAAC,SAAoB;IACrC,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACnC,MAAM,MAAM,GAAG,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC;IAChE,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,YAAY,EAAE,EAAE,CAAC,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC;AACnE,CAAC"}
|
|
@@ -3,10 +3,11 @@ export { downloadCitation, downloadCitations } from './download.ts';
|
|
|
3
3
|
export type { CitationDownload, CitationFormat, CitationFormatId, } from './formats.ts';
|
|
4
4
|
export { CITATION_DOWNLOADS, CITATION_FORMATS, DEFAULT_CITATION_STYLE, citationFilename, formatCitation, } from './formats.ts';
|
|
5
5
|
export { GFN2_XTB_PAPER, GFN2_XTB_WORK } from './gfn2Paper.ts';
|
|
6
|
+
export { OPEN_CHEMISTRY_PAPER, OPEN_CHEMISTRY_WORK, } from './openChemistryPaper.ts';
|
|
6
7
|
export { OPENCHEMLIB_PAPER, OPENCHEMLIB_WORK } from './openchemlibPaper.ts';
|
|
7
8
|
export { PLATFORM_PAPER, PLATFORM_WORK } from './platformPaper.ts';
|
|
8
|
-
export type { Reference, ReferenceAuthor } from './reference.ts';
|
|
9
|
-
export { doiUrl } from './reference.ts';
|
|
9
|
+
export type { ArticleReference, DatasetReference, Reference, ReferenceAuthor, } from './reference.ts';
|
|
10
|
+
export { doiUrl, referenceVenue } from './reference.ts';
|
|
10
11
|
export type { CitationSegment, CitationStyle, CitationStyleId, } from './segments.ts';
|
|
11
12
|
export { CITATION_STYLES, citationSegments } from './segments.ts';
|
|
12
13
|
export { TEACHING_PAPER, TEACHING_WORK } from './teachingPaper.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/citation/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACpE,YAAY,EACV,gBAAgB,EAChB,cAAc,EACd,gBAAgB,GACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnE,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/citation/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACpE,YAAY,EACV,gBAAgB,EAChB,cAAc,EACd,gBAAgB,GACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EACL,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnE,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,EACT,eAAe,GAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACxD,YAAY,EACV,eAAe,EACf,aAAa,EACb,eAAe,GAChB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnE,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,eAAe,GAChB,MAAM,YAAY,CAAC"}
|
|
@@ -2,9 +2,10 @@ export { copyCitation, copyCitations } from "./clipboard.js";
|
|
|
2
2
|
export { downloadCitation, downloadCitations } from "./download.js";
|
|
3
3
|
export { CITATION_DOWNLOADS, CITATION_FORMATS, DEFAULT_CITATION_STYLE, citationFilename, formatCitation, } from "./formats.js";
|
|
4
4
|
export { GFN2_XTB_PAPER, GFN2_XTB_WORK } from "./gfn2Paper.js";
|
|
5
|
+
export { OPEN_CHEMISTRY_PAPER, OPEN_CHEMISTRY_WORK, } from "./openChemistryPaper.js";
|
|
5
6
|
export { OPENCHEMLIB_PAPER, OPENCHEMLIB_WORK } from "./openchemlibPaper.js";
|
|
6
7
|
export { PLATFORM_PAPER, PLATFORM_WORK } from "./platformPaper.js";
|
|
7
|
-
export { doiUrl } from "./reference.js";
|
|
8
|
+
export { doiUrl, referenceVenue } from "./reference.js";
|
|
8
9
|
export { CITATION_STYLES, citationSegments } from "./segments.js";
|
|
9
10
|
export { TEACHING_PAPER, TEACHING_WORK } from "./teachingPaper.js";
|
|
10
11
|
export { citationsFilename, citedReferences, formatCitations, } from "./works.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/citation/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAMpE,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/citation/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAMpE,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,GACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EACL,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAOnE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAMxD,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnE,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,eAAe,GAChB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Reference } from './reference.ts';
|
|
2
|
+
import type { CitedWork } from './works.ts';
|
|
3
|
+
/**
|
|
4
|
+
* The case for publishing chemistry's data open and machine actionable, from
|
|
5
|
+
* the electronic lab notebook to the repository: the sites of the family that
|
|
6
|
+
* read research data where it was deposited come out of it. One record holds
|
|
7
|
+
* it, so no site can name a different version of it.
|
|
8
|
+
*/
|
|
9
|
+
export declare const OPEN_CHEMISTRY_PAPER: Reference;
|
|
10
|
+
/**
|
|
11
|
+
* The open-chemistry paper as one of the works a site reading deposited data
|
|
12
|
+
* asks to be cited, after the dataset it shows.
|
|
13
|
+
*/
|
|
14
|
+
export declare const OPEN_CHEMISTRY_WORK: CitedWork;
|
|
15
|
+
//# sourceMappingURL=openChemistryPaper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openChemistryPaper.d.ts","sourceRoot":"","sources":["../../../src/citation/core/openChemistryPaper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAiBlC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAIjC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The case for publishing chemistry's data open and machine actionable, from
|
|
3
|
+
* the electronic lab notebook to the repository: the sites of the family that
|
|
4
|
+
* read research data where it was deposited come out of it. One record holds
|
|
5
|
+
* it, so no site can name a different version of it.
|
|
6
|
+
*/
|
|
7
|
+
export const OPEN_CHEMISTRY_PAPER = {
|
|
8
|
+
authors: [
|
|
9
|
+
{ given: 'K. M.', family: 'Jablonka' },
|
|
10
|
+
{ given: 'L.', family: 'Patiny' },
|
|
11
|
+
{ given: 'B.', family: 'Smit' },
|
|
12
|
+
],
|
|
13
|
+
title: 'Making the collective knowledge of chemistry open and machine actionable',
|
|
14
|
+
journal: 'Nature Chemistry',
|
|
15
|
+
journalAbbreviation: 'Nat. Chem.',
|
|
16
|
+
year: 2022,
|
|
17
|
+
volume: '14',
|
|
18
|
+
issue: '4',
|
|
19
|
+
firstPage: '365',
|
|
20
|
+
lastPage: '376',
|
|
21
|
+
doi: '10.1038/s41557-022-00910-7',
|
|
22
|
+
publisher: 'Springer Science and Business Media LLC',
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* The open-chemistry paper as one of the works a site reading deposited data
|
|
26
|
+
* asks to be cited, after the dataset it shows.
|
|
27
|
+
*/
|
|
28
|
+
export const OPEN_CHEMISTRY_WORK = {
|
|
29
|
+
reference: OPEN_CHEMISTRY_PAPER,
|
|
30
|
+
what: 'Open, machine-actionable chemistry',
|
|
31
|
+
note: 'Cite it for publishing data the way this site reads it.',
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=openChemistryPaper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openChemistryPaper.js","sourceRoot":"","sources":["../../../src/citation/core/openChemistryPaper.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAc;IAC7C,OAAO,EAAE;QACP,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE;QACtC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE;QACjC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE;KAChC;IACD,KAAK,EACH,0EAA0E;IAC5E,OAAO,EAAE,kBAAkB;IAC3B,mBAAmB,EAAE,YAAY;IACjC,IAAI,EAAE,IAAI;IACV,MAAM,EAAE,IAAI;IACZ,KAAK,EAAE,GAAG;IACV,SAAS,EAAE,KAAK;IAChB,QAAQ,EAAE,KAAK;IACf,GAAG,EAAE,4BAA4B;IACjC,SAAS,EAAE,yCAAyC;CACrD,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAc;IAC5C,SAAS,EAAE,oBAAoB;IAC/B,IAAI,EAAE,oCAAoC;IAC1C,IAAI,EAAE,yDAAyD;CAChE,CAAC"}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
/** One author of a reference, as the citation styles need them. */
|
|
2
2
|
export interface ReferenceAuthor {
|
|
3
|
-
/** Initials or first name, e.g. `J. R
|
|
3
|
+
/** Initials or first name, e.g. `J. R.`; empty for an organisation. */
|
|
4
4
|
given: string;
|
|
5
|
-
/** Family name, e.g. `Vanderveen
|
|
5
|
+
/** Family name, e.g. `Vanderveen`, or the organisation's name. */
|
|
6
6
|
family: string;
|
|
7
7
|
}
|
|
8
8
|
/** A journal article, with everything the citation formats need. */
|
|
9
|
-
export interface
|
|
9
|
+
export interface ArticleReference {
|
|
10
|
+
/**
|
|
11
|
+
* What the work is.
|
|
12
|
+
* @default 'article'
|
|
13
|
+
*/
|
|
14
|
+
kind?: 'article';
|
|
10
15
|
authors: readonly ReferenceAuthor[];
|
|
11
16
|
title: string;
|
|
12
17
|
/** Full journal name, e.g. `Green Chemistry`. */
|
|
@@ -21,10 +26,38 @@ export interface Reference {
|
|
|
21
26
|
doi: string;
|
|
22
27
|
publisher: string;
|
|
23
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* A dataset deposited in a repository, with everything the citation formats
|
|
31
|
+
* need: it has no journal, no volume and no pages, and a repository instead.
|
|
32
|
+
*/
|
|
33
|
+
export interface DatasetReference {
|
|
34
|
+
/** What the work is. */
|
|
35
|
+
kind: 'dataset';
|
|
36
|
+
authors: readonly ReferenceAuthor[];
|
|
37
|
+
title: string;
|
|
38
|
+
/** The repository holding it, e.g. `Zenodo`. */
|
|
39
|
+
repository: string;
|
|
40
|
+
year: number;
|
|
41
|
+
/**
|
|
42
|
+
* The version deposited, when the repository records one.
|
|
43
|
+
* @default undefined
|
|
44
|
+
*/
|
|
45
|
+
version?: string;
|
|
46
|
+
doi: string;
|
|
47
|
+
}
|
|
48
|
+
/** A work the citation formats write: a journal article, or a dataset. */
|
|
49
|
+
export type Reference = ArticleReference | DatasetReference;
|
|
24
50
|
/**
|
|
25
51
|
* Resolvable address of a reference.
|
|
26
52
|
* @param reference - Reference to link to.
|
|
27
53
|
* @returns The `https://doi.org/…` URL.
|
|
28
54
|
*/
|
|
29
55
|
export declare function doiUrl(reference: Reference): string;
|
|
56
|
+
/**
|
|
57
|
+
* Where a work was published, as a menu names it beside its year: the
|
|
58
|
+
* abbreviated journal of an article, the repository of a dataset.
|
|
59
|
+
* @param reference - The work.
|
|
60
|
+
* @returns The journal or the repository.
|
|
61
|
+
*/
|
|
62
|
+
export declare function referenceVenue(reference: Reference): string;
|
|
30
63
|
//# sourceMappingURL=reference.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reference.d.ts","sourceRoot":"","sources":["../../../src/citation/core/reference.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,MAAM,WAAW,eAAe;IAC9B,
|
|
1
|
+
{"version":3,"file":"reference.d.ts","sourceRoot":"","sources":["../../../src/citation/core/reference.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,MAAM,WAAW,eAAe;IAC9B,uEAAuE;IACvE,KAAK,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,oEAAoE;AACpE,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,SAAS,eAAe,EAAE,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,OAAO,EAAE,MAAM,CAAC;IAChB,oDAAoD;IACpD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,wBAAwB;IACxB,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,SAAS,eAAe,EAAE,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,0EAA0E;AAC1E,MAAM,MAAM,SAAS,GAAG,gBAAgB,GAAG,gBAAgB,CAAC;AAE5D;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAEnD;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAI3D"}
|
|
@@ -6,4 +6,15 @@
|
|
|
6
6
|
export function doiUrl(reference) {
|
|
7
7
|
return `https://doi.org/${reference.doi}`;
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Where a work was published, as a menu names it beside its year: the
|
|
11
|
+
* abbreviated journal of an article, the repository of a dataset.
|
|
12
|
+
* @param reference - The work.
|
|
13
|
+
* @returns The journal or the repository.
|
|
14
|
+
*/
|
|
15
|
+
export function referenceVenue(reference) {
|
|
16
|
+
return reference.kind === 'dataset'
|
|
17
|
+
? reference.repository
|
|
18
|
+
: reference.journalAbbreviation;
|
|
19
|
+
}
|
|
9
20
|
//# sourceMappingURL=reference.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reference.js","sourceRoot":"","sources":["../../../src/citation/core/reference.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"reference.js","sourceRoot":"","sources":["../../../src/citation/core/reference.ts"],"names":[],"mappings":"AAqDA;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,SAAoB;IACzC,OAAO,mBAAmB,SAAS,CAAC,GAAG,EAAE,CAAC;AAC5C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,SAAoB;IACjD,OAAO,SAAS,CAAC,IAAI,KAAK,SAAS;QACjC,CAAC,CAAC,SAAS,CAAC,UAAU;QACtB,CAAC,CAAC,SAAS,CAAC,mBAAmB,CAAC;AACpC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Reference } from './reference.ts';
|
|
1
|
+
import type { ArticleReference, Reference, ReferenceAuthor } from './reference.ts';
|
|
2
2
|
/** One piece of a written reference, with the emphasis its style asks for. */
|
|
3
3
|
export type CitationSegment = {
|
|
4
4
|
kind: 'text' | 'italic' | 'bold';
|
|
@@ -51,5 +51,12 @@ export declare function citationSegments(reference: Reference, style: CitationSt
|
|
|
51
51
|
* @returns One number for a journal that paginates by article number, the
|
|
52
52
|
* range otherwise.
|
|
53
53
|
*/
|
|
54
|
-
export declare function pageRange(reference:
|
|
54
|
+
export declare function pageRange(reference: ArticleReference, dash?: string): string;
|
|
55
|
+
/**
|
|
56
|
+
* An author with the family name first, `Vanderveen, J. R.`, or the name of an
|
|
57
|
+
* organisation alone.
|
|
58
|
+
* @param author - The author.
|
|
59
|
+
* @returns The name, as a reference list writes it.
|
|
60
|
+
*/
|
|
61
|
+
export declare function nameFamilyFirst(author: ReferenceAuthor): string;
|
|
55
62
|
//# sourceMappingURL=segments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segments.d.ts","sourceRoot":"","sources":["../../../src/citation/core/segments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"segments.d.ts","sourceRoot":"","sources":["../../../src/citation/core/segments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAEhB,SAAS,EACT,eAAe,EAChB,MAAM,gBAAgB,CAAC;AAGxB,8EAA8E;AAC9E,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAClD;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjD,0DAA0D;AAC1D,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,QAAQ,GAAG,KAAK,GAAG,OAAO,CAAC;AAEjE,sCAAsC;AACtC,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,eAAe,CAAC;IACpB,yBAAyB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC;CACd;AAED,6DAA6D;AAC7D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;EAKiB,CAAC;AAE9C;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,eAAe,GACrB,eAAe,EAAE,CAcnB;AA6KD;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,gBAAgB,EAAE,IAAI,SAAM,GAAG,MAAM,CAIzE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CAI/D"}
|
|
@@ -14,6 +14,8 @@ export const CITATION_STYLES = [
|
|
|
14
14
|
* @returns The segments of the citation, in reading order.
|
|
15
15
|
*/
|
|
16
16
|
export function citationSegments(reference, style) {
|
|
17
|
+
if (reference.kind === 'dataset')
|
|
18
|
+
return datasetSegments(reference, style);
|
|
17
19
|
switch (style) {
|
|
18
20
|
case 'acs':
|
|
19
21
|
return acs(reference);
|
|
@@ -27,10 +29,57 @@ export function citationSegments(reference, style) {
|
|
|
27
29
|
throw new Error(`unknown citation style: ${String(style)}`);
|
|
28
30
|
}
|
|
29
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* A dataset as each style writes one: the repository stands where the journal
|
|
34
|
+
* would, and there is neither a volume nor pages. The title is kept by every
|
|
35
|
+
* style, the RSC one included, since it is what tells two datasets of the same
|
|
36
|
+
* authors and year apart.
|
|
37
|
+
* @param reference - Dataset to write.
|
|
38
|
+
* @param style - Style to write it in.
|
|
39
|
+
* @returns The segments of the citation, in reading order.
|
|
40
|
+
*/
|
|
41
|
+
function datasetSegments(reference, style) {
|
|
42
|
+
const { repository, year, version } = reference;
|
|
43
|
+
const title = version === undefined
|
|
44
|
+
? reference.title
|
|
45
|
+
: `${reference.title}, version ${version}`;
|
|
46
|
+
switch (style) {
|
|
47
|
+
case 'acs':
|
|
48
|
+
return [
|
|
49
|
+
text(`${withPeriod(familyFirst(reference, '; '))} ${title}; `),
|
|
50
|
+
italic(repository),
|
|
51
|
+
text(`, ${year}. `),
|
|
52
|
+
doiLink(reference),
|
|
53
|
+
];
|
|
54
|
+
case 'nature':
|
|
55
|
+
return [
|
|
56
|
+
text(`${withPeriod(familyFirstAmpersand(reference))} ${title}. `),
|
|
57
|
+
italic(repository),
|
|
58
|
+
text(` (${year}). `),
|
|
59
|
+
doiLink(reference),
|
|
60
|
+
];
|
|
61
|
+
case 'rsc':
|
|
62
|
+
return [
|
|
63
|
+
text(`${initialsFirst(reference, ' and ')}, ${title}, `),
|
|
64
|
+
italic(repository),
|
|
65
|
+
text(`, ${year}. `),
|
|
66
|
+
doiLink(reference),
|
|
67
|
+
];
|
|
68
|
+
case 'wiley':
|
|
69
|
+
return [
|
|
70
|
+
text(`${initialsFirst(reference, ', ')}, ${title}, `),
|
|
71
|
+
italic(repository),
|
|
72
|
+
text(`, ${year}. `),
|
|
73
|
+
doiLink(reference),
|
|
74
|
+
];
|
|
75
|
+
default:
|
|
76
|
+
throw new Error(`unknown citation style: ${String(style)}`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
30
79
|
function acs(reference) {
|
|
31
80
|
const { title, journalAbbreviation, year, volume } = reference;
|
|
32
81
|
return [
|
|
33
|
-
text(`${familyFirst(reference, '; ')} ${title}. `),
|
|
82
|
+
text(`${withPeriod(familyFirst(reference, '; '))} ${title}. `),
|
|
34
83
|
italic(journalAbbreviation),
|
|
35
84
|
text(' '),
|
|
36
85
|
bold(String(year)),
|
|
@@ -43,7 +92,7 @@ function acs(reference) {
|
|
|
43
92
|
function nature(reference) {
|
|
44
93
|
const { title, journalAbbreviation, year, volume } = reference;
|
|
45
94
|
return [
|
|
46
|
-
text(`${familyFirstAmpersand(reference)} ${title}. `),
|
|
95
|
+
text(`${withPeriod(familyFirstAmpersand(reference))} ${title}. `),
|
|
47
96
|
italic(journalAbbreviation),
|
|
48
97
|
text(' '),
|
|
49
98
|
bold(volume),
|
|
@@ -91,6 +140,15 @@ function doiLink(reference) {
|
|
|
91
140
|
href: doiUrl(reference),
|
|
92
141
|
};
|
|
93
142
|
}
|
|
143
|
+
/**
|
|
144
|
+
* The author list closed by a full stop. A person's name already ends on the
|
|
145
|
+
* one of their last initial; an organisation's name needs its own.
|
|
146
|
+
* @param authors - The author list.
|
|
147
|
+
* @returns It, ending with a full stop.
|
|
148
|
+
*/
|
|
149
|
+
function withPeriod(authors) {
|
|
150
|
+
return authors.endsWith('.') ? authors : `${authors}.`;
|
|
151
|
+
}
|
|
94
152
|
/**
|
|
95
153
|
* `Vanderveen, J. R.; Patiny, L.` — the family name leads.
|
|
96
154
|
* @param reference - The work being written.
|
|
@@ -98,9 +156,7 @@ function doiLink(reference) {
|
|
|
98
156
|
* @returns The authors, as one string.
|
|
99
157
|
*/
|
|
100
158
|
function familyFirst(reference, separator) {
|
|
101
|
-
return reference.authors
|
|
102
|
-
.map((author) => `${author.family}, ${author.given}`)
|
|
103
|
-
.join(separator);
|
|
159
|
+
return reference.authors.map(nameFamilyFirst).join(separator);
|
|
104
160
|
}
|
|
105
161
|
/**
|
|
106
162
|
* The same, with the last author introduced by an ampersand.
|
|
@@ -108,7 +164,7 @@ function familyFirst(reference, separator) {
|
|
|
108
164
|
* @returns The authors, as one string.
|
|
109
165
|
*/
|
|
110
166
|
function familyFirstAmpersand(reference) {
|
|
111
|
-
const names = reference.authors.map(
|
|
167
|
+
const names = reference.authors.map(nameFamilyFirst);
|
|
112
168
|
const last = names.at(-1);
|
|
113
169
|
if (names.length < 2 || last === undefined)
|
|
114
170
|
return names.join(', ');
|
|
@@ -121,7 +177,7 @@ function familyFirstAmpersand(reference) {
|
|
|
121
177
|
* @returns The authors, as one string.
|
|
122
178
|
*/
|
|
123
179
|
function initialsFirst(reference, lastSeparator) {
|
|
124
|
-
const names = reference.authors.map((author) => `${author.given} ${author.family}`);
|
|
180
|
+
const names = reference.authors.map((author) => author.given === '' ? author.family : `${author.given} ${author.family}`);
|
|
125
181
|
const last = names.at(-1);
|
|
126
182
|
if (names.length < 2 || last === undefined)
|
|
127
183
|
return names.join(', ');
|
|
@@ -140,4 +196,15 @@ export function pageRange(reference, dash = '–') {
|
|
|
140
196
|
return firstPage;
|
|
141
197
|
return `${firstPage}${dash}${lastPage}`;
|
|
142
198
|
}
|
|
199
|
+
/**
|
|
200
|
+
* An author with the family name first, `Vanderveen, J. R.`, or the name of an
|
|
201
|
+
* organisation alone.
|
|
202
|
+
* @param author - The author.
|
|
203
|
+
* @returns The name, as a reference list writes it.
|
|
204
|
+
*/
|
|
205
|
+
export function nameFamilyFirst(author) {
|
|
206
|
+
return author.given === ''
|
|
207
|
+
? author.family
|
|
208
|
+
: `${author.family}, ${author.given}`;
|
|
209
|
+
}
|
|
143
210
|
//# sourceMappingURL=segments.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segments.js","sourceRoot":"","sources":["../../../src/citation/core/segments.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"segments.js","sourceRoot":"","sources":["../../../src/citation/core/segments.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAmBxC,6DAA6D;AAC7D,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,kBAAkB,EAAE;IACrD,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,oBAAoB,EAAE;IAC7D,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,yBAAyB,EAAE;IAC5D,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,6BAA6B,EAAE;CACzB,CAAC;AAE9C;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAC9B,SAAoB,EACpB,KAAsB;IAEtB,IAAI,SAAS,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,eAAe,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC3E,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,KAAK;YACR,OAAO,GAAG,CAAC,SAAS,CAAC,CAAC;QACxB,KAAK,QAAQ;YACX,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;QAC3B,KAAK,KAAK;YACR,OAAO,GAAG,CAAC,SAAS,CAAC,CAAC;QACxB,KAAK,OAAO;YACV,OAAO,KAAK,CAAC,SAAS,CAAC,CAAC;QAC1B;YACE,MAAM,IAAI,KAAK,CAAC,2BAA2B,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAChE,CAAC;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,eAAe,CACtB,SAA2B,EAC3B,KAAsB;IAEtB,MAAM,EAAE,UAAU,EAAE,IAAI,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OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,aAAa,GAAG,IAAI,EAAE,CAAC;AACnE,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,SAA2B,EAAE,IAAI,GAAG,GAAG;IAC/D,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAC;IAC1C,IAAI,SAAS,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAC7C,OAAO,GAAG,SAAS,GAAG,IAAI,GAAG,QAAQ,EAAE,CAAC;AAC1C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,MAAuB;IACrD,OAAO,MAAM,CAAC,KAAK,KAAK,EAAE;QACxB,CAAC,CAAC,MAAM,CAAC,MAAM;QACf,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,KAAK,EAAE,CAAC;AAC1C,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { Menu, MenuDivider, MenuItem } from '@blueprintjs/core';
|
|
|
3
3
|
import { SvgLogoDoi } from 'cheminfo-font';
|
|
4
4
|
import { useChromeT } from "../../i18n/ui/useT.js";
|
|
5
5
|
import { CITATION_DOWNLOADS } from "../core/formats.js";
|
|
6
|
-
import { doiUrl } from "../core/reference.js";
|
|
6
|
+
import { doiUrl, referenceVenue } from "../core/reference.js";
|
|
7
7
|
import { citedReferences } from "../core/works.js";
|
|
8
8
|
import { CopyFormatEntries } from "./CopyFormatEntries.js";
|
|
9
9
|
import { WorkEntry } from "./WorkEntry.js";
|
|
@@ -46,7 +46,7 @@ function OneWorkMenu(props) {
|
|
|
46
46
|
const t = useChromeT();
|
|
47
47
|
const feedback = useCopyFeedback();
|
|
48
48
|
const references = [reference];
|
|
49
|
-
return (_jsxs(Menu, { className: "citation-menu", style: MENU_STYLE, children: [_jsx(MenuItem, { icon: _jsx(SvgLogoDoi, { style: DOI_ICON_STYLE }), text: `${reference
|
|
49
|
+
return (_jsxs(Menu, { className: "citation-menu", style: MENU_STYLE, children: [_jsx(MenuItem, { icon: _jsx(SvgLogoDoi, { style: DOI_ICON_STYLE }), text: `${referenceVenue(reference)} ${reference.year}`, label: reference.doi, href: doiUrl(reference), target: "_blank", rel: "noreferrer" }), _jsx(MenuDivider, { title: t('cite.copyReferenceAs') }), _jsx(CopyFormatEntries, { references: references, feedback: feedback }), _jsx(ImportSection, { references: references })] }));
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
52
|
* The menu of a site asking for several works: what each one covers, then the
|