-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Syntax Highlighting in Markdown #519
Comments
Any news on the issue here? |
@IngwiePhoenix I still need to write tests but plan on opening a PR within a couple days. In the interim, you can implement this easily in your local Harp installation (technically Terraform, since that's what manages Harp's asset pipeline). From Harp's package directory, checkout a new branch, install and save the var marked = require("marked").setOptions(
{
langPrefix: 'language-',
headerPrefix: '',
highlight: function (code) {
return require('highlight.js').highlightAuto(code).value;
}
}) You'll still need to include the Highlight.js CSS file in your layout template, but this should take care of the pre-processing. |
Including the Highlightjs CSS is no biggie - its really small, so that works well for me. Glad to hear you picked this up! Looking forward to the PR. :) |
We do have this existing PR, which would be nice to get a second opinion on. I think this would be a valuable addition to Terraform, but we never really got a chance to discuss it yet. In the meantime, Prism is also a really nice client side option, too. |
It would be nice if we wouldn't need to drop HighlightJS into our static files, and instead can have it pre-rendered already.
HLJS takes up a big bit of data. So it'd be nice if you could allow people to preprocess syntax highlight-able blocks during compilation.
The text was updated successfully, but these errors were encountered: