clean up the node scripts a bit

This commit is contained in:
Ellpeck 2019-10-20 15:56:22 +02:00
parent c10f81a2ea
commit f877e10d00
5 changed files with 12 additions and 17 deletions

View file

@ -2,15 +2,7 @@ const {
JSDOM
} = require("jsdom");
const fs = require("fs");
const showdown = require("showdown");
require("./showdown-prettify");
require("./showdown-footnotes");
const converter = new showdown.Converter({
parseImgDimensions: true,
headerLevelStart: 2,
extensions: ["prettify", "footnotes"]
});
const converter = require("./showdown")(2);
module.exports = function () {
let folder = __dirname + "/../";

View file

@ -2,14 +2,7 @@ const {
Feed
} = require("feed");
const fs = require("fs");
const showdown = require("showdown");
require("./showdown-prettify");
require("./showdown-footnotes");
const converter = new showdown.Converter({
parseImgDimensions: true,
extensions: ["prettify", "footnotes"]
});
const converter = require("./showdown")(1);
module.exports = function () {
let folder = __dirname + "/../";

10
node/showdown.js Normal file
View 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"]
});
}