Skip to content

Commit

Permalink
docs(syntax highlighting)[WIP]: drop 11ty plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ffoodd committed Mar 3, 2022
1 parent d97ff1b commit a2a2eff
Show file tree
Hide file tree
Showing 4 changed files with 323 additions and 67 deletions.
4 changes: 0 additions & 4 deletions .eleventy.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
const a11yCSS = require('./a11y.css')
const syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight")

module.exports = function (eleventyConfig) {
eleventyConfig.addPlugin(a11yCSS)
eleventyConfig.addPlugin(syntaxHighlight, {
templateFormats: ["njk", "md"]
})

eleventyConfig.addPassthroughCopy('src/static')

Expand Down
3 changes: 2 additions & 1 deletion a11y.css.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,11 @@ const parseSassComment = comment => {
comment = comment.replace(/(\/\*doc|\*\/)/g, '').trim()

const content = fm(comment)
const htmlOutput = new showdown.Converter().makeHtml(content.body)

return {
attributes: content.attributes,
body: new showdown.Converter().makeHtml(content.body)
body: htmlOutput
}
}

Expand Down
Loading

0 comments on commit a2a2eff

Please sign in to comment.