-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
See if HLJS can work on generic (non-language specific) code blocks #16
Comments
Ryan said:
|
Alright. So I may have been too aggressive with stripping out styles for things that were not Hugo. I see, too that there's Hugo stuff that is |
Yeah, that makes sense. So things that don't need those features, shouldn't be wrapped in the shortcode, therefore I need to account for them in my styling. I'll take another look. and, as you can see here I stripped out everything. https://github.com/budparr/gohugo-theme/blob/master/src/css/_hljs.css But as far as I understood, HLJS is language specific, but I'll see if I can dig up something, if it's not just handled in the stylesheet. JS: |
Trying to avoid this (https://hugodocs.info/templates/introduction/#2-use-to-access-the-global-context), where the HTML tags are highlighted, but not the Hugo tags (except in one case because the Hugo tag is part of the HTML: this is not a comment on @rdwatters work on this, but looking for cases to style around. |
Ha, responded on my phone and didn't notice. I think the example you put above is a good one since I remember trying tweak a lot of the HLJS (including, for example, In retrospect, kind of a myopic move on my part since everything would break with future packages. In the hopes of saving you a step, these are the following languages I have on the current site from https://highlightjs.org/download/:
|
Hmm. So I guess the HLJS "Handlebars" is a little better in that it recognizes the double curlies as a template variable, but it doesn't separate strings from templating logic, etc. Do you think we should write our own |
HLJS was stripped out a long time ago. |
Currently HLJS is cued off of the class
language-html
or other appropriate language. Code blocks only get that class if they're wrapped in a short-code, and handling of the shortcode is inconsistent through the docs, leaving many left without highlight.So either we need to find a way to apply hljs to generic code that doesn't have that class or apply the shortcode uniformly to the code.
cc @digitalcraftsman @rdwatters
#13 (comment)
Initially made this issue in the wrong repo. Sorry!
The text was updated successfully, but these errors were encountered: