Hey guys! currently working on implementing a workflow that uses citation-js and im getting a werid bug when i import Cite from "citation-js";
this is the error any help is appreciated:
Failed to compile with 1 errors 10:59:21 AM
error in ./node_modules/quasar-app-extension-citation-builde
r/node_modules/@citation-js/core/src/plugins/input/parser.js
Module parse failed: Unexpected token (86:17)
You may need an appropriate loader to handle this file type.
|
| export class TypeParser {
> validDataTypes = ['String', 'Array', 'SimpleObject', 'Comp
lexObject', 'Primitive']
|
| /**
@ ./node_modules/quasar-app-extension-citation-builder/node_m
odules/@citation-js/core/src/plugins/input/index.js 8:0-34 15:
48-54
@ ./node_modules/quasar-app-extension-citation-builder/node_m
odules/@citation-js/core/src/plugins/index.js
@ ./node_modules/quasar-app-extension-citation-builder/node_m
odules/@citation-js/core/src/index.js
@ ./node_modules/quasar-app-extension-citation-builder/node_m
odules/citation-js/index.js
@ ./node_modules/quasar-app-extension-citation-builder/src/boot/citation.js
@ ./.quasar/client-entry.js
@ multi (webpack)-dev-server/client?http://0.0.0.0:8080 (webpack)/hot/dev-server.js ./.quasar/client-entry.js
src
with lib-mjs
), so either there's a different error, or the new version didn't install as intended (which can definitely happen with alphas, depending on how you installed it). Could you replace that file with https://unpkg.com/@citation-js/core@0.4.3-alpha.0/lib-mjs/plugins/input/parser.js and check again? There may be another file that's causing trouble too, but we'll cross that bridge when we get there
import { Cite } from '@citation-js/core'
export default {
layout: 'app',
created() {
const data = new Cite('Q30000000')
data.format('bibliography', {
format: 'html',
template: 'apa',
lang: 'en-US'
})
}
}
Hi guys, I'm trying to use citation.js to parse a bibtex file. I seem to lose some data though. For example, when I run the following through
@TechReport{randall_marine_1984,
author = {Randall, R. H. and Siegrist, H. G. and Neill, J. B.},
title = {A marine survey and an environmental evaluation of three coastal regions of {Tinian} for proposed amphibious assault training exercises. {Final} report submitted to {Commander} {U}.{S}. {Naval} {Forces} {Marianas}, {Guam} ({Contract}-{Ng}-1119-84-{M}-2947).},
year = {1984},
groups = {Micronesia},
keywords = {Mendeley references, MICRONESIA, GUAM MORE},
pages = {26 pp.},
timestamp = {2019-02-21 16:06},
}
I get this:
[
{
"label": "randall_marine_1984",
"type": "techreport",
"properties": {
"title": "A marine survey and an environmental evaluation of three coastal regions of Tinian for proposed amphibious assault training exercises. Final report submitted to Commander U.S. Naval Forces Marianas, Guam (Contract-Ng-1119-84-M-2947).",
"author": "Randall, R. H. and Siegrist, H. G. and Neill, J. B.",
"pages": "26 pp.",
"date": "1984",
"year": "1984"
}
}
]
notice, the groups
, keywords
, and timestamp
attributes are missing.
I'm guessing that's because citation.js is meant only to provide citations. Do you know how I could use its parser to give me a json representing all the data in the bib file?
... from low ({\textbackslash}textless 25 g/m2) to high ({\textbackslash}textgreater 60 g/m2)
was worth {\textbackslash}textgreater\$2 million/year... attribute, worth \$15–20
million/year. Divers ... contribute (\$900thousand) towards ...
Cite.plugins.input.chainLink('...')
. However, if you run Cite('...').format('bibtex', { format: 'object' })
the output is limited by the intermediary format, in this case CSL-JSON, which does not have groups
or timestamp
-- although it should support keywords
.