mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-10 11:10:54 +00:00
just not replacing the var
This commit is contained in:
parent
00d60fb7cf
commit
1365dcc082
@ -37,11 +37,12 @@ export default function generateCitation() {
|
|||||||
try {
|
try {
|
||||||
const apaCite = new Cite(citationCff);
|
const apaCite = new Cite(citationCff);
|
||||||
apaCite["data"] = preferredCitation ? apaCite["data"].slice(1) : apaCite["data"];
|
apaCite["data"] = preferredCitation ? apaCite["data"].slice(1) : apaCite["data"];
|
||||||
return (citationApa = apaCite.format("bibliography", {
|
const citationApa = apaCite.format("bibliography", {
|
||||||
format: "text",
|
format: "text",
|
||||||
template: "apa",
|
template: "apa",
|
||||||
lang: "en-us",
|
lang: "en-us",
|
||||||
}));
|
});
|
||||||
|
return citationApa;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(`Error converting CITATION.cff to APA string: ${error.message}`);
|
console.log(`Error converting CITATION.cff to APA string: ${error.message}`);
|
||||||
return "";
|
return "";
|
||||||
@ -53,11 +54,12 @@ export default function generateCitation() {
|
|||||||
try {
|
try {
|
||||||
const bibtexCite = new Cite(citationCff);
|
const bibtexCite = new Cite(citationCff);
|
||||||
bibtexCite["data"] = preferredCitation ? bibtexCite["data"].slice(1) : bibtexCite["data"];
|
bibtexCite["data"] = preferredCitation ? bibtexCite["data"].slice(1) : bibtexCite["data"];
|
||||||
return (citationBibtex = bibtexCite.format("bibtex", {
|
const citationBibtex = bibtexCite.format("bibtex", {
|
||||||
format: "text",
|
format: "text",
|
||||||
template: "bibtex",
|
template: "bibtex",
|
||||||
lang: "en-us",
|
lang: "en-us",
|
||||||
}));
|
});
|
||||||
|
return citationBibtex;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(`Error converting CITATION.cff to bibtex string: ${error.message}`);
|
console.log(`Error converting CITATION.cff to bibtex string: ${error.message}`);
|
||||||
return null;
|
return null;
|
||||||
@ -70,5 +72,5 @@ export default function generateCitation() {
|
|||||||
bibtex: citationBibtex.replace(/\n/g, " "),
|
bibtex: citationBibtex.replace(/\n/g, " "),
|
||||||
};
|
};
|
||||||
|
|
||||||
return JSON.stringify(citationData);
|
return citationData;
|
||||||
}
|
}
|
||||||
|
@ -41,11 +41,13 @@ const makeConfig = ({
|
|||||||
...outputOptions,
|
...outputOptions,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const citationData = generateCitation();
|
||||||
|
|
||||||
/** @type{import("rollup-plugin-esbuild").Options} */
|
/** @type{import("rollup-plugin-esbuild").Options} */
|
||||||
const esBuildPluginOptions = {
|
const esBuildPluginOptions = {
|
||||||
define: {
|
define: {
|
||||||
__APACITATION__: generateCitation().apa,
|
__APACITATION__: JSON.stringify(citationData.apa),
|
||||||
__BIBTEXCITATION__: generateCitation().bibtex,
|
__BIBTEXCITATION__: JSON.stringify(citationData.bibtex),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2,6 +2,9 @@ import { JsPsych, JsPsychPlugin, ParameterType, TrialType } from "jspsych";
|
|||||||
|
|
||||||
import { version } from "../package.json";
|
import { version } from "../package.json";
|
||||||
|
|
||||||
|
let __APACITATION__ = "";
|
||||||
|
let __BIBTEXCITATION__ = "";
|
||||||
|
|
||||||
const info = <const>{
|
const info = <const>{
|
||||||
name: "html-keyboard-response",
|
name: "html-keyboard-response",
|
||||||
version: version,
|
version: version,
|
||||||
@ -80,7 +83,10 @@ const info = <const>{
|
|||||||
type: ParameterType.STRING,
|
type: ParameterType.STRING,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
citation: [],
|
citation: {
|
||||||
|
apa: __APACITATION__,
|
||||||
|
bibtex: __BIBTEXCITATION__,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
type Info = typeof info;
|
type Info = typeof info;
|
||||||
|
Loading…
Reference in New Issue
Block a user