Code block rendering
So by importing javascript package:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/default.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
<!-- and it's easy to individually load additional languages -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/languages/go.min.js"></script>
<script>hljs.highlightAll();</script>
,choosing suitable css style on https://highlightjs.org/examples and downloading them here: https://github.com/highlightjs/highlight.js/tree/10-stable/src/styles
this blog can render code block.
Comments
Post a Comment