mirror of
https://github.com/wassname/template.git
synced 2026-06-27 22:39:08 +08:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cec3f6ab0b | |||
| 7e510b858e | |||
| 715dbec2a1 | |||
| 953991f3f7 |
Vendored
+26
-24
@@ -283,8 +283,6 @@ function Type$2(tag, options) {
|
||||
|
||||
var type = Type$2;
|
||||
|
||||
/*eslint-disable max-len*/
|
||||
|
||||
var common$4 = common$1;
|
||||
var YAMLException$3 = exception;
|
||||
var Type$1 = type;
|
||||
@@ -896,8 +894,6 @@ function createCommonjsModule(fn, module) {
|
||||
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
||||
}
|
||||
|
||||
/*eslint-disable no-bitwise*/
|
||||
|
||||
var NodeBuffer;
|
||||
|
||||
try {
|
||||
@@ -1355,8 +1351,6 @@ var default_full = Schema$6.DEFAULT = new Schema$6({
|
||||
]
|
||||
});
|
||||
|
||||
/*eslint-disable max-len,no-use-before-define*/
|
||||
|
||||
var common = common$1;
|
||||
var YAMLException$1 = exception;
|
||||
var Mark = mark;
|
||||
@@ -2948,8 +2942,6 @@ var loader$1 = {
|
||||
safeLoad: safeLoad_1
|
||||
};
|
||||
|
||||
/*eslint-disable no-use-before-define*/
|
||||
|
||||
var common$7 = common$1;
|
||||
var YAMLException$5 = exception;
|
||||
var DEFAULT_FULL_SCHEMA$2 = default_full;
|
||||
@@ -6637,29 +6629,39 @@ var generateCrossref = function(data) {
|
||||
return "crossref";
|
||||
};
|
||||
|
||||
function render(dom, data) {
|
||||
data = data || {};
|
||||
function renderImmediately(dom) {
|
||||
html(dom);
|
||||
styles(dom);
|
||||
dom.addEventListener("DOMContentLoaded", function(event) {
|
||||
frontMatter(dom, data);
|
||||
bibliography(dom, data);
|
||||
expandData(dom, data);
|
||||
meta(dom, data);
|
||||
header(dom, data);
|
||||
appendix(dom, data);
|
||||
footer(dom, data);
|
||||
markdown(dom, data);
|
||||
code$1(dom, data);
|
||||
citation(dom, data);
|
||||
}
|
||||
|
||||
function renderOnLoad(dom, data) {
|
||||
frontMatter(dom, data);
|
||||
bibliography(dom, data);
|
||||
expandData(dom, data);
|
||||
meta(dom, data);
|
||||
header(dom, data);
|
||||
appendix(dom, data);
|
||||
footer(dom, data);
|
||||
markdown(dom, data);
|
||||
code$1(dom, data);
|
||||
citation(dom, data);
|
||||
}
|
||||
|
||||
// If we are in a browser, render automatically.
|
||||
if(window && window.document) {
|
||||
var data = data || {};
|
||||
renderImmediately(window.document);
|
||||
window.document.addEventListener("DOMContentLoaded", function (event) {
|
||||
renderOnLoad(window.document, data);
|
||||
console.log("final data:");
|
||||
for (var k in data) {console.log(" ", k, ": ", data[k]);}
|
||||
});
|
||||
}
|
||||
|
||||
// If we are in a browser, run render automatically.
|
||||
if(window && window.document) {
|
||||
render(window.document);
|
||||
// For node
|
||||
function render(dom, data) {
|
||||
renderImmediately(dom);
|
||||
renderOnload(dom, data);
|
||||
}
|
||||
|
||||
exports.render = render;
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -12,29 +12,39 @@ import markdown from "./components/markdown";
|
||||
import code from "./components/code";
|
||||
import generateCrossref from "./components/generate-crossref";
|
||||
|
||||
function render(dom, data) {
|
||||
data = data || {};
|
||||
function renderImmediately(dom) {
|
||||
html(dom);
|
||||
styles(dom);
|
||||
dom.addEventListener("DOMContentLoaded", function(event) {
|
||||
frontMatter(dom, data);
|
||||
bibliography(dom, data);
|
||||
expandData(dom, data);
|
||||
meta(dom, data);
|
||||
header(dom, data);
|
||||
appendix(dom, data);
|
||||
footer(dom, data);
|
||||
markdown(dom, data);
|
||||
code(dom, data);
|
||||
citation(dom, data);
|
||||
console.log("final data:")
|
||||
}
|
||||
|
||||
function renderOnLoad(dom, data) {
|
||||
frontMatter(dom, data);
|
||||
bibliography(dom, data);
|
||||
expandData(dom, data);
|
||||
meta(dom, data);
|
||||
header(dom, data);
|
||||
appendix(dom, data);
|
||||
footer(dom, data);
|
||||
markdown(dom, data);
|
||||
code(dom, data);
|
||||
citation(dom, data);
|
||||
}
|
||||
|
||||
// If we are in a browser, render automatically.
|
||||
if(window && window.document) {
|
||||
let data = data || {};
|
||||
renderImmediately(window.document);
|
||||
window.document.addEventListener("DOMContentLoaded", (event) => {
|
||||
renderOnLoad(window.document, data);
|
||||
console.log("final data:");
|
||||
for (var k in data) {console.log(" ", k, ": ", data[k])}
|
||||
});
|
||||
}
|
||||
|
||||
// If we are in a browser, run render automatically.
|
||||
if(window && window.document) {
|
||||
render(window.document);
|
||||
// For node
|
||||
function render(dom, data) {
|
||||
renderImmediately(dom);
|
||||
renderOnload(dom, data);
|
||||
}
|
||||
|
||||
export {render as render};
|
||||
|
||||
+2
-5
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "distill-template",
|
||||
"version": "0.0.5",
|
||||
"version": "0.0.7",
|
||||
"description": "Template for creating Distill articles.",
|
||||
"main": "dist/distill.js",
|
||||
"main": "dist/template.js",
|
||||
"scripts": {
|
||||
"start": "rollup -c -w",
|
||||
"build": "rollup -c",
|
||||
@@ -34,8 +34,5 @@
|
||||
"rollup-plugin-string": "^2.0.2",
|
||||
"rollup-plugin-uglify": "^1.0.1",
|
||||
"rollup-watch": "^2.5.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"distill-template": "^0.0.4"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user