Commit 7a3b916
committed
[misc] use highlight.js for syntax highlighting in blog post
Toe get highlighting to work, we just need to import the CSS and run the
highlight.js that does the highlighting in JS client side.
We can add the lines at the top of the blog post to do this.
I've made it only support bash and python for now to help with
detection. But if we have a reason to, we can remove that and let it try
them all.
In a previous PR I've added the necessary <code> tags.
But since we're highlighting nicely now, we can just remove the extra
indendation.
I've also noticed that we're pretty good at specifying the language in
code blocks in the changelog. So we can take that language and use it in
the code block as a class to tell highlight.js exactly what language
that code block is in.
If this is useful, we can remove the limitation of only python and bash
support from the top configuration in the future.
This is useful for smaller blocks of a few lines where maybe it doesn't
detect the language properly.1 parent d7ebe2e commit 7a3b916
1 file changed
+23
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
| 49 | + | |
48 | 50 | | |
49 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
50 | 55 | | |
51 | 56 | | |
52 | 57 | | |
53 | 58 | | |
54 | 59 | | |
55 | | - | |
56 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
57 | 64 | | |
58 | 65 | | |
59 | 66 | | |
| |||
64 | 71 | | |
65 | 72 | | |
66 | 73 | | |
67 | | - | |
| 74 | + | |
68 | 75 | | |
69 | 76 | | |
70 | 77 | | |
| |||
131 | 138 | | |
132 | 139 | | |
133 | 140 | | |
134 | | - | |
135 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
136 | 153 | | |
137 | 154 | | |
138 | 155 | | |
| |||
0 commit comments