Documentation Channel for #raku | This channel is logged | Roadmap: github.com/raku/doc/wiki
Set by [Coke] on 23 May 2022.
00:24 Nemokosch joined
Nemokosch [Coke]: negative, the graphs of named types work 00:24
By the way, I'm quite sure the highlighter relies on timing some way and fails for a cold runup. Only for the first occasion... 00:25
00:25 Nemokosch left 00:46 Kaiepi left 03:47 Kaiepi joined
CIAvash Would replacing "atom-language-perl6" with [chroma](github.com/alecthomas/chroma) for highlighting code be desired? I don't know how it correlates with `raku-mode.js`, `farabi6` and codemirror, but the benefits are better performance and less dependencies(node_modules) because you can use the chroma binary directly. cc Altai-man 05:08
But maybe after RakuAST they won't be necessary? 🤷 05:10
07:43 Nemokosch joined
Nemokosch I don't think RakuAST could magically solve this. If the idea is that this chroma will be just good enough not to worry about the source, then good luck; otherwise I'd vote against anything that involves migrating from a language I know to Go 07:54
07:58 Nemokosch left
CIAvash It would replace syntax highlighting currently done with JS. I mentioned RakuAST, because we may have our own syntax highlighter in Raku after it lands, not sure. Using chroma will be just giving the code to its CLI to generate the html. CSS class names need to change though. I saw mentions of `CodeMirror` and CSS classes that start with `.cm` and farabi6 in `raku-mode.js` for live code editing, so I wondered things might be more complicated than 08:23
simply replacing "atom-language-perl6". If these are not related, then I think it would be easy to replace "atom-language-perl6" with chroma.
09:11 sena_kun joined 09:14 sena_kun left 09:42 sena_kun joined 09:46 Nemokosch joined
Nemokosch I know how syntax highlighting works... more or less. It's based on the highlighter module created with Atom and it's just invoked from the webserver app - so yes, essentially "giving the code to CLI to generate the HTML" 09:49
The thing is rather that currently, I think it's just a matter of communication and management to do anything with syntax highlighting based on atom-language-perl6. With Chroma, we would lose the management powers (because it's outside of the community) and I for one would lose much of the interest - because previously there was hope to work with familiar technologies like Node, JSON, the JS macroverse overall, and now all of a sudden 09:52
the lexer itself would be written in Go.
it would be probably easy to try chroma out, though
that's why I say if produces so good output that you can "set it and forget it", then I'm not against it 09:53
09:53 Nemokosch left 09:54 Kaiepi left
sena_kun for syntax highlighting we want to wait for raku solution 10:03
which comes after RakuAST work done
CIAvash FWIW I made the Raku lexer for chroma, so I can make changes, and if necessary build a binary from it if timing of release would be an issue. 10:05
Yeah that's why I asked before creating a PR
sena_kun I'm sure it doesn't work with slangs? 10:08
what about heredocs support?
CIAvash (chroma is also being used in raku.land, if you want to see it in action, also in Gitea(which Codeberg) uses) 10:09
It supports heredocs
No, for slangs you'd need an actual/real lexer, or at least a more complicated one 10:12
lizmat I feel that jnthn's answer here: stackoverflow.com/questions/745433...ash-safely could be copied almost verbatim to some FAQ in the docs 10:18
CIAvash A few examples for highlighting: codeberg.org/CIAvash/APISports-Foo...ll.rakumod codeberg.org/CIAvash/Pod-Contents codeberg.org/CIAvash/Test-Run/src/...n.rakutest 10:21
10:57 Kaiepi joined
sena_kun hmmm 14:10
interesting
CIAvash, how do you integrate it with a website, is there a code sample? 14:11
is it lighter than what we do? did you compare features?
15:07 Kaiepi left
[Coke] if someone can add lizmat's URL above to a doc ticket, that'd be great. 16:24
16:26 Kaiepi joined
Geth ¦ doc: coke self-assigned Explanation on thread issues with hashes github.com/Raku/doc/issues/4143 16:35
[Coke] Thanks, lizmat. 16:39
lizmat yw :-) 16:40
[Coke] One boring task that doesn't require a lot of raku knowledge: verify that items with label:docs are actually spec'd in Roast (if not, add label:NONSPECCED) 16:46
(basically, use 'rak' or something to search for any usage of a requested method/class/sub to see if it's used in roast) 16:51
18:04 sena_kun left 18:06 sena_kun joined 19:32 sena_kun left 19:33 sena_kun joined
CIAvash sena_kun: Using the chroma CLI I changed the `lib/Docky/Renderer/Node.pm6` file: gist.github.com/CIAvash/85bbbbd24c...-pm6-L7-L8 the first highlighted line generates the HTML with classes and the line that is commented out generates HTML with inline styles. Feature-wise I think the chroma lexer has better support for Raku, meaning detecting more tokens, if the chroma binary gets used, it means no dependencies 19:38
(no downloading node modules), I have not compared the performance, but I'm going to guess chroma is faster. Considering the size, atom-highlight-perl6 with the node_modules directory is about 60MB and chroma binary file is 6.3MB.
sena_kun CIAvash, extremely curious. what about color themes? we need at least two, light and dark. 20:16
CIAvash sena_kun: Current themes probably can be used, but CSS class names need to change and maybe added, but chroma comes with these styles: github.com/alecthomas/chroma/tree/master/styles demo of some of the styles(it doesn't include all themes, specially the ones I've added): xyproto.github.io/splash/docs/all.html 20:22
21:40 sena_kun left 21:41 sena_kun joined 22:58 sena_kun left 23:03 sena_kun joined 23:50 sena_kun left