parent
fb5aecc3c8
commit
3770f6a483
@ -1 +1,2 @@ |
||||
node_modules |
||||
testsite/dist/** |
@ -1,12 +1,21 @@ |
||||
const showdown = require("showdown"); |
||||
const converter = new showdown.Converter(); |
||||
const nunjucks = require("nunjucks"); |
||||
const showdown = require("shohwdown"); |
||||
const fs = require("fs"); |
||||
|
||||
async function main (){ |
||||
nunjucks.configure({ |
||||
autoescape: true |
||||
}); |
||||
//nunjucks.render()
|
||||
try{ fs.mkdirSync('dist'); } |
||||
catch {} |
||||
var articles = fs.readdirSync('articles'); |
||||
for(var i=0;i<articles.length;i++){ |
||||
var article = fs.readFileSync('articles/'+articles[i], {encoding: 'utf-8'}); |
||||
article = converter.makeHtml(article); |
||||
fs.writeFileSync('dist/'+articles[i].substring(0, articles[i].length - 3)+'.html', article, {encoding: 'utf-8'}); |
||||
} |
||||
//var test = fs.readFileSync("./test.md", {encoding: 'utf-8'});
|
||||
} |
||||
|
||||
|
||||
module.exports.main = main; |
@ -0,0 +1,2 @@ |
||||
###### this is my test page |
||||
uwu |
@ -0,0 +1,4 @@ |
||||
## yeet |
||||
**this is** a *test* |
||||
|
||||
[weeeooo](http://google.com) |
After Width: | Height: | Size: 55 KiB |
@ -0,0 +1,3 @@ |
||||
body { |
||||
background: #fffff2; |
||||
} |
Loading…
Reference in new issue