mirror of
https://github.com/wassname/template.git
synced 2026-07-03 07:28:34 +08:00
18 lines
532 B
JavaScript
18 lines
532 B
JavaScript
import { appendixTemplate } from '../distill-components/distill-appendix';
|
|
|
|
export default function(dom, data) {
|
|
|
|
const appendixTag = dom.querySelector('d-appendix');
|
|
if (!appendixTag) {
|
|
console.warn('No appendix tag found!');
|
|
return;
|
|
}
|
|
const distillAppendixTag = appendixTag.querySelector('distill-appendix');
|
|
if (!distillAppendixTag) {
|
|
const distillAppendix = dom.createElement('distill-appendix');
|
|
appendixTag.appendChild(distillAppendix);
|
|
distillAppendix.innerHTML = appendixTemplate(data);
|
|
}
|
|
|
|
}
|