-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider switching to the syntax highlighting library in egui_extras
#13
Comments
While being able to have fallback highlighting is nice, I don't like losing the more granular control I'm able to have by using syntect directly. E.g: Using syntects custom cursor colour and selection colour. |
Of course, I propose we expose that in |
### What ```rs rec.log( "markdown", &TextDocument::new( "# Hello\n\ Markdown with `code`!\n\ \n\ A random image:\n\ \n\ ![A random image](https://picsum.photos/640/480)", ) .with_media_type(MediaType::markdown()), )?; ``` <img width="809" alt="image" src="https://github.com/rerun-io/rerun/assets/1148717/d4cbf9a3-e3c9-4aba-be35-8921dae001e7"> This will let us add nice documentation explaining our examples. ### Not yet supported * Syntax highlighting of code blocks * `egui_commomark` uses `syntect` which is too big of a dependency imho, see lampsitter/egui_commonmark#13 * Embedding references to images in the data store * We should support something like `![](entity://my/image/entity)` where `my/image/entity` is the entity path to an image you have logged. ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/3343) (if applicable) - [PR Build Summary](https://build.rerun.io/pr/3343) - [Docs preview](https://rerun.io/preview/8b743c5708382aef1841a364442762a2abc80db3/docs) <!--DOCS-PREVIEW--> - [Examples preview](https://rerun.io/preview/8b743c5708382aef1841a364442762a2abc80db3/examples) <!--EXAMPLES-PREVIEW--> - [Recent benchmark results](https://ref.rerun.io/dev/bench/) - [Wasm size tracking](https://ref.rerun.io/dev/sizes/)
I don't think that it is possible to add a backend agnostic highlighter. |
I would suggest that |
I have added egui_extras as a fallback when the syntax_highlighting feature is disabled, which should have the desired effect. |
That's great - thank you so much! |
I recently moved the syntax highlighting code I had in
egui_demo_lib
toegui_extras
: emilk/egui#3333Importantly, it has a simple fallback that works even without the
syntect
crate (which has a tendency to bloat .wasm files quite a bit).egui_extras::syntax_highlighing
does not yet support everything thategui_commonmark
offers, in particular it doesn't yet haveadd_syntax_from_folder
,add_syntax_from_str
,add_syntax_themes_from_folder
, andadd_syntax_theme_from_bytes
.The text was updated successfully, but these errors were encountered: