You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[get the latest files]: https://cdnjs.com/libraries/highlight.js
15
+
[style options]: https://highlightjs.org/examples
16
+
17
+
## Set Up
18
+
### Add highlight.js
19
+
20
+
Specify the `highlight.js` javascript and CSS source files. At a minimum you will need to include the main script `highlight.min.js` and stylesheet `a11y-dark.min.css`. You should also specify language specific scripts as needed.
Add a custom javascript file which will trigger the `highlight.js` library to highlight code blocks after an HTML page loads. You can add the file to `docs/highlight.js` and reference it in the `extra_javascript` section of `mkdocs.yml`:
Script adapted from Zaira Hira's ["Bash Scripting Tutorial Linux Shell Script and Command Line For Beginners"](https://www.freecodecamp.org/news/bash-scripting-tutorial-linux-shell-script-and-command-line-for-beginners/)
Javascript language highlighting with `highlight.js`:
4
+
5
+
```javascript
6
+
let score1 =2;
7
+
let score2 =5;
8
+
let averageScore = (score1 + score2) /2.0
9
+
console.log(averageScore)
10
+
```
11
+
12
+
Script adapted from Austin Asoluka's ["How to Use Variables and Data Types in JavaScript – Explained With Code Examples"](https://www.freecodecamp.org/news/how-to-use-variables-and-data-types-in-javascript/)
[get the latest files from a CDN]: https://highlightjs.readthedocs.io/en/latest/readme.html#fetch-via-cdn
14
+
[get the latest files]: https://cdnjs.com/libraries/highlight.js
15
+
[style options]: https://highlightjs.org/examples
14
16
15
17
## Set Up
16
18
### Add highlight.js
17
19
18
-
Specify the `highlight.js` javascript and CSS source files. At a minimum you will need to include the main script `highlight.min.js` and stylesheet `default.min.css`. You should also specify language specific scripts as needed.
20
+
Specify the `highlight.js` javascript and CSS source files. At a minimum you will need to include the main script `highlight.min.js` and stylesheet `a11y-light.min.css`. You should also specify language specific scripts as needed.
0 commit comments