You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#show raw.where(lang: "foo_lang"): it => [
#show regex("\b(for|to|begin|end)\b") : keyword => text(weight:"bold", keyword)
#it
]
```foo_lang
for i=1 to 10
begin
print(i)
end
```
Reacted by Christian Wünsche, Hiroki Chen, Tesla Zhang, Marty Byrde, Vojtěch Struhár and Brian E
Perhaps raw should have some theme dict option to override the default THEME used by raw (allowing a theme to be specified in Typst, even)? (Paging @laurmaedje)
Perhaps raw should have some theme dict option to override the default THEME used by raw (allowing a theme to be specified in Typst, even)? (Paging @laurmaedje)
Yes, I planned on having something like this. Not sure how it would be specified. The two options I see are a dictionary that statically specifies the theme or a function that gets a piece of text + its textmate scopes and is free to do whatever.
Activity
SaitoAtsushi commentedon Mar 28, 2023
I found a good example in code comment.
typst/library/src/text/raw.rs
Lines 48 to 58 in 4428646
We can imitate this.
Keyword emphasis can be written like following:
imbrem commentedon Mar 28, 2023
Thanks, I didn't think of that! Guess I'll go ahead and close this then.
lucifer1004 commentedon Apr 13, 2023
Is it possible to provide custom Sublime syntax files to support extra languages? The workaround above can only deal with some naive cases.
PgBiel commentedon Apr 13, 2023
Perhaps
rawshould have somethemedict option to override the defaultTHEMEused byraw(allowing a theme to be specified in Typst, even)? (Paging @laurmaedje)laurmaedje commentedon Apr 13, 2023
Yes, I planned on having something like this. Not sure how it would be specified. The two options I see are a dictionary that statically specifies the theme or a function that gets a piece of text + its textmate scopes and is free to do whatever.
LaurenzV commentedon Sep 2, 2023
This feature already exists now, right? Can this issue be closed?