Website Snippet Codeby Andrius Laukavičius https://timefordev.com
highlight.js library (98 lines of code)
|Lines of code||290|
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
- The author can leave a single reply to each comment.
- This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
- If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.