From 09d1f580d986ed3d233f814637ef2068a4c52130 Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Sun, 9 Sep 2018 20:33:10 -0400 Subject: [PATCH] feat: rendering pipeline logic --- client/components/common/nav-header.vue | 2 +- server/graph/resolvers/localization.js | 2 +- server/jobs/render-page.js | 20 ++++- server/models/pages.js | 11 ++- server/models/renderers.js | 73 ++++++++++++++++--- .../renderer/html-security/definition.yml | 8 -- .../renderer/markdown-core/definition.yml | 31 -------- .../renderer/markdown-mermaid/renderer.js | 1 - .../renderer/markdown-plantuml/renderer.js | 1 - .../html-asciinema/definition.yml | 0 .../html-asciinema/renderer.js | 0 .../html-blockquotes/definition.yml | 0 .../html-blockquotes/renderer.js | 0 .../html-core/definition.yml | 0 .../modules/rendering/html-core/renderer.js | 5 ++ .../html-mathjax/definition.yml | 0 .../html-mathjax/mathjax.js | 0 .../html-mediaplayers/definition.yml | 0 .../html-mediaplayers}/renderer.js | 0 .../rendering/html-security/definition.yml | 18 +++++ .../html-security}/renderer.js | 0 .../markdown-abbr/definition.yml | 0 .../markdown-abbr/renderer.js | 4 - .../rendering/markdown-core/definition.yml | 51 +++++++++++++ .../rendering/markdown-core/renderer.js | 42 +++++++++++ .../markdown-emoji/definition.yml | 0 .../markdown-emoji/renderer.js | 4 - .../markdown-expandtabs/definition.yml | 7 +- .../markdown-expandtabs/renderer.js | 4 - .../markdown-footnotes/definition.yml | 0 .../markdown-footnotes/renderer.js | 4 - .../markdown-mathjax/definition.yml | 0 .../markdown-mathjax/renderer.js | 4 - .../markdown-mermaid/definition.yml | 0 .../markdown-mermaid}/renderer.js | 0 .../markdown-plantuml/definition.yml | 0 .../markdown-plantuml}/renderer.js | 0 .../markdown-tasklists/definition.yml | 0 .../markdown-tasklists/renderer.js | 4 - 39 files changed, 210 insertions(+), 86 deletions(-) delete mode 100644 server/modules/renderer/html-security/definition.yml delete mode 100644 server/modules/renderer/markdown-core/definition.yml delete mode 100644 server/modules/renderer/markdown-mermaid/renderer.js delete mode 100644 server/modules/renderer/markdown-plantuml/renderer.js rename server/modules/{renderer => rendering}/html-asciinema/definition.yml (100%) rename server/modules/{renderer => rendering}/html-asciinema/renderer.js (100%) rename server/modules/{renderer => rendering}/html-blockquotes/definition.yml (100%) rename server/modules/{renderer => rendering}/html-blockquotes/renderer.js (100%) rename server/modules/{renderer => rendering}/html-core/definition.yml (100%) create mode 100644 server/modules/rendering/html-core/renderer.js rename server/modules/{renderer => rendering}/html-mathjax/definition.yml (100%) rename server/modules/{renderer => rendering}/html-mathjax/mathjax.js (100%) rename server/modules/{renderer => rendering}/html-mediaplayers/definition.yml (100%) rename server/modules/{renderer/html-core => rendering/html-mediaplayers}/renderer.js (100%) create mode 100644 server/modules/rendering/html-security/definition.yml rename server/modules/{renderer/html-mediaplayers => rendering/html-security}/renderer.js (100%) rename server/modules/{renderer => rendering}/markdown-abbr/definition.yml (100%) rename server/modules/{renderer => rendering}/markdown-abbr/renderer.js (70%) create mode 100644 server/modules/rendering/markdown-core/definition.yml create mode 100644 server/modules/rendering/markdown-core/renderer.js rename server/modules/{renderer => rendering}/markdown-emoji/definition.yml (100%) rename server/modules/{renderer => rendering}/markdown-emoji/renderer.js (74%) rename server/modules/{renderer => rendering}/markdown-expandtabs/definition.yml (61%) rename server/modules/{renderer => rendering}/markdown-expandtabs/renderer.js (77%) rename server/modules/{renderer => rendering}/markdown-footnotes/definition.yml (100%) rename server/modules/{renderer => rendering}/markdown-footnotes/renderer.js (73%) rename server/modules/{renderer => rendering}/markdown-mathjax/definition.yml (100%) rename server/modules/{renderer => rendering}/markdown-mathjax/renderer.js (72%) rename server/modules/{renderer => rendering}/markdown-mermaid/definition.yml (100%) rename server/modules/{renderer/html-security => rendering/markdown-mermaid}/renderer.js (100%) rename server/modules/{renderer => rendering}/markdown-plantuml/definition.yml (100%) rename server/modules/{renderer/markdown-core => rendering/markdown-plantuml}/renderer.js (100%) rename server/modules/{renderer => rendering}/markdown-tasklists/definition.yml (100%) rename server/modules/{renderer => rendering}/markdown-tasklists/renderer.js (73%) diff --git a/client/components/common/nav-header.vue b/client/components/common/nav-header.vue index 6df04139..9801a64e 100644 --- a/client/components/common/nav-header.vue +++ b/client/components/common/nav-header.vue @@ -92,7 +92,7 @@ v-btn(icon, slot='activator') v-icon(color='grey') account_circle span Account - v-list.py-0 + v-list.py-0(:light='!$vuetify.dark') v-list-tile.py-3(avatar) v-list-tile-avatar v-avatar.red(:size='40'): span.white--text.subheading JD diff --git a/server/graph/resolvers/localization.js b/server/graph/resolvers/localization.js index d434cca8..79f90313 100644 --- a/server/graph/resolvers/localization.js +++ b/server/graph/resolvers/localization.js @@ -13,7 +13,7 @@ module.exports = { LocalizationQuery: { async locales(obj, args, context, info) { let remoteLocales = await WIKI.redis.get('locales') - let localLocales = await WIKI.models.locales.query().select('id', 'code', 'isRTL', 'name', 'nativeName', 'createdAt', 'updatedAt') + let localLocales = await WIKI.models.locales.query().select('code', 'isRTL', 'name', 'nativeName', 'createdAt', 'updatedAt') remoteLocales = (remoteLocales) ? JSON.parse(remoteLocales) : localLocales return _.map(remoteLocales, rl => { let isInstalled = _.some(localLocales, ['code', rl.code]) diff --git a/server/jobs/render-page.js b/server/jobs/render-page.js index a8df0cd2..d8252ec2 100644 --- a/server/jobs/render-page.js +++ b/server/jobs/render-page.js @@ -1,16 +1,30 @@ require('../core/worker') +const _ = require('lodash') + /* global WIKI */ WIKI.models = require('../core/db').init() module.exports = async (job) => { - WIKI.logger.info(`Rendering page ${job.data.path}...`) + WIKI.logger.info(`Rendering page ${job.data.page.path}...`) try { - WIKI.logger.info(`Rendering page ${job.data.path}: [ COMPLETED ]`) + let output = job.data.page.content + for (let core of job.data.pipeline) { + const renderer = require(`../modules/rendering/${_.kebabCase(core.key)}/renderer.js`) + output = await renderer.render.call({ + config: core.config, + children: core.children, + page: job.data.page, + input: output + }) + } + console.info(output) + + WIKI.logger.info(`Rendering page ${job.data.page.path}: [ COMPLETED ]`) } catch (err) { - WIKI.logger.error(`Rendering page ${job.data.path}: [ FAILED ]`) + WIKI.logger.error(`Rendering page ${job.data.page.path}: [ FAILED ]`) WIKI.logger.error(err.message) } } diff --git a/server/models/pages.js b/server/models/pages.js index 6f2de09a..fdbe3309 100644 --- a/server/models/pages.js +++ b/server/models/pages.js @@ -111,7 +111,6 @@ module.exports = class Page extends Model { } static async createPage(opts) { - await WIKI.models.pages.renderPage(opts) const page = await WIKI.models.pages.query().insertAndFetch({ authorId: opts.authorId, content: opts.content, @@ -127,6 +126,7 @@ module.exports = class Page extends Model { publishStartDate: opts.publishStartDate, title: opts.title }) + await WIKI.models.pages.renderPage(page) await WIKI.models.storage.pageEvent({ event: 'created', page @@ -149,6 +149,7 @@ module.exports = class Page extends Model { publishStartDate: opts.publishStartDate, title: opts.title }) + await WIKI.models.pages.renderPage(page) await WIKI.models.storage.pageEvent({ event: 'updated', page @@ -156,8 +157,12 @@ module.exports = class Page extends Model { return page } - static async renderPage(opts) { - WIKI.queue.job.renderPage.add(opts, { + static async renderPage(page) { + const pipeline = await WIKI.models.renderers.getRenderingPipeline(page.contentType) + WIKI.queue.job.renderPage.add({ + page, + pipeline + }, { removeOnComplete: true, removeOnFail: true }) diff --git a/server/models/renderers.js b/server/models/renderers.js index 6111d25a..2d26e31b 100644 --- a/server/models/renderers.js +++ b/server/models/renderers.js @@ -3,6 +3,7 @@ const path = require('path') const fs = require('fs-extra') const _ = require('lodash') const yaml = require('js-yaml') +const DepGraph = require('dependency-graph').DepGraph const commonHelper = require('../helpers/common') /* global WIKI */ @@ -37,10 +38,10 @@ module.exports = class Renderer extends Model { const dbRenderers = await WIKI.models.renderers.query() // -> Fetch definitions from disk - const rendererDirs = await fs.readdir(path.join(WIKI.SERVERPATH, 'modules/renderer')) + const rendererDirs = await fs.readdir(path.join(WIKI.SERVERPATH, 'modules/rendering')) let diskRenderers = [] for (let dir of rendererDirs) { - const def = await fs.readFile(path.join(WIKI.SERVERPATH, 'modules/renderer', dir, 'definition.yml'), 'utf8') + const def = await fs.readFile(path.join(WIKI.SERVERPATH, 'modules/rendering', dir, 'definition.yml'), 'utf8') diskRenderers.push(yaml.safeLoad(def)) } WIKI.data.renderers = diskRenderers.map(renderer => ({ @@ -91,18 +92,66 @@ module.exports = class Renderer extends Model { } } - static async pageEvent({ event, page }) { - const targets = await WIKI.models.storage.query().where('isEnabled', true) - if (targets && targets.length > 0) { - _.forEach(targets, target => { - WIKI.queue.job.syncStorage.add({ - event, - target, - page - }, { - removeOnComplete: true + static async getRenderingPipeline(contentType) { + const renderersDb = await WIKI.models.renderers.query().where('isEnabled', true) + if (renderersDb && renderersDb.length > 0) { + const renderers = renderersDb.map(rdr => { + const renderer = _.find(WIKI.data.renderers, ['key', rdr.key]) + return { + ...renderer, + config: rdr.config + } + }) + + // Build tree + const rawCores = _.filter(renderers, renderer => !_.has(renderer, 'dependsOn')).map(core => { + core.children = _.concat([_.cloneDeep(core)], _.filter(renderers, ['dependsOn', core.key])) + return core + }) + + // Build dependency graph + const graph = new DepGraph({ circular: true }) + rawCores.map(core => { graph.addNode(core.key) }) + rawCores.map(core => { + rawCores.map(coreTarget => { + if (core.key !== coreTarget.key) { + if (core.output === coreTarget.input) { + graph.addDependency(core.key, coreTarget.key) + } + } }) }) + + // Filter unused cores + let activeCoreKeys = _.filter(rawCores, ['input', contentType]).map(core => core.key) + _.clone(activeCoreKeys).map(coreKey => { + activeCoreKeys = _.union(activeCoreKeys, graph.dependenciesOf(coreKey)) + }) + const activeCores = _.filter(rawCores, core => _.includes(activeCoreKeys, core.key)) + + // Rebuild dependency graph with active cores + const graphActive = new DepGraph({ circular: true }) + activeCores.map(core => { graphActive.addNode(core.key) }) + activeCores.map(core => { + activeCores.map(coreTarget => { + if (core.key !== coreTarget.key) { + if (core.output === coreTarget.input) { + graphActive.addDependency(core.key, coreTarget.key) + } + } + }) + }) + + // Reorder cores in reverse dependency order + let orderedCores = [] + _.reverse(graphActive.overallOrder()).map(coreKey => { + orderedCores.push(_.find(rawCores, ['key', coreKey])) + }) + + return orderedCores + } else { + WIKI.logger.error(`Rendering pipeline is empty!`) + return false } } } diff --git a/server/modules/renderer/html-security/definition.yml b/server/modules/renderer/html-security/definition.yml deleted file mode 100644 index 7171c9c6..00000000 --- a/server/modules/renderer/html-security/definition.yml +++ /dev/null @@ -1,8 +0,0 @@ -key: htmlSecurity -title: Security -description: Filter and strips potentially dangerous content -author: requarks.io -icon: whatshot -enabledDefault: true -dependsOn: htmlCore -props: {} diff --git a/server/modules/renderer/markdown-core/definition.yml b/server/modules/renderer/markdown-core/definition.yml deleted file mode 100644 index 87939d42..00000000 --- a/server/modules/renderer/markdown-core/definition.yml +++ /dev/null @@ -1,31 +0,0 @@ -key: markdownCore -title: Core -description: Basic Markdown Parser -author: requarks.io -input: markdown -output: html -icon: crop_free -props: - linkify: - type: Boolean - default: true - title: Automatically convert links - hint: Links will automatically be converted to clickable links. - linebreaks: - type: Boolean - default: true - title: Automatically convert line breaks - hint: Add linebreaks within paragraphs. - highlightCode: - type: Boolean - default: true - title: Highlight code blocks - hint: Add syntax coloring to code blocks. - codeTheme: - type: String - default: light - title: Code Color Theme - hint: Color theme for code blocks - enum: - - light - - dark diff --git a/server/modules/renderer/markdown-mermaid/renderer.js b/server/modules/renderer/markdown-mermaid/renderer.js deleted file mode 100644 index 4ba52ba2..00000000 --- a/server/modules/renderer/markdown-mermaid/renderer.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = {} diff --git a/server/modules/renderer/markdown-plantuml/renderer.js b/server/modules/renderer/markdown-plantuml/renderer.js deleted file mode 100644 index 4ba52ba2..00000000 --- a/server/modules/renderer/markdown-plantuml/renderer.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = {} diff --git a/server/modules/renderer/html-asciinema/definition.yml b/server/modules/rendering/html-asciinema/definition.yml similarity index 100% rename from server/modules/renderer/html-asciinema/definition.yml rename to server/modules/rendering/html-asciinema/definition.yml diff --git a/server/modules/renderer/html-asciinema/renderer.js b/server/modules/rendering/html-asciinema/renderer.js similarity index 100% rename from server/modules/renderer/html-asciinema/renderer.js rename to server/modules/rendering/html-asciinema/renderer.js diff --git a/server/modules/renderer/html-blockquotes/definition.yml b/server/modules/rendering/html-blockquotes/definition.yml similarity index 100% rename from server/modules/renderer/html-blockquotes/definition.yml rename to server/modules/rendering/html-blockquotes/definition.yml diff --git a/server/modules/renderer/html-blockquotes/renderer.js b/server/modules/rendering/html-blockquotes/renderer.js similarity index 100% rename from server/modules/renderer/html-blockquotes/renderer.js rename to server/modules/rendering/html-blockquotes/renderer.js diff --git a/server/modules/renderer/html-core/definition.yml b/server/modules/rendering/html-core/definition.yml similarity index 100% rename from server/modules/renderer/html-core/definition.yml rename to server/modules/rendering/html-core/definition.yml diff --git a/server/modules/rendering/html-core/renderer.js b/server/modules/rendering/html-core/renderer.js new file mode 100644 index 00000000..cf192427 --- /dev/null +++ b/server/modules/rendering/html-core/renderer.js @@ -0,0 +1,5 @@ +module.exports = { + async render() { + return this.input + } +} diff --git a/server/modules/renderer/html-mathjax/definition.yml b/server/modules/rendering/html-mathjax/definition.yml similarity index 100% rename from server/modules/renderer/html-mathjax/definition.yml rename to server/modules/rendering/html-mathjax/definition.yml diff --git a/server/modules/renderer/html-mathjax/mathjax.js b/server/modules/rendering/html-mathjax/mathjax.js similarity index 100% rename from server/modules/renderer/html-mathjax/mathjax.js rename to server/modules/rendering/html-mathjax/mathjax.js diff --git a/server/modules/renderer/html-mediaplayers/definition.yml b/server/modules/rendering/html-mediaplayers/definition.yml similarity index 100% rename from server/modules/renderer/html-mediaplayers/definition.yml rename to server/modules/rendering/html-mediaplayers/definition.yml diff --git a/server/modules/renderer/html-core/renderer.js b/server/modules/rendering/html-mediaplayers/renderer.js similarity index 100% rename from server/modules/renderer/html-core/renderer.js rename to server/modules/rendering/html-mediaplayers/renderer.js diff --git a/server/modules/rendering/html-security/definition.yml b/server/modules/rendering/html-security/definition.yml new file mode 100644 index 00000000..fab604c4 --- /dev/null +++ b/server/modules/rendering/html-security/definition.yml @@ -0,0 +1,18 @@ +key: htmlSecurity +title: Security +description: Filter and strips potentially dangerous content +author: requarks.io +icon: whatshot +enabledDefault: true +dependsOn: htmlCore +props: + stripJS: + type: Boolean + title: Strip Javascript + default: false + hint: Javascript code within code blocks won't be affected + filterBadWords: + type: Boolean + title: Filter Bad Words + default: false + hint: Replace bad words with asterisks diff --git a/server/modules/renderer/html-mediaplayers/renderer.js b/server/modules/rendering/html-security/renderer.js similarity index 100% rename from server/modules/renderer/html-mediaplayers/renderer.js rename to server/modules/rendering/html-security/renderer.js diff --git a/server/modules/renderer/markdown-abbr/definition.yml b/server/modules/rendering/markdown-abbr/definition.yml similarity index 100% rename from server/modules/renderer/markdown-abbr/definition.yml rename to server/modules/rendering/markdown-abbr/definition.yml diff --git a/server/modules/renderer/markdown-abbr/renderer.js b/server/modules/rendering/markdown-abbr/renderer.js similarity index 70% rename from server/modules/renderer/markdown-abbr/renderer.js rename to server/modules/rendering/markdown-abbr/renderer.js index 17bc71e8..3438f947 100644 --- a/server/modules/renderer/markdown-abbr/renderer.js +++ b/server/modules/rendering/markdown-abbr/renderer.js @@ -5,10 +5,6 @@ const mdAbbr = require('markdown-it-abbr') // ------------------------------------ module.exports = { - key: 'markdown/abbreviations', - title: 'Abbreviations', - dependsOn: [], - props: [], init (md, conf) { md.use(mdAbbr) } diff --git a/server/modules/rendering/markdown-core/definition.yml b/server/modules/rendering/markdown-core/definition.yml new file mode 100644 index 00000000..43cb2c61 --- /dev/null +++ b/server/modules/rendering/markdown-core/definition.yml @@ -0,0 +1,51 @@ +key: markdownCore +title: Core +description: Basic Markdown Parser +author: requarks.io +input: markdown +output: html +icon: crop_free +props: + allowHTML: + type: Boolean + default: true + title: Allow HTML + hint: Enable HTML tags in content + linkify: + type: Boolean + default: true + title: Automatically convert links + hint: Links will automatically be converted to clickable links. + linebreaks: + type: Boolean + default: true + title: Automatically convert line breaks + hint: Add linebreaks within paragraphs. + typographer: + type: Boolean + default: false + title: Typographer + hint: Enable some language-neutral replacement + quotes beautification + quotes: + type: String + default: English + title: Quotes style + hint: When typographer is enabled. Double + single quotes replacement pairs. e.g. «»„“ for Russian, „“‚‘ for German, etc. + enum: + - Chinese + - English + - French + - German + - Greek + - Japanese + - Hungarian + - Polish + - Portuguese + - Russian + - Spanish + - Swedish + highlightCode: + type: Boolean + default: true + title: Highlight code blocks + hint: Add syntax coloring to code blocks. diff --git a/server/modules/rendering/markdown-core/renderer.js b/server/modules/rendering/markdown-core/renderer.js new file mode 100644 index 00000000..af5637fe --- /dev/null +++ b/server/modules/rendering/markdown-core/renderer.js @@ -0,0 +1,42 @@ +const md = require('markdown-it') +// const hljs = require('highlight.js') +const _ = require('lodash') + +const quoteStyles = { + Chinese: '””‘’', + English: '“”‘’', + French: ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'], + German: '„“‚‘', + Greek: '«»‘’', + Japanese: '「」「」', + Hungarian: '„”’’', + Polish: '„”‚‘', + Portuguese: '«»‘’', + Russian: '«»„“', + Spanish: '«»‘’', + Swedish: '””’’' +} + +module.exports = { + async render() { + const mkdown = md({ + html: this.config.allowHTML, + breaks: this.config.linebreaks, + linkify: this.config.linkify, + typographer: this.config.typographer, + quotes: _.get(quoteStyles, this.config.quotes, quoteStyles.English), + highlight(str, lang) { + // if (this.config.highlightCode && lang && hljs.getLanguage(lang)) { + // try { + // return '
' + hljs.highlight(lang, str, true).value + '
' + // } catch (err) { + // return '
' + _.escape(str) + '
' + // } + // } + return '
' + _.escape(str) + '
' + } + }) + + return mkdown.render(this.input) + } +} diff --git a/server/modules/renderer/markdown-emoji/definition.yml b/server/modules/rendering/markdown-emoji/definition.yml similarity index 100% rename from server/modules/renderer/markdown-emoji/definition.yml rename to server/modules/rendering/markdown-emoji/definition.yml diff --git a/server/modules/renderer/markdown-emoji/renderer.js b/server/modules/rendering/markdown-emoji/renderer.js similarity index 74% rename from server/modules/renderer/markdown-emoji/renderer.js rename to server/modules/rendering/markdown-emoji/renderer.js index b954e4ec..fa256682 100644 --- a/server/modules/renderer/markdown-emoji/renderer.js +++ b/server/modules/rendering/markdown-emoji/renderer.js @@ -5,10 +5,6 @@ const mdEmoji = require('markdown-it-emoji') // ------------------------------------ module.exports = { - key: 'markdown/emoji', - title: 'Emoji', - dependsOn: [], - props: [], init (md, conf) { md.use(mdEmoji) } diff --git a/server/modules/renderer/markdown-expandtabs/definition.yml b/server/modules/rendering/markdown-expandtabs/definition.yml similarity index 61% rename from server/modules/renderer/markdown-expandtabs/definition.yml rename to server/modules/rendering/markdown-expandtabs/definition.yml index 3775f1fa..0c942d71 100644 --- a/server/modules/renderer/markdown-expandtabs/definition.yml +++ b/server/modules/rendering/markdown-expandtabs/definition.yml @@ -5,4 +5,9 @@ author: requarks.io icon: space_bar enabledDefault: true dependsOn: markdownCore -props: {} +props: + tabWidth: + type: Number + title: Tab Width + hint: Amount of spaces for each tab + default: 4 diff --git a/server/modules/renderer/markdown-expandtabs/renderer.js b/server/modules/rendering/markdown-expandtabs/renderer.js similarity index 77% rename from server/modules/renderer/markdown-expandtabs/renderer.js rename to server/modules/rendering/markdown-expandtabs/renderer.js index deed8168..39c0825f 100644 --- a/server/modules/renderer/markdown-expandtabs/renderer.js +++ b/server/modules/rendering/markdown-expandtabs/renderer.js @@ -6,10 +6,6 @@ const _ = require('lodash') // ------------------------------------ module.exports = { - key: 'markdown/expand-tabs', - title: 'Expand Tabs', - dependsOn: [], - props: ['tabWidth'], init (md, conf) { md.use(mdExpandTabs, { tabWidth: _.toInteger(conf.tabWidth || 4) diff --git a/server/modules/renderer/markdown-footnotes/definition.yml b/server/modules/rendering/markdown-footnotes/definition.yml similarity index 100% rename from server/modules/renderer/markdown-footnotes/definition.yml rename to server/modules/rendering/markdown-footnotes/definition.yml diff --git a/server/modules/renderer/markdown-footnotes/renderer.js b/server/modules/rendering/markdown-footnotes/renderer.js similarity index 73% rename from server/modules/renderer/markdown-footnotes/renderer.js rename to server/modules/rendering/markdown-footnotes/renderer.js index 06274355..553b04b3 100644 --- a/server/modules/renderer/markdown-footnotes/renderer.js +++ b/server/modules/rendering/markdown-footnotes/renderer.js @@ -5,10 +5,6 @@ const mdFootnote = require('markdown-it-footnote') // ------------------------------------ module.exports = { - key: 'markdown/footnotes', - title: 'Footnotes', - dependsOn: [], - props: [], init (md, conf) { md.use(mdFootnote) } diff --git a/server/modules/renderer/markdown-mathjax/definition.yml b/server/modules/rendering/markdown-mathjax/definition.yml similarity index 100% rename from server/modules/renderer/markdown-mathjax/definition.yml rename to server/modules/rendering/markdown-mathjax/definition.yml diff --git a/server/modules/renderer/markdown-mathjax/renderer.js b/server/modules/rendering/markdown-mathjax/renderer.js similarity index 72% rename from server/modules/renderer/markdown-mathjax/renderer.js rename to server/modules/rendering/markdown-mathjax/renderer.js index 5c74879b..9b67a51f 100644 --- a/server/modules/renderer/markdown-mathjax/renderer.js +++ b/server/modules/rendering/markdown-mathjax/renderer.js @@ -5,10 +5,6 @@ const mdMathjax = require('markdown-it-mathjax')() // ------------------------------------ module.exports = { - key: 'markdown/mathjax', - title: 'Mathjax Preprocessor', - dependsOn: [], - props: [], init (md, conf) { md.use(mdMathjax) } diff --git a/server/modules/renderer/markdown-mermaid/definition.yml b/server/modules/rendering/markdown-mermaid/definition.yml similarity index 100% rename from server/modules/renderer/markdown-mermaid/definition.yml rename to server/modules/rendering/markdown-mermaid/definition.yml diff --git a/server/modules/renderer/html-security/renderer.js b/server/modules/rendering/markdown-mermaid/renderer.js similarity index 100% rename from server/modules/renderer/html-security/renderer.js rename to server/modules/rendering/markdown-mermaid/renderer.js diff --git a/server/modules/renderer/markdown-plantuml/definition.yml b/server/modules/rendering/markdown-plantuml/definition.yml similarity index 100% rename from server/modules/renderer/markdown-plantuml/definition.yml rename to server/modules/rendering/markdown-plantuml/definition.yml diff --git a/server/modules/renderer/markdown-core/renderer.js b/server/modules/rendering/markdown-plantuml/renderer.js similarity index 100% rename from server/modules/renderer/markdown-core/renderer.js rename to server/modules/rendering/markdown-plantuml/renderer.js diff --git a/server/modules/renderer/markdown-tasklists/definition.yml b/server/modules/rendering/markdown-tasklists/definition.yml similarity index 100% rename from server/modules/renderer/markdown-tasklists/definition.yml rename to server/modules/rendering/markdown-tasklists/definition.yml diff --git a/server/modules/renderer/markdown-tasklists/renderer.js b/server/modules/rendering/markdown-tasklists/renderer.js similarity index 73% rename from server/modules/renderer/markdown-tasklists/renderer.js rename to server/modules/rendering/markdown-tasklists/renderer.js index 9c5a2318..937158e4 100644 --- a/server/modules/renderer/markdown-tasklists/renderer.js +++ b/server/modules/rendering/markdown-tasklists/renderer.js @@ -5,10 +5,6 @@ const mdTaskLists = require('markdown-it-task-lists') // ------------------------------------ module.exports = { - key: 'markdown/task-lists', - title: 'Task Lists', - dependsOn: [], - props: [], init (md, conf) { md.use(mdTaskLists) }