-
|
I am using Avalonia TextEditor: This generally works, but markdown highlighting is really basic, e.g. all headers h1-h6 are rendered the same. I found out that the package produces tokens that can be styled. But where do I inject my styles for this? Alternatevly, are there ready made options to get nice markdown highlighting? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
TextMateSharp itself doesn’t expose a “CSS-like” place where you override token colors the way VS Code themes do. In AvaloniaEdit, the TextMate integration already maps TextMate scopes to colors using the theme you pass (AtomOneDark in your case). The Markdown grammar, and themes are the same one used by VS Code, so in theory you should get the same scope breakdown. If the built-in themes are not enough and you want full control, the way to customize highlighting in AvaloniaEdit is to plug your own You can register your own LineTransformer on the editor and apply styles based on the token scopes coming from TextMate, using |
Beta Was this translation helpful? Give feedback.
TextMateSharp itself doesn’t expose a “CSS-like” place where you override token colors the way VS Code themes do.
In AvaloniaEdit, the TextMate integration already maps TextMate scopes to colors using the theme you pass (AtomOneDark in your case). The Markdown grammar, and themes are the same one used by VS Code, so in theory you should get the same scope breakdown.
If the built-in themes are not enough and you want full control, the way to customize highlighting in AvaloniaEdit is to plug your own
LineTransformer. The TextMate one is placed here:https://github.com/AvaloniaUI/AvaloniaEdit/blob/8dea781b49b09dedcf98ee7496d4e4a10b410ef0/src/AvaloniaEdit.TextMate/TextMateColoringTransformer.…