cd demo
elm reactor
Demo will be available at http://localhost:8000/index.html
TODO
In the big picture, the process looks like this:
- Create a type for your language syntax.
- Make a parsing function that return a reverse list of
SyntaxHighlight.Language.Type.Token a
, with your created syntax type being thea
.- The
Normal
,LineBreak
andComment
types are already defined inSyntaxHighlight.Language.Type.Syntax
. You must parse all line breaks and give each one theLineBreak
syntax. - There is a bunch of helpers in
SyntaxHighlight.Language.Helpers
, but you are free to not use it.
- The
- Make a
syntaxToStyle
function that take your created syntax type and return a tuple containing aSyntaxHighlight.Style.Required
and a string unique for this syntax. The required style will be used when no specific style is defined for the syntax in the chosen theme. - Use the
SyntaxHighlight.Line.Helpers.toLines
to transform your reversed tokens andsyntaxToStyle
function into aList Line
. - Expose this function in the file
SyntaxHighlight.elm
. - Add the language in
SyntaxHighlight.Theme.Type.Syntax
.