diff --git a/components/citation.js b/components/citation.js index ed42c8e..9f5e473 100644 --- a/components/citation.js +++ b/components/citation.js @@ -8,8 +8,10 @@ export default function(dom, data) { } var citeTags = [].slice.apply(dom.querySelectorAll("dt-cite")); + console.log(citeTags) citeTags.forEach(el => { - var keys = el.textContent.split(","); + var keys = el.getAttribute("key").split(","); + console.log(keys) var cite_string = keys.map(inline_cite).join(", "); el.innerHTML = cite_string; }); @@ -26,6 +28,7 @@ export default function(dom, data) { } function inline_cite(key){ + console.log(key, data.citations) if (key in data.citations){ var ent = data.citations[key]; var names = ent.author.split(" and "); diff --git a/examples/tutorial.html b/examples/tutorial.html index dd4aa71..abc150f 100644 --- a/examples/tutorial.html +++ b/examples/tutorial.html @@ -61,7 +61,7 @@ <h2>A description of the article</h2> <dt-byline></dt-byline> <p>This is the first paragraph of the article.</p> - <p>We can also cite <dt-cite article="gregor2015draw"></dt-cite> external publications.</p> + <p>We can also cite <dt-cite key="gregor2015draw"></dt-cite> external publications.</p> </dt-article> <dt-bibliography> @article{gregor2015draw, @@ -137,7 +137,7 @@

Citations are then used in the article body with the <dt-cite> tag. The article attribute is a reference to the id provided in the bibiography.

- <dt-cite article="gregor2015draw"></dt-cite> + <dt-cite ket="gregor2015draw"></dt-cite>