eyalroth
Forum Replies Created
-
Forum: Plugins
In reply to: [Prismatic] Support for Scala?@specialk Here’s a python script which generates all the
lang-x.jsfiles from a given directory ofprism-x.jsfiles (as they are in the prism.js repository). It also generates the “array” parts to be pasted in theresources-enqueue.phpfile:https://gist.github.com/eyalroth/20421d5ea04795db47a00f2837228ff9
Forum: Plugins
In reply to: [Prismatic] Support for Scala?@specialk Why would it require a massive amount of time?
Looks like the prism part of the plugin already follows the “file-per-language” structure, so it’s basically only a manner of adding the language’s file to
lib/prism/jsand including it ininc/resources-enqueue.js.I can tell that the plugin doesn’t automatically load dependency languages (for instance, for Scala that would be Java) and each language file must inline the code of the dependency language as well. I’m not a php / javascript programmer, but I would imagine it is possible to make the plugin automatically load the dependency languages; otherwise, it is possible to make a helper script that transforms the original language files to ones with the dependency languages inlined.
As for the plugin size – does it really matter if the plugin would weigh an extra MB? Obviously the plugin should not serve the entire language-set for every page, but only the relevant language-files. It already does so with prism.js, but with highlight.js it seems that the structure is different and includes all of the languages in one big file (
lib/highlight/js/highlight-core.js). I guess it’s possible to transform this part of the plugin to work with “file-per-language” structure as well?- This reply was modified 7 years, 3 months ago by eyalroth.