Closed lavr001 closed 1 year ago
Hi,
The comment syntax depends on the language. Currently the comment detection isn't super smart, if # withClass
doesn't work, it probably means you need to use // withClass
.
It kind of worked, thank you. Can you apply withClass
annotations with lines, instead of columns? I tried to use it twice in one step, and it only worked the first time.
Does code hike have a language for terminal prompts? (e.g. keep all CLI outputs in white color regardless of the theme used)
It should work twice in the same line. Here for example.
Does code hike have a language for terminal prompts? (e.g. keep all CLI outputs in white color regardless of the theme used)
Nope, but I want to add something eventually. If you have ideas you can share them in this issue: https://github.com/code-hike/codehike/issues/206.
In regards to the withClass
annotation, what I meant was is it possible to use it to apply styles to different lines, instead of columns (e.g. similar to mark=4,15
).
For example if I have 20 lines of code in one step, and would like to apply a specific style to lines 2, 6, 12, is there a way to do it in one line (withClass=2,6,12
)?
Yes. The syntax is like this:
```python hello.py
print("This is Code Hike")
# withClass(1:2,4) red
print("This is Code Hike")
print("This is Code Hike")
print("This is Code Hike")
print("This is Code Hike")
print("This is Code Hike")
I tried this:
js focus=1:2 mark=1
// withClass(1) bold
and got the error: 'Error: Code Hike can't handle two annotations for the same line', see attached
Can you try it in the playground and share the link?
Here is the playground link.
I made it work with applying styling to columns using square brackets, but just wondering if there is a cleaner solution with applying custom styling to line(s)
Oh, that's because you are applying both annotations to the same line (mark and withClass).
Thank you! That's exactly what I was looking for.
Hello,
I'm following this code hike docs to implement a withClass annotation to make the first line
bold
here is my code:here is my css:
And instead of applying the styling from the bold class, I see this
# withClass[1:45] bold
in the code container:Any suggestions?