Compare commits

...

2 Commits

Author SHA1 Message Date
Shan Carter 12d78fed92 0.0.8 2017-01-09 16:42:39 -08:00
Shan Carter 722db5947e bump 2017-01-09 16:42:35 -08:00
6 changed files with 38 additions and 26 deletions
+10 -7
View File
@@ -15,15 +15,18 @@ export default function(dom, data) {
let citations = [];
var citeTags = [].slice.apply(dom.querySelectorAll("dt-cite"));
citeTags.forEach(el => {
let citationKeys = el.getAttribute("key").split(",");
citationKeys.forEach(key => {
if (citations.indexOf(key) == -1){
citations.push(key);
if (! (key in bibliography)){
let key = el.getAttribute("key");
if (key) {
let citationKeys = key.split(",");
citationKeys.forEach(key => {
if (citations.indexOf(key) == -1){
citations.push(key);
if (! (key in bibliography)){
console.warn("No bibliography entry found for: " + key);
}
}
}
});
});
}
});
data.bibliography = bibliography;
data.citations = citations;
+7 -4
View File
@@ -10,10 +10,13 @@ export default function(dom, data) {
var citeTags = [].slice.apply(dom.querySelectorAll("dt-cite"));
console.log(citeTags);
citeTags.forEach(el => {
var keys = el.getAttribute("key").split(",");
console.log(keys)
var cite_string = inline_cite_short(keys);
el.innerHTML = cite_string;
var key = el.getAttribute("key");
if (key) {
var keys = key.split(",");
console.log(keys)
var cite_string = inline_cite_short(keys);
el.innerHTML = cite_string;
}
});
let bibEl = dom.querySelector("dt-bibliography");
+18 -12
View File
@@ -4201,15 +4201,18 @@ var bibliography = function(dom, data) {
var citations = [];
var citeTags = [].slice.apply(dom.querySelectorAll("dt-cite"));
citeTags.forEach(function (el) {
var citationKeys = el.getAttribute("key").split(",");
citationKeys.forEach(function (key) {
if (citations.indexOf(key) == -1){
citations.push(key);
if (! (key in bibliography)){
var key = el.getAttribute("key");
if (key) {
var citationKeys = key.split(",");
citationKeys.forEach(function (key) {
if (citations.indexOf(key) == -1){
citations.push(key);
if (! (key in bibliography)){
console.warn("No bibliography entry found for: " + key);
}
}
}
});
});
}
});
data.bibliography = bibliography;
data.citations = citations;
@@ -4383,10 +4386,13 @@ var citation = function(dom, data) {
var citeTags = [].slice.apply(dom.querySelectorAll("dt-cite"));
console.log(citeTags);
citeTags.forEach(function (el) {
var keys = el.getAttribute("key").split(",");
console.log(keys);
var cite_string = inline_cite_short(keys);
el.innerHTML = cite_string;
var key = el.getAttribute("key");
if (key) {
var keys = key.split(",");
console.log(keys);
var cite_string = inline_cite_short(keys);
el.innerHTML = cite_string;
}
});
var bibEl = dom.querySelector("dt-bibliography");
@@ -6661,7 +6667,7 @@ if(window && window.document) {
// For node
function render(dom, data) {
renderImmediately(dom);
renderOnload(dom, data);
renderOnLoad(dom, data);
}
exports.render = render;
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -44,7 +44,7 @@ if(window && window.document) {
// For node
function render(dom, data) {
renderImmediately(dom);
renderOnload(dom, data);
renderOnLoad(dom, data);
}
export {render as render};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "distill-template",
"version": "0.0.7",
"version": "0.0.8",
"description": "Template for creating Distill articles.",
"main": "dist/template.js",
"scripts": {