Is it possible to display a Python code snippet or MathML? I was trying the Code Widget from the Bric Library. But it isn’t working.
Do any of you have any ideas or can you help me? Thank you very much.
Is it possible to display a Python code snippet or MathML? I was trying the Code Widget from the Bric Library. But it isn’t working.
Do any of you have any ideas or can you help me? Thank you very much.
I found this solution for a python code snippet:
Translate Python Code in a HTML Code on this Source code beautifier / syntax highlighter – convert code snippets to HTML
Insert in Blocs a Code Widget with the HTML-Code
After Preview in Browser (⌥⌘B) it looks like this (that’s what I like):
But, if I export my project with these settings:
And copy it to my FTP, it looks like this (that’s not what I like):
Has anybody an idea? Thank you very much.
Try switching off preview in app. Checkbox in the sidebar when code snippet is selected.
Thank you for help @Norm.
I was trying your suggestion. But it’s the same, with the Preview in Browser it works fine but not with my Webspace.
In the meantime I found a Online LaTeX Equation Editor - create, integrate and download. But it only works if I leave the preview checkbox on for the Code Widget.
But if I copy the full code from the HTML-File und paste it in a Code Widget. It’s only working in Preview in Browser (⌥⌘B). If I export my project and upload it to my Server the line break is missing.
Here is the Blocs-File, HTML-File from Jupyter:
data.zip (245.0 KB)
Maybe someone can help. Thank you very much.
Okay, I was trying this one: https://highlightjs.org - data.bloc (719.4 KB)
But this doesn’t work either.
It seems as if Blocs uses a global CSS, which partially overrides the formatting of the code widget. I have no idea what I need to do, to change or solve this.
My understanding from your original file is that the Code Widget should contain plain HTML while yours is packed with the CSS styling which in turn should be either added as an extra css file or copied into the Page settings under add code (Head section).
MDS
try the following.
Simply switching to none preview mode may not fix the issue, it be require the code re-pasted in after the widget is set to not preview in app. This in theory should protect the code.
Thank you @MDS and @Norm for your help. At the moment I try @Norm suggestion but it isn’t working. I was following your route and did it in fresh Blocs-Project. It’s the same, the line break isn’t working.
In the next step I will try @MDS suggestion
Also switch off minifying of HTML.
@Norm you are awsome. Thank you very much. This is the solution for me ==> switch off minifying of HTML