Get started with citation-js CDN
MIT licensed
Citation-JS is a lightweight library for generating and manipulating bibliographic citations.
Tags:- citation
- bibtex
- wikidata
- contentmine
- quickscrape
- csl
- citeproc
Stable version
Copied!
How to start using citation-js CDN
<!DOCTYPE html>
<html>
<head>
<title>Get started with citation-js CDN - cdnhub.io</title>
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<script src="https://cdn.cdnhub.io/citation-js/0.7.9/citation.min.js"></script>
<script>
// Define a BibTeX string
const bibtexString = `
@article{doi:10.1038/s41591-021-01445-3,
title = {The impact of climate change on global food security},
author = {Smith, J. Doe and Johnson, A. Doe},
journal = {Nature Climate Change},
volume = {12},
number = {8},
pages = {1234--1242},
year = {2022},
doi = {10.1038/s41591-021-01445-3}
}
`;
// Parse the BibTeX string
const citationParser = new window.CitationParser();
const citation = citationParser.parse(bibtexString);
// Print the parsed citation
console.log(citation.toCitation());
// Fetch bibliography data from a remote API using Axios
axios.get('https://api.example.com/bibtex')
.then(response => {
// Parse the BibTeX data and print the citations
const bibtexData = response.data;
const parser = new window.CitationParser();
const citations = parser.parse(bibtexData);
citations.forEach(citation => console.log(citation.toCitation()));
})
.catch(error => console.error(error));
</script>
</head>
<body>
</body>
</html>
Copied!
Copied!
All versions
0.5.0
0.5.0-alpha.10
0.5.0-alpha.3
0.5.0-alpha.4
0.5.0-alpha.5
0.5.0-alpha.6
0.5.0-alpha.7
0.5.0-alpha.8
0.5.0-alpha.9
0.5.1
0.5.2
0.5.3
0.5.4
0.5.5
0.5.6
0.5.7
0.6.0
0.6.1
0.6.2
0.6.3
0.6.4
0.6.5
0.6.6
0.6.7
0.6.8
0.6.9
0.7.0
0.7.1
0.7.10
0.7.11
0.7.12
0.7.13
0.7.14
0.7.15
*** 0.7.16
0.7.2
0.7.3
0.7.4
0.7.5
0.7.6
0.7.7
0.7.8
0.7.9