pvd
November 30, 2021, 3:54am
1
Things I have tried
I’ve Googled a lot and read related topics:
What I’m trying to do
I would like Mathematica code blocks to format nicely like they do for other languages with syntax coloring.
Consider in the following two code blocks:
def fun():
x = 1
f[x0_] := Module[{x = x0},
While[x > 0, x = Log[x]]; x
]
The python code looks good, but the wolfram code looks like verbatim:
[Screen Shot 2021-05-19 at 2.41.41 AM]
What I’ve tried
Mathematica (aka wolfram language) is less popular but is still supported in many editors like Sublime e.g. Wolf…
Steps to reproduce
Write a long one line code block with syntax
Expected result
Preview shows as expected after closing&opening note
[2]
Actual result
Preview doesn’t create a scrollbar
[1]
After closing and reopening preview, preview shows as expected.
But after writing any text, preview goes back to unexpected state.
[3]
Environment
Operating system: Linux
Obsidian version: v.0.8.4
Additional information
Since the editor window uses CodeMirror, it seems like we should be able to add syntax highlighting in code blocks relatively easily (all things considered).
Is that on the roadmap? It is very important to me to be able to use syntax highlighting for different languages in my notes.
Thanks!
What I’m trying to do
I just wanna the code highlight would looks like :
However, that’s my case:
The first thing is defclass
not being highlighted the right way in preview mode.
And secondly, I was wondering how to change the background color to light?
I did try to click:
And copy the css to ~/Library/Mobile Documents/iCloud~md~obsidian/Documents/techs/.obsidian/snippets/prevew_md.css
I-d-as
November 30, 2021, 8:24am
2
@pvd I have some good news! At least that is how I interpreted it. There was some talk of this issue on Discord that sounded very promising:
Murf: But it sounds like you are saying the token classes are there that we could custom style ourselves anyways to try and match ourselves if we need to?
Licat: Yes I just need to match the tokens better
I am guessing that more and more of the syntax highlighting will show in Live Preview as versions progress, which will be awesome!
system
Closed
December 30, 2021, 8:25am
3
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.