export default function(dom, data) {
dom.querySelector("html").setAttribute("lang", "en")
let head = dom.querySelector("head");
if (!dom.querySelector("meta[charset]")) {
appendHtml(head, ``);
}
if (!dom.querySelector("meta[name=viewport]")) {
appendHtml(head, ``);
}
appendHtml(head, `
${data.title}
`);
appendHtml(head, `
`);
data.authors.forEach((a) => {
appendHtml(head, `
`)
});
appendHtml(head, `
`);
appendHtml(head, `
`);
appendHtml(head, `
`);
data.authors.forEach((a) => {
appendHtml(head, `
`)
});
Object.keys(data.citations).forEach(key => {
console.log(key);
appendHtml(head, `
`);
});
}
function appendHtml(el, html) {
el.innerHTML += html;
}
function citation_meta_content(ref){
var content = `citation_title=${ref.title};`;
ref.author.split(" and ").forEach(author => {
content += `citation_author=${author.trim()};`;
});
if ("journal" in ref){
content += `citation_journal_title=${ref.journal};`;
}
if ("volume" in ref) {
content += `citation_volume=${ref.volume};`;
}
if ("issue" in ref || "number" in ref){
content += `citation_number=${ref.issue || ref.number};`;
}
/*content += `citation_first_page=${};`;
content += `citation_publication_date=${};`;*/
return content;
}