Updated highlight.js example (#2568)

* Update highlight.js version in example

* Fix for instant navigation
This commit is contained in:
Julien Richard 2021-04-15 21:47:50 +02:00 committed by GitHub
parent 21b543a038
commit eeb3b239dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,17 +56,19 @@ configuring syntax highlighting of code blocks:
=== "docs/javascripts/config.js"
``` js
hljs.initHighlighting()
document$.subscribe(() => {
hljs.highlightAll()
})
```
=== "mkdocs.yml"
``` yaml
extra_javascript:
- https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js
- https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/highlight.min.js
- javascripts/config.js
extra_css:
- https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/default.min.css
- https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/styles/default.min.css
```
Note that Highlight.js has no affiliation with the Highlight extension.