Comment about code syntax highlighting
... with Prism
Syntax Highlighting is done with a forked version of Metalsmith-Prism. The fork can be found here. As the name suggests this plugin uses PrismJS to do the work. In its current state, as of Jan 28, 2022, it supports line numbers and all dependencies are up-to-date. To use it install it with
npm install git+https://github.com/wernerglinka/metalsmith-prism
The plugin will be available on NPM soon.
Use the plugin as usual
const prism = require('metalsmith-prism');
...
.use(prism({
lineNumbers: true,
preLoad: ["java", "scala"]
}))
...
The plugin will add all necessary hooks to the code so styles can be applied. Themes or styles are not applied by the plugin but with a style sheet at this point.