diff options
Diffstat (limited to 'public_md')
-rw-r--r-- | public_md/build.js | 41 | ||||
-rw-r--r-- | public_md/package-lock.json | 103 | ||||
-rw-r--r-- | public_md/package.json | 5 | ||||
-rw-r--r-- | public_md/src/index.md | 4 |
4 files changed, 153 insertions, 0 deletions
diff --git a/public_md/build.js b/public_md/build.js new file mode 100644 index 0000000..542948b --- /dev/null +++ b/public_md/build.js @@ -0,0 +1,41 @@ +var MarkdownIt = require('markdown-it'); +const fs = require("fs"); +const path = require("path"); + +md = new MarkdownIt(); + +const walkSync = (inputdir, outputdir, callback) => { + const files = fs.readdirSync(inputdir); + files.forEach((file) => { + var filepath = path.join(inputdir, file); + const stats = fs.statSync(filepath); + if (stats.isDirectory()) { + walkSync(filepath, outputdir, callback); + } else if (stats.isFile()) { + callback(filepath, outputdir, stats); + } + }); +}; + + +function fileHandler (filepath, outputdir, stats) { + fs.readFile(filepath, function(err, buf) { + let outputpath = filepath.replace(/^.*?\//i, outputdir); + fs.mkdir(path.dirname(outputpath), { recursive: true }, (err) => { + if (err) throw err; + }); + + outputpath = outputpath.replace(/\.md$/i, '.html'); + const html = md.render(buf.toString()); + fs.writeFile(outputpath, html, (err) => { + if (err) console.log(err); + console.log("Successfully Written to: " + outputpath); + }); + }); +} + +fs.rmSync('build/', { recursive: true, force: true }); +walkSync('src/', 'build/', fileHandler); + + + diff --git a/public_md/package-lock.json b/public_md/package-lock.json new file mode 100644 index 0000000..1a1941b --- /dev/null +++ b/public_md/package-lock.json @@ -0,0 +1,103 @@ +{ + "name": "public_md", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "dependencies": { + "markdown-it": "^13.0.1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "node_modules/entities": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-3.0.1.tgz", + "integrity": "sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/linkify-it": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-4.0.1.tgz", + "integrity": "sha512-C7bfi1UZmoj8+PQx22XyeXCuBlokoyWQL5pWSP+EI6nzRylyThouddufc2c1NDIcP9k5agmN9fLpA7VNJfIiqw==", + "dependencies": { + "uc.micro": "^1.0.1" + } + }, + "node_modules/markdown-it": { + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-13.0.1.tgz", + "integrity": "sha512-lTlxriVoy2criHP0JKRhO2VDG9c2ypWCsT237eDiLqi09rmbKoUetyGHq2uOIRoRS//kfoJckS0eUzzkDR+k2Q==", + "dependencies": { + "argparse": "^2.0.1", + "entities": "~3.0.1", + "linkify-it": "^4.0.1", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + }, + "bin": { + "markdown-it": "bin/markdown-it.js" + } + }, + "node_modules/mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==" + }, + "node_modules/uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==" + } + }, + "dependencies": { + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "entities": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-3.0.1.tgz", + "integrity": "sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q==" + }, + "linkify-it": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-4.0.1.tgz", + "integrity": "sha512-C7bfi1UZmoj8+PQx22XyeXCuBlokoyWQL5pWSP+EI6nzRylyThouddufc2c1NDIcP9k5agmN9fLpA7VNJfIiqw==", + "requires": { + "uc.micro": "^1.0.1" + } + }, + "markdown-it": { + "version": "13.0.1", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-13.0.1.tgz", + "integrity": "sha512-lTlxriVoy2criHP0JKRhO2VDG9c2ypWCsT237eDiLqi09rmbKoUetyGHq2uOIRoRS//kfoJckS0eUzzkDR+k2Q==", + "requires": { + "argparse": "^2.0.1", + "entities": "~3.0.1", + "linkify-it": "^4.0.1", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + } + }, + "mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==" + }, + "uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==" + } + } +} diff --git a/public_md/package.json b/public_md/package.json new file mode 100644 index 0000000..d60e2e9 --- /dev/null +++ b/public_md/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "markdown-it": "^13.0.1" + } +} diff --git a/public_md/src/index.md b/public_md/src/index.md new file mode 100644 index 0000000..9a142c7 --- /dev/null +++ b/public_md/src/index.md @@ -0,0 +1,4 @@ +# Notes on Tilde + +* [IRC](https://wiki.tilde.institute/w/irc) +* [WIKI](https://wiki.tilde.institute/) |