Skip to content

hoosierEE/pygments-elm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PYGMENTS-ELM

An Elm lexer for pygments

Elm source code can be highlighted with some success by existing lexers for Haskell, but there are enough features to warrant its own lexer, I think. This is especially true for some of the F#-inspired syntax (|>) and some often-used standard library functions like foldp and <~.

EDIT There's already an issue open for this at pygments, but no existing lexer yet.

Status

  • operators - done. needs to be checked and possibly updated as Elm matures
  • standard libraries - not implemented
  • markdown blocks - partial support. currently treated as a string
  • string escapes - not implemented
  • webgl blocks - not implemented
  • other blocks - not implemented

Hacking on the Lexer (with Vim)

Put this at the bottom of your .vimrc, to quickly update the lexer and apply the changes to the example file:

" update Pygments lexer
nnoremap <Leader>a :call LexerUpdate()<CR>
function! LexerUpdate()
    :silent execute "!./updateLexer elm.py"
    :redraw!
endfunction

...then, go to your browser and refresh to see the changes.

Contributing

Fork & Pull!

About

pygments needs a lexer for the Elm language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published