Skip to content

Commit

Permalink
Updated highlight.js example (#2568)
Browse files Browse the repository at this point in the history
* Update highlight.js version in example

* Fix for instant navigation
  • Loading branch information
jairbubbles committed Apr 15, 2021
1 parent 21b543a commit eeb3b23
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docs/reference/code-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit eeb3b23

Please sign in to comment.