so
so copied to clipboard
feature: highlight source code
Hi @D1mon can you elaborate on what you mean by this?
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=c8f1ab7357aa8359679b6a47a4ce5ca4 Press "Config" select Style to "Simple" this is without highlight code syntax. There is currently no syntax highlighting in the program ("so" program). I want syntax highlighting when viewing code. By the link above we do and switch: "Config" Style -> "Advanced" and "theme" -> "dracula" or other theme.
made some screenshots without syntax highlighting and with syntax highlighting
Oh yes, syntax highlighting. This would be cool, but seems like a high level of effort. Maybe if I find time, or others are motivated. My initial thoughts on the approach:
- Use the
CodeBlockKind::Fenced
enum variant in the markdown parser. - Use a lib like syntect for the actual heavy lifting. Somehow get like an AST out of it, so that the output can be coerced into a cursive
SpannedString
. - Transform the current cursive theme into a theme expected by syntect, so the colors blend in well.
- It might be difficult to add this to the
--lucky
prompt, unless termimad explicitly adds this feature as well.