-
Notifications
You must be signed in to change notification settings - Fork 454
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fix formatting issues - Use string templates - Use for of loops wherever possible instead of for each - Remove parameter re-assignment - Prefix "node:" for system imports --------- Signed-off-by: Zabil Cheriya Maliackal <[email protected]>
- Loading branch information
Showing
201 changed files
with
11,259 additions
and
12,275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,44 @@ | ||
const tocPlugin = require('eleventy-plugin-toc'); | ||
const tocPlugin = require("eleventy-plugin-toc"); | ||
const markdownIt = require("markdown-it"); | ||
const CleanCSS = require("clean-css"); | ||
|
||
module.exports = function (eleventyConfig) { | ||
|
||
module.exports = (eleventyConfig) => { | ||
eleventyConfig.addPassthroughCopy("docs/assets"); | ||
eleventyConfig.addFilter("cssmin", function(code) { | ||
return new CleanCSS({}).minify(code).styles; | ||
}); | ||
eleventyConfig.addFilter( | ||
"cssmin", | ||
(code) => new CleanCSS({}).minify(code).styles, | ||
); | ||
// This filter is used for deriving the chapter names | ||
// from data in chapters.json | ||
eleventyConfig.addFilter('heading', function (str) { | ||
return str.replace(/[_;\\/:*?\"<>|&']/g, " "); | ||
}); | ||
eleventyConfig.addFilter("heading", (str) => | ||
str.replace(/[_;\\/:*?\"<>|&']/g, " "), | ||
); | ||
|
||
// Filter for linking to section headers | ||
// and displaying chapters in a page | ||
let markdownItAnchor = require("markdown-it-anchor"); | ||
let mdIt = markdownIt({ | ||
html: true, | ||
linkify: true | ||
}) | ||
.use(markdownItAnchor, { | ||
permalink: true, | ||
permalinkBefore: false, | ||
permalinkClass: "direct-link", | ||
permalinkSymbol: "#", | ||
level: [1, 2] | ||
}); | ||
eleventyConfig.addFilter("markdown", function(code) { | ||
if(code) { | ||
return mdIt.render(code); | ||
} | ||
const markdownItAnchor = require("markdown-it-anchor"); | ||
const mdIt = markdownIt({ | ||
html: true, | ||
linkify: true, | ||
}).use(markdownItAnchor, { | ||
permalink: true, | ||
permalinkBefore: false, | ||
permalinkClass: "direct-link", | ||
permalinkSymbol: "#", | ||
level: [1, 2], | ||
}); | ||
eleventyConfig.addFilter("markdown", (code) => { | ||
if (code) { | ||
return mdIt.render(code); | ||
} | ||
}); | ||
eleventyConfig.setLibrary("md", mdIt); | ||
eleventyConfig.addPlugin(tocPlugin); | ||
|
||
return { | ||
dir: { | ||
input: 'docs', | ||
output: 'docs/_site' | ||
} | ||
} | ||
}; | ||
input: "docs", | ||
output: "docs/_site", | ||
}, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.