swh.web.utils.highlightjs module#

swh.web.utils.highlightjs.get_hljs_language_from_filename(filename)[source]#

Function that tries to associate a language supported by highlight.js from a filename.

Parameters:

filename – input filename

Returns:

highlight.js language id or None if no correspondence has been found

swh.web.utils.highlightjs.get_hljs_language_from_mime_type(mime_type)[source]#

Function that tries to associate a language supported by highlight.js from a mime type.

Parameters:

mime_type – input mime type

Returns:

highlight.js language id or None if no correspondence has been found

swh.web.utils.highlightjs.get_supported_languages()[source]#

Return the list of programming languages that can be highlighted using the highlight.js library.

Returns:

the list of supported languages

Return type:

List[str]