Browse Source

clean up the node scripts a bit

pull/1/head
Ellpeck 1 year ago
parent
commit
f877e10d00
5 changed files with 12 additions and 17 deletions
  1. +1
    -9
      node/blog.js
  2. +0
    -0
      node/lib/showdown-footnotes.js
  3. +0
    -0
      node/lib/showdown-prettify.js
  4. +1
    -8
      node/rss.js
  5. +10
    -0
      node/showdown.js

+ 1
- 9
node/blog.js 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 + "/../";


node/showdown-footnotes.js → node/lib/showdown-footnotes.js View File


node/showdown-prettify.js → node/lib/showdown-prettify.js View File


+ 1
- 8
node/rss.js 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
- 0
node/showdown.js 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"]
});
}

Loading…
Cancel
Save