Add --boilerplate Option
To simplify creating new langDefs, themes and plugins, Highlight CLI could have an option to output a boilerplate to start working from.
Something like:
--boilerplate=<type> <type> = [lang, theme, plugin]
... which should create in the current folder a boilerplate.lang
(or .theme
/.lua
) file with some basic skeleton of the required elements of the script.
Highlight could either store the boilerplates data inside the binary file (these should be down-to-the-basics skeleton files) or simply copy a boilerplate file from the installation folder.
For example, a theme boilerplate could look something like this:
Description = "Theme Boilerplate"
Canvas = { Colour = "#000000" }
Default = { Colour = "#FFFFFF" }
Number = { Colour = "#FFFFFF", Italic = false, Bold = false }
Escape = { Colour = "#FFFFFF", Italic = false, Bold = false }
String = { Colour = "#FFFFFF", Italic = false, Bold = false }
BlockComment = { Colour = "#FFFFFF", Italic = false, Bold = false }
StringPreProc = { Colour = "#FFFFFF", Italic = false, Bold = false }
LineComment = { Colour = "#FFFFFF", Italic = false, Bold = false }
Operator = { Colour = "#FFFFFF", Italic = false, Bold = false }
LineNum = { Colour = "#FFFFFF", Italic = false, Bold = false }
PreProcessor = { Colour = "#FFFFFF", Italic = false, Bold = false }
Interpolation = { Colour = "#FFFFFF", Italic = false, Bold = false }
Keywords = {
{ Colour = "#FFFFFF", Italic = false, Bold = false },
{ Colour = "#FFFFFF", Italic = false, Bold = false },
{ Colour = "#FFFFFF", Italic = false, Bold = false },
{ Colour = "#FFFFFF", Italic = false, Bold = false },
}
This would be quite useful to quickly create a theme from scratch, without having to open some theme as a reference (most users will be creating themes at large time intervals, and will probably forget all the required elements, but seeing this they'd quickly catch up).
Furthermore, some custom settings in Highlight configuration files (ie. in User folders) could allow to override the default boilerplates with customized versions, by pointing at some file/folder with user created boilerplate.*
files. Alternatively, the simple presence of such named files in some specific folders (eg. .highlight/
) could be auto-detected by Highlight to decide which bolierplate to produce. This would further improve the workflow as the highlight --boilerplate=
command could then be used anywhere to quickly generate a user defined template and get going with your favorite template.
Personally, every time I have to work on a new syntax or theme, I end up wasting a lot of time navigating through folders to find a copy of the boilerplate files that I've contributed to the extras
folder, or some other tweaked version which is stored somewhere else — not being the tidiest person on earth (my memory not being bullet-proof either), I often struggle to remember paths and what-is-where.