Setup syntax highlighting
MODIFY
website/.eleventy.js
website/.eleventy.js
+const syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
+
const CleanCSS = require("clean-css");
module.exports = function(eleventyConfig) {
@@ -6,6 +8,8 @@ module.exports = function(eleventyConfig) {
return new CleanCSS({}).minify(code).styles;
});
+ eleventyConfig.addPlugin(syntaxHighlight);
+
return {
dir: {
input: "src",

MODIFY
website/package.json
website/package.json
},
"dependencies": {
"@11ty/eleventy": "^0.11.0",
+ "@11ty/eleventy-plugin-syntaxhighlight": "^3.0.1",
"clean-css": "^4.2.3"
}
}

MODIFY
website/src/includes/layout.njk
website/src/includes/layout.njk
@@ -8,6 +8,8 @@ title: A JavaScript toolchain | Rome
<title>{{ title }}</title>
</head>
+ <link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.20.0/themes/prism-tomorrow.min.css" rel="stylesheet" />
+
{% set css %}{% include 'styles.css' %}{% endset %}
<style>{{ css | cssmin | safe }}</style>

MODIFY
website/src/index.md
website/src/index.md
@@ -314,7 +314,7 @@ Our [Discord server](https://discord.gg/9WxHa5d) is open for help and more adhoc
Getting started with developing Rome is as easy as three commands. You will need Node v12 or above.
-```
+```bash
git clone https://github.com/romejs/rome
cd rome
scripts/dev-rome --help
@@ -330,7 +330,7 @@ Refer to [Getting Started](../introduction/getting-started.md) for more usage do
You can run the test suite with the following command:
-```
+```bash
scripts/dev-rome test
```
@@ -340,6 +340,6 @@ This will run all tests inside of any `__rtests__` directories.
Run TypeScript with code emitting disabled to perform a full typecheck outside the editor.
-```
+```bash
node_modules/.bin/tsc --noEmit
```

MODIFY
website/yarn.lock
website/yarn.lock
resolved "https://registry.yarnpkg.com/@11ty/dependency-tree/-/dependency-tree-1.0.0.tgz#b1fa53da49aafe0ab3fe38bc6b6058b704aa59a1"
integrity sha512-2FWYlkphQ/83MG7b9qqBJfJJ0K9zupNz/6n4EdDuNLw6hQHGp4Sp4UMDRyBvA/xCTYDBaPSuSjHuu45tSujegg==
+"@11ty/eleventy-plugin-syntaxhighlight@^3.0.1":
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/@11ty/eleventy-plugin-syntaxhighlight/-/eleventy-plugin-syntaxhighlight-3.0.1.tgz#24fb872d1bb8f8dee8d6df22d3614aaff6b45306"
+ integrity sha512-+cXc5oyFagCat+JgIh+4cI1otQMVYSsXjxj2/8J78I+p6ICvCfObzvi7PTXvDPbwXOQP8RkcB4DYOP+MKkcPAw==
+ dependencies:
+ prismjs "^1.17.1"
+
"@11ty/eleventy@^0.11.0":
version "0.11.0"
resolved "https://registry.yarnpkg.com/@11ty/eleventy/-/eleventy-0.11.0.tgz#e9ca1f68d24fe0df5d7449bb4ca4405cae2c0172"
@@ -606,6 +613,15 @@ clean-css@^4.1.11, clean-css@^4.2.3:
dependencies:
source-map "~0.6.0"
+clipboard@^2.0.0:
+ version "2.0.6"
+ resolved "https://registry.yarnpkg.com/clipboard/-/clipboard-2.0.6.tgz#52921296eec0fdf77ead1749421b21c968647376"
+ integrity sha512-g5zbiixBRk/wyKakSwCKd7vQXDjFnAMGHoEyBogG/bw9kTD9GvdAvaoRR1ALcEzt3pVKxZR0pViekPMIS0QyGg==
+ dependencies:
+ good-listener "^1.2.2"
+ select "^1.1.2"
+ tiny-emitter "^2.0.0"
+
cliui@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1"
@@ -817,6 +833,11 @@ del@^2.2.0:
pinkie-promise "^2.0.0"
rimraf "^2.2.8"
+delegate@^3.1.2:
+ version "3.2.0"
+ resolved "https://registry.yarnpkg.com/delegate/-/delegate-3.2.0.tgz#b66b71c3158522e8ab5744f720d8ca0c2af59166"
+ integrity sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==
+
depd@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9"
@@ -1221,6 +1242,13 @@ globby@^5.0.0:
pify "^2.0.0"
pinkie-promise "^2.0.0"
+good-listener@^1.2.2:
+ version "1.2.2"
+ resolved "https://registry.yarnpkg.com/good-listener/-/good-listener-1.2.2.tgz#d53b30cdf9313dffb7dc9a0d477096aa6d145c50"
+ integrity sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=
+ dependencies:
+ delegate "^3.1.2"
+
graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.4, graceful-fs@^4.1.6, graceful-fs@^4.2.0:
version "4.2.4"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb"
@@ -2272,6 +2300,13 @@ pretty@^2.0.0:
extend-shallow "^2.0.1"
js-beautify "^1.6.12"
+prismjs@^1.17.1:
+ version "1.20.0"
+ resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.20.0.tgz#9b685fc480a3514ee7198eac6a3bf5024319ff03"
+ integrity sha512-AEDjSrVNkynnw6A+B1DsFkd6AVdTnp+/WoUixFRULlCLZVRZlVQMVWio/16jv7G1FscUxQxOQhWwApgbnxr6kQ==
+ optionalDependencies:
+ clipboard "^2.0.0"
+
process-nextick-args@~2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"
@@ -2615,6 +2650,11 @@ section-matter@^1.0.0:
extend-shallow "^2.0.1"
kind-of "^6.0.0"
+select@^1.1.2:
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/select/-/select-1.1.2.tgz#0e7350acdec80b1108528786ec1d4418d11b396d"
+ integrity sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=
+
semver-compare@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc"
@@ -2997,6 +3037,11 @@ time-require@^0.1.2:
pretty-ms "^0.2.1"
text-table "^0.2.0"
+tiny-emitter@^2.0.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/tiny-emitter/-/tiny-emitter-2.1.0.tgz#1d1a56edfc51c43e863cbb5382a72330e3555423"
+ integrity sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==
+
to-array@0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/to-array/-/to-array-0.1.4.tgz#17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890"

Setup syntax highlighting