import { serializeFrontmatterToBibtex } from '../helpers/bibtex'; const styles = ` `; export function appendixTemplate(frontMatter) { let html = styles; if (typeof frontMatter.githubUrl !== 'undefined') { html += `

Updates and Corrections

`; if (frontMatter.githubCompareUpdatesUrl) { html += `View all changes to this article since it was first published.`; } html += ` If you see mistakes or want to suggest changes, please create an issue on GitHub.

`; } const journal = frontMatter.journal; if (typeof journal !== 'undefined' && journal.title === 'Distill') { html += `

Reuse

Diagrams and text are licensed under Creative Commons Attribution CC-BY 4.0 with the source available on GitHub, unless noted otherwise. The figures that have been reused from other sources don’t fall under this license and can be recognized by a note in their caption: “Figure from …”.

`; } if (typeof frontMatter.publishedDate !== 'undefined') { html += `

Citation

For attribution in academic contexts, please cite this work as

${frontMatter.concatenatedAuthors}, "${frontMatter.title}", Distill, ${frontMatter.publishedYear}.

BibTeX citation

${serializeFrontmatterToBibtex(frontMatter)}
`; } return html; } export class DistillAppendix extends HTMLElement { static get is() { return 'distill-appendix'; } set frontMatter(frontMatter) { this.innerHTML = appendixTemplate(frontMatter); } }