Closed mesqueeb closed 4 years ago
I did some more research, and PrismJS is very bad at automatic treeshaking... It says you need an extra "babel-plugin-prismjs" to make the package smaller with just what you need...
You could just post-process the resulting HTML?
You need to add a class="language-js"
to each <code>
block.
Then read the "Usage with CDNs" section. I recommend jsDelivr, sin CDNjs future is up in the air.
@tomByrer I'm not sure about CDN's I rather package my libraries together with the app via webpack. But if prismjs doesn't support simple tree-shaking, that's such a bummer. :D because it'll get big you see?
@tomByrer how to add class="language-js"
to the <pre>
blocks that snarkdown gives?
Hey! I love this small footprint!!
I'd love to be able to write:
```js
console.log() // etc.```
with javascript code and have syntax highlighting for the code block. ;)I researched a bit and found out I'd need to use Prism https://prismjs.com
Is it possible to add a small example to the readme to show the best practice of how this could be done? 😄
Thanks so much!!