-
-
Notifications
You must be signed in to change notification settings - Fork 737
Description
This module will provide a website snippet for code, complete with syntax highlighting. Something like what I have in my existing Wordpress with GeSHi:
The typical strategy for this is to pass the code data through a filter, such as Pygments, before displaying to the user. This will not work due to the way that Odoo snippets work, so we can consider that a bust.
Due to the aforementioned, my plan is to process the code client-side using something like HighlightJS. This should be as simple as creating the snippet targeting whatever class we decide to use as the code block.
The one problem that I am running into during the mental planning is the way that the widget option selectors work, which is as a series of dropdown items to allow dynamic configuration of the widget.
HighlightJS includes support for 172 languages & 77 styles, which will not fit into any sort of dropdown mechanism whatsoever.
It would be amazing if we could switch the dropdown mechanism for an input box instead, but I travelled fairly far down this rabbit hole during creation of website_snippet_data_slider to no avail.
In the data slider case, it was acceptable to leave the remaining options exposed only to developers due to the fact that the widget will likely only be used by devs. This widget is different, however, and will be used everywhere - my use case being blog. Due to this, I do not believe we can make this concession here.
As it stands, this RFC has two main questions:

