-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Embedding Code Snippets in Text Notes. #196
Comments
Hi JordyScript, I'd love to have this feature as well, but this is actually a responsibility of CKEditor (which is our editing component). They have an issue for this, but I'm afraid there hasn't been much progress recently: ckeditor/ckeditor5#436 As soon as that feature lands in, we'll have it as well. Even though it's not perfect for now I use code subnote for larger code snippets and if it's really piece of code small I use blockquote inside text document. |
@zadam For code subnote, do you just create a child note? Issue I have there is a visual one. |
Unfortunately what you want is not possible now - there's always just single note displayed. Instead of doing that I rather want to wait for CKEditor to implement proper code block feature (which they plan to do, it's just a matter of time). For now whenever I need code block inside text note I use either blockquote or single line code. It's far from perfect, but works for me in the meantime. |
Cheers @zadam I will stick with single line code, it'll do the job |
It looks like this may be added to CKEditor soon: https://twitter.com/ckeditor/status/1138803157700624385 |
Yes, I'm watching it closely and I'm ready to integrate as soon as it is available :-) |
Code block support is in 0.38.0-beta |
Hello, I have been testing the software, but I see that they do not apply color syntax in the code blocks. |
A very useful feature to have implemented in Trilium would be the ability to embed code snippets with syntax highlighting into text notes. This would make annotating/documenting your code snippets much more convenient.
A visual example of what I mean is the following screenshot (this is a markdown note created in Boostnote)
Note also how there is a copy button which allows you to copy the entire contents of the code snippet embedded in the text in a single click without selecting it first. This would also be really useful as an additional feature.
The way this is currently done in Boostnote, is by writing three back ticks followed by the programming language you want to write. Then the code, then on the last line three more back ticks. (This even works in githubs comments if I don't escape the back ticks.)
``` python
[insert code here]
```
The text was updated successfully, but these errors were encountered: