clean up the node scripts a bit
This commit is contained in:
parent
c10f81a2ea
commit
f877e10d00
5 changed files with 12 additions and 17 deletions
10
node/blog.js
10
node/blog.js
|
@ -2,15 +2,7 @@ const {
|
||||||
JSDOM
|
JSDOM
|
||||||
} = require("jsdom");
|
} = require("jsdom");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
|
const converter = require("./showdown")(2);
|
||||||
const showdown = require("showdown");
|
|
||||||
require("./showdown-prettify");
|
|
||||||
require("./showdown-footnotes");
|
|
||||||
const converter = new showdown.Converter({
|
|
||||||
parseImgDimensions: true,
|
|
||||||
headerLevelStart: 2,
|
|
||||||
extensions: ["prettify", "footnotes"]
|
|
||||||
});
|
|
||||||
|
|
||||||
module.exports = function () {
|
module.exports = function () {
|
||||||
let folder = __dirname + "/../";
|
let folder = __dirname + "/../";
|
||||||
|
|
|
@ -2,14 +2,7 @@ const {
|
||||||
Feed
|
Feed
|
||||||
} = require("feed");
|
} = require("feed");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
|
const converter = require("./showdown")(1);
|
||||||
const showdown = require("showdown");
|
|
||||||
require("./showdown-prettify");
|
|
||||||
require("./showdown-footnotes");
|
|
||||||
const converter = new showdown.Converter({
|
|
||||||
parseImgDimensions: true,
|
|
||||||
extensions: ["prettify", "footnotes"]
|
|
||||||
});
|
|
||||||
|
|
||||||
module.exports = function () {
|
module.exports = function () {
|
||||||
let folder = __dirname + "/../";
|
let folder = __dirname + "/../";
|
||||||
|
|
10
node/showdown.js
Normal file
10
node/showdown.js
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
const showdown = require("showdown");
|
||||||
|
require("./lib/showdown-prettify");
|
||||||
|
require("./lib/showdown-footnotes");
|
||||||
|
module.exports = function (headerLevel) {
|
||||||
|
return new showdown.Converter({
|
||||||
|
parseImgDimensions: true,
|
||||||
|
headerLevelStart: headerLevel,
|
||||||
|
extensions: ["prettify", "footnotes"]
|
||||||
|
});
|
||||||
|
}
|
Loading…
Reference in a new issue