From 6a3164fd335545c0b0504905da653dfd71ab6bd1 Mon Sep 17 00:00:00 2001 From: len0rd Date: Thu, 6 Oct 2022 21:00:19 -0400 Subject: [PATCH] clear out old project generation script --- package-lock.json | 11 ++----- package.json | 5 +--- prestart.js | 34 --------------------- project_writeups/contents.rst | 3 ++ views/pages/projects/project_template.ejs | 36 ----------------------- 5 files changed, 7 insertions(+), 82 deletions(-) delete mode 100644 views/pages/projects/project_template.ejs diff --git a/package-lock.json b/package-lock.json index cb0001d..ab43fc6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,14 +9,11 @@ "version": "0.0.1", "license": "MIT", "dependencies": { - "dynamic-scrollspy": "^0.2.0", "ejs": "^3.1.8", "express": "^4.17.1", "markdown-it": "^13.0.1", "markdown-it-hashtag": "^0.4.0", - "mkdirp": "^1.0.4", - "showdown": "^2.1.0", - "showdown-highlight": "^3.0.0" + "mkdirp": "^1.0.4" } }, "node_modules/accepts": { @@ -936,8 +933,7 @@ "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" }, "dynamic-scrollspy": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/dynamic-scrollspy/-/dynamic-scrollspy-0.2.0.tgz", + "version": "https://registry.npmjs.org/dynamic-scrollspy/-/dynamic-scrollspy-0.2.0.tgz", "integrity": "sha512-MpzvxeGr8AjpbAF52Dfob926pImY7hwEA7HO5lfNsydZyGB5uS2oLGn/1NKoKkkxQ5VcLfua65RgNZYaFqIRgg==" }, "ee-first": { @@ -1332,8 +1328,7 @@ } }, "showdown-highlight": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/showdown-highlight/-/showdown-highlight-3.0.0.tgz", + "version": "https://registry.npmjs.org/showdown-highlight/-/showdown-highlight-3.0.0.tgz", "integrity": "sha512-xrMPNGaECoFMueD3uortV5r69NFY4oZp50QTrHf21T6aYgBO6FBdv5ibBvGd2atd/FeSsPjUhJOipLL6pwELhg==", "requires": { "highlight.js": "^11.5.0", diff --git a/package.json b/package.json index 12c2d87..7587082 100644 --- a/package.json +++ b/package.json @@ -18,13 +18,10 @@ }, "homepage": "https://github.com/len0rd/personal-website", "dependencies": { - "dynamic-scrollspy": "^0.2.0", "ejs": "^3.1.8", "express": "^4.17.1", "markdown-it": "^13.0.1", "markdown-it-hashtag": "^0.4.0", - "mkdirp": "^1.0.4", - "showdown": "^2.1.0", - "showdown-highlight": "^3.0.0" + "mkdirp": "^1.0.4" } } diff --git a/prestart.js b/prestart.js index eee84d4..250b96c 100644 --- a/prestart.js +++ b/prestart.js @@ -9,8 +9,6 @@ const showdown = require('showdown'), showdownHighlight = require("showdown-highlight"), fs = require('fs'), mkdirp = require('mkdirp'), - projectInputDir = './project_writeups/', - projectOutputDir = './views/partials/md/projects/', recipeInputDir = './recipes/', recipeOutputDir = './views/partials/md/recipes/', recipeListGeneratedOutputDir = './views/partials/generated/', @@ -47,37 +45,6 @@ const projectsAddHeaderClass = { filter: text => { return addClassToTag(text, projectClassMap); } }; -// create Showdown converters -const projectsConverter = new showdown.Converter({ - extensions: [projectsAddHeaderClass, showdownHighlight], - tables: true -}); - -function convertMarkdownInDirWithShowdown(inputDir, outputDir, converter) { - // make the directory for the html output if necessary - mkdirp.sync(outputDir); - fs.readdir(inputDir, (err, files) => { - files.forEach(file => { - if (file.endsWith('.md')) { - let fileNameNoExtension = file.slice(0, -3); - console.log('converting: ' + fileNameNoExtension); - fs.readFile(inputDir + file, 'utf8', (err, data) => { - if (err) { - console.error(err); - } else { - let html = converter.makeHtml(data); // where the magic happens - fs.writeFile(outputDir + fileNameNoExtension + '.ejs', html, 'utf8', (err) => { - if (err) { - console.error(err); - } - }); - } - }); - } - }); - }); -} - function convertRecipeMarkdown(inputDir, outputDir) { var md = require('markdown-it')() .use(require('markdown-it-hashtag')); @@ -257,6 +224,5 @@ function generateRecipeNavigatorList(recipeSrcDir, generatedOutputDir) { }); } -convertMarkdownInDirWithShowdown(projectInputDir, projectOutputDir, projectsConverter); convertRecipeMarkdown(recipeInputDir, recipeOutputDir); generateRecipeNavigatorList(recipeInputDir, recipeListGeneratedOutputDir); diff --git a/project_writeups/contents.rst b/project_writeups/contents.rst index 549c674..7f9f734 100644 --- a/project_writeups/contents.rst +++ b/project_writeups/contents.rst @@ -1,6 +1,9 @@ lenordsNet project documentation ================================ +`Home <../../>`_ +---------------- + .. toctree:: :maxdepth: 2 :caption: Contents: diff --git a/views/pages/projects/project_template.ejs b/views/pages/projects/project_template.ejs deleted file mode 100644 index 46137b3..0000000 --- a/views/pages/projects/project_template.ejs +++ /dev/null @@ -1,36 +0,0 @@ -<% var rootPath = '../../'; %> -<% var navExt = '-nav' %> - - - - - <%- include(rootPath + 'partials/include') %> - - - - -
- <%- include(rootPath + 'partials/nav') %> -
- -
-
-
- -
-
- <%- include(rootPath + page) %> -
-
-
- - <%- include(rootPath + 'partials/footer') %> - <%- include(rootPath + 'partials/post_html_include') %> - - - - \ No newline at end of file