Availability |
Odoo Online
Odoo.sh
On Premise
|
Odoo Apps Dependencies |
•
Website (website)
• Discuss (mail) |
Community Apps Dependencies | Show |
Lines of code | 290 |
Technical Name |
website_snippet_code |
License | LGPL-3 |
Website | https://timefordev.com |
Availability |
Odoo Online
Odoo.sh
On Premise
|
Odoo Apps Dependencies |
•
Website (website)
• Discuss (mail) |
Community Apps Dependencies | Show |
Lines of code | 290 |
Technical Name |
website_snippet_code |
License | LGPL-3 |
Website | https://timefordev.com |
Website Snippet Code
Highlight blocks of code on your blog/website


Adds code highlight snippet. Uses highlight.js library for syntax highlighting. By default, snippet uses automatic syntax detection. So no need to specify which language is used (for supported syntaxes, see web_highlight module). This module was inspired by another module with same name (for older Odoo version)
Choose custom syntax to highlight
If needed, it is possible to force specify which syntax is used if for example, auto detection incorrectly guesses language (e.g. same block of code could be interpreted by different languages). To do that, there is snippet option Syntax, which allows to set wanted syntax. There is also possibility to disable highlighting (if needed for some reason), then simply select No Highlighting from a drop down.

Highlights code when in read mode

Code is highlighted in read mode only. After saving edited website page, it will refresh and code should become highlighted. When in edit mode, once snippet is clicked to edit, it will go in no highlight mode and will go back to highlight mode, once it is saved again (this is a limitation, how Odoo handles edited blocks, which clash with the way blocks are supposed to be highlighted/updated).
Please log in to comment on this module