Code Display
Permalink
Hi,
I've got a problem with the "Code Display" Block : I can paste code into it but when I close the Block editor no code is visible in my page (Concrete5 8.3.2).
Thanks
Vincent Le Mieux
I've got a problem with the "Code Display" Block : I can paste code into it but when I close the Block editor no code is visible in my page (Concrete5 8.3.2).
Thanks
Vincent Le Mieux
Thanks for your answer !
The code is located at the end of this page (approved) :http://laboiteaphysique.fr/site2/index.php/programmation-et-logicie...
As you can see, there only one line and it stayed blank.
Two attached files with this message :
code_display_1.png where you can see the edition
code_display_2.png after closing the edition mode of the block
The code is located at the end of this page (approved) :http://laboiteaphysique.fr/site2/index.php/programmation-et-logicie...
As you can see, there only one line and it stayed blank.
Two attached files with this message :
code_display_1.png where you can see the edition
code_display_2.png after closing the edition mode of the block
The theme is "Cloneamental"
Vincent
Vincent
As an alternative, if you have a lot of code snippets to display, have a look at my Syntax Anywhere addon:
https://www.concrete5.org/marketplace/addons/syntax-anywhere1/...
https://www.concrete5.org/marketplace/addons/syntax-anywhere1/...
Thanks for the information.
Doest it works with language like C, Python, Assembler ?
Vincent
Doest it works with language like C, Python, Assembler ?
Vincent
It uses 3rd party plugins that auto-detect languages. Yes to C and Python. I have not tried with any assembler. Highlight lists some assemblers. Prettify doesn't and the docs suggest its limited to structured languages.
Highlight
https://github.com/isagalaev/highlight.js/tree/master/src/languages...
(all built in, included up to data of last addon update)
Prettify
https://github.com/google/code-prettify...
(see basic list in readme)
The architecture is pluggable, so (for example), the prettify plugin could be cloned and modified to pull in some of the optional languages.
Highlight
https://github.com/isagalaev/highlight.js/tree/master/src/languages...
(all built in, included up to data of last addon update)
Prettify
https://github.com/google/code-prettify...
(see basic list in readme)
The architecture is pluggable, so (for example), the prettify plugin could be cloned and modified to pull in some of the optional languages.
I ran some experiments, screenshot attached, using prettify/vibrant ink.
(edit : C5.org has resized it, I have added it to the screenshots on the addon pages and to the end of thedocs page. If you right click, open image in new tab, then ctl+ to zoom you can read it better)
(edit : C5.org has resized it, I have added it to the screenshots on the addon pages and to the end of thedocs page. If you right click, open image in new tab, then ctl+ to zoom you can read it better)
Assembler is highlighted, but doesn't appear to connect to the actual syntax. A little bit random.
Thanks for your help Jonathan.
I'll try to fix the problem with Code Display, because I've been using it many time in the older version of Concrete5 (5.6) and because I prefer a specific block for codes that I want to give on my site.
If it's not possible your solution could be mine.
Best regards
Vincent
I'll try to fix the problem with Code Display, because I've been using it many time in the older version of Concrete5 (5.6) and because I prefer a specific block for codes that I want to give on my site.
If it's not possible your solution could be mine.
Best regards
Vincent
Syntax anywhere also includes a template for an html block, specially for situations that need to be hard-delimited.
If you inspect the page is the block there?
What theme are you using?