From 815564b0c47d240a037d53790600c91a416fb5ba Mon Sep 17 00:00:00 2001 From: Christopher Hiller Date: Tue, 21 Apr 2020 09:58:04 -0700 Subject: [PATCH] enable emoji on website; enable normal ul elements grouped these together: - Site can now use emoji :party: - Using the `.single-column` class will render a `ul` element as a "normal" list - Suppress the warning about `text` being an unknown language coming out of 11ty/Prism/markdown-it Ref: #4198 --- .eleventy.js | 2 ++ .markdownlint.json | 3 ++- docs/css/style.css | 18 ++++++++++++++++++ package.json | 1 + scripts/markdown-magic.config.js | 2 +- 5 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.eleventy.js b/.eleventy.js index 934e19bb89..3836c6999e 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -31,6 +31,8 @@ module.exports = function(eleventyConfig) { markdown.use(require('markdown-it-prism')); + markdown.use(require('markdown-it-emoji')); + eleventyConfig.setLibrary('md', markdown); return { diff --git a/.markdownlint.json b/.markdownlint.json index 14a5c306e6..5eab24dc58 100644 --- a/.markdownlint.json +++ b/.markdownlint.json @@ -6,5 +6,6 @@ "first-header-h1": false, "first-line-h1": false, "commands-show-output": false, - "single-h1": false + "single-h1": false, + "fenced-code-language": false } diff --git a/docs/css/style.css b/docs/css/style.css index d4b0ab8600..39fefea91e 100644 --- a/docs/css/style.css +++ b/docs/css/style.css @@ -171,6 +171,13 @@ ul { padding: 0 15px; } +ul.single-column, +ul.single-column > li > ul { + column-count: 1; + margin-top: 0; + padding-right: 0; +} + ul li { border-bottom: 1px solid #eee; break-inside: avoid; @@ -179,6 +186,17 @@ ul li { padding: 5px 0; } +ul.single-column li, +ul.single-column li > ul > li { + list-style: disc; + padding: 0; + border-bottom: 0; +} + +ul.single-column li > ul > li { + list-style: circle; +} + code { font: 14px monaco, monospace; line-height: 1.8; diff --git a/package.json b/package.json index d2a133a380..14dc08d092 100644 --- a/package.json +++ b/package.json @@ -102,6 +102,7 @@ "markdown-it": "^10.0.0", "markdown-it-anchor": "^5.2.5", "markdown-it-attrs": "^3.0.2", + "markdown-it-emoji": "^1.4.0", "markdown-it-prism": "^2.0.5", "markdown-magic": "^1.0.0", "markdown-magic-package-json": "^2.0.1", diff --git a/scripts/markdown-magic.config.js b/scripts/markdown-magic.config.js index f75740a264..f800a5c9f0 100644 --- a/scripts/markdown-magic.config.js +++ b/scripts/markdown-magic.config.js @@ -20,7 +20,7 @@ exports.transforms = { usage: (content, options) => { const {executable} = options; const flag = options.flag || '--help'; - const header = options.header || '\n```text'; + const header = options.header || '\n```'; const footer = options.footer || '```\n'; const output = stripAnsi( String(