-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
chroma code highlighting issues #187
Comments
As a follow-up: none of the light themes work: some of the colors become one with the background. Some of the dark theme get altered. Eg here is solarized-dark viewed in Firefox: That is clearly not the solarized theme. Yet I used the usual hugo chroma thene generation snippet. Could there be another layer that alters CSS codes before the browser gets to it? I also see slightly different behaviour between Chrome and Firefox. |
Before digging into this too much... are you able to use the built-in syntax highlighting provided by highlight.js. To investigate this any further I think you might need to provide sample code / a link to your website if the repository is public. |
Thanks for the follow-up -- much appreciated! I happen to have used The site I am working on is for a class I will be teaching come January, so it is half-public and half not. But for starters, my mock page with code follows. It is the one I used for the screen-shots above and it clearly does not come the same way as it does in other Hugo themes. ---
title: Code typeset
weight: 500
---
Python
``` Python
while:
a = 3.0;
```
R
``` R
## some code comment
foo <- function(bar) {
zigzag(bar)
txt <- "a text var"
return(NULL)
}
```
SQL
```sql
select foo from bar where date > '2018-10-01'
``` I can complement this with appropiate settings from the top-level |
TIL that hugo has built in code-formatting with Chroma. I actually wasn't aware! https://gohugo.io/content-management/syntax-highlighting/ I'll try get to this in the next few days. Just some initial ideas though:
|
Hehe. It is not that well documented. But yes, seems to work and is fast as usual. As for your two points:
where
|
When inspecting with Chrome Dev Tools it is possible to show which css file is causing the behaviour you see. At least that narrows down the issue some more to a specific file. See Figure 2 at this chrome devtools help page. Each css rule has a link to the |
@matalo33 I had actually tried to peek at the CSS analysis from the Chrome "Inspect" view but I guess I am too much of a newb when it comes to CSS styling -- I could not figure it out. The page I was refering is now public (pending DNS updates "everywhere") so could you take a look at it at this link ? I am basically content with i) having pandoc-alike static rendering and some styling but ii) a little bewildered about the dark background I did not ask for. Is that something fixable? |
@matalo33 If you had a moment to take a look at his page I'd really appreciate it! |
I'd still truly appreciate a second look. I moved the temp page referenced above out of the way as it was temp, but I have a short page with code snippets exhibiting the same issue. |
Dear Dirk @eddelbuettel ,
You can of course choose your own style (https://xyproto.github.io/splash/docs/all.html), but "trac" has no background or borders (although you can add it in your own css). I modified the theme while also removing highlightjs, but also some colors in theme.css. https://github.com/statnmap/hugo-theme-learn/tree/light-chroma |
Awesome. Will try this evening once I get home. That said I by now lost trac of what I tried in the past but my current
I am fairly sure I tried flipping the 'useClasses' toggle. |
On the documentation it is said:
So you should set |
Just tried it on the laptop. I might have been there once -- it "works" but now the theme does not work. I get some 'white on white' in the first example. The second one works better (ie shell). |
With my fork and its modified theme.css ? |
With my actual site. |
So this is normal that it does not work. |
Ok, have the same problem with C++ syntax (not) highlighting. What gives? I am hoping for hugo theme learn, next release that will fix this issue. |
Hello everyone! Writing something like Nes::MemoryController::kPrgRomOffsetBank0 for example gives only Nes::kPrgRomOffsetBank0. Basically the :: will display only the first and the last entry. Also writing this: Using {{< highlight cpp >}}...maybe I am doing something wrong ? Thanks everybody :) |
@DBJDBJ I "eventually" got help from a friend with better CSS "skillz" who showed me how to drill down to find where the entity was set so I had to make another change in, if I recall, two places. I could distill this I presume. @JorenJoestar I should check if I have that covered. |
works now in initially collapsed expands and initially inactive tabs
"tl;dr" synopis: chroma does not seem to be configurable
I am having difficulties with code highlighing under this
hugo-theme-learn
. What I am observing does not make sense, but I am out things to try.Longer description
I have successfully modified a number of standard style elements, and also used two different Hugo themese as test beds. Both other themes (beautifulhugo as well as the on-purpose-minimal hugo-xmin) seem to do what I want them to do (a simple
trac
format for fenced code blocks).With
hugo-theme-learn
I have no such luck. I generated a number of differentsyntax.css
files, yet none seems to make a difference on rendering -- I end up with mostly 'white on white' code:If however I remove the header line and not include any, I get plain 'white on black' and clearly no highlighting.
I have seen other suggesting that maybe
mermaid
plays a role, so I removed that from the footer. No effect.I really like the rest of this theme and would love to get it to work with code formatted by
chroma
and adjustable via simple .css files pregenerated.Any ideas?
The text was updated successfully, but these errors were encountered: