All Projects → mrkkrp → ghc-syntax-highlighter

mrkkrp / ghc-syntax-highlighter

Licence: other
Syntax highlighter for Haskell using the lexer of GHC

Programming Languages

haskell
3896 projects

Projects that are alternatives of or similar to ghc-syntax-highlighter

colorstorm
A color theme generator for editors and terminal emulators
Stars: ✭ 101 (+83.64%)
Mutual labels:  syntax-highlighting
SmartVHDL
SublimeText Plugin for VHDL (highlight, autocompletion, navigation, ...)
Stars: ✭ 12 (-78.18%)
Mutual labels:  syntax-highlighting
GDL-sublime
📝 A Sublime Text package for the programming language GDL (Geometric Description Language)
Stars: ✭ 25 (-54.55%)
Mutual labels:  syntax-highlighting
vscode-fanuc-karel
Syntax Highligting for Fanuc Karel in Visual Studio Code
Stars: ✭ 21 (-61.82%)
Mutual labels:  syntax-highlighting
jai.vim
Vim syntax highlighting for Jai programming language. I am planning to maintain and update this package when the language is released
Stars: ✭ 35 (-36.36%)
Mutual labels:  syntax-highlighting
core
🌈 light, fast, and easy to use, dependencies free javascript syntax highlighter, with automatic language detection
Stars: ✭ 40 (-27.27%)
Mutual labels:  syntax-highlighting
joe-syntax
JOE (Joe's Own Editor) syntax coloring and highlighting files - improved ones
Stars: ✭ 53 (-3.64%)
Mutual labels:  syntax-highlighting
highlight.dart
Syntax highlighting for Dart and Flutter
Stars: ✭ 145 (+163.64%)
Mutual labels:  syntax-highlighting
nanorc
🔧 🎨 Some syntax highlighting files for the GNU/Nano editor 📝 https://nano-editor.org/
Stars: ✭ 20 (-63.64%)
Mutual labels:  syntax-highlighting
torchlight-laravel
A Laravel client for Torchlight - the syntax highlighting API.
Stars: ✭ 64 (+16.36%)
Mutual labels:  syntax-highlighting
todo-txt
Todo.txt syntax highlighter and helper extension for visual studio code.
Stars: ✭ 39 (-29.09%)
Mutual labels:  syntax-highlighting
Sublime-QML
QML support for Sublime Text 2 and Sublime Text 3
Stars: ✭ 19 (-65.45%)
Mutual labels:  syntax-highlighting
ST-ShellScriptImproved
❌ [Deprecated] A better ShellScript (Bash) syntax highlight for Sublime Text >= 3143
Stars: ✭ 25 (-54.55%)
Mutual labels:  syntax-highlighting
Nineties
💾 Colors for World Wide Web pioneers
Stars: ✭ 16 (-70.91%)
Mutual labels:  syntax-highlighting
ghc-exactprint
GHC version of haskell-src-exts exactPrint
Stars: ✭ 59 (+7.27%)
Mutual labels:  ghc
markcat
👓 Markdown files terminal viewer.
Stars: ✭ 33 (-40%)
Mutual labels:  syntax-highlighting
prism
🧛🏻‍♂️ Dark theme for Prism.js
Stars: ✭ 33 (-40%)
Mutual labels:  syntax-highlighting
Kung-Fury-Theme
80's dark retro theme for VS Code and Sublime Text
Stars: ✭ 29 (-47.27%)
Mutual labels:  syntax-highlighting
vscode-ampscript
This extension allows you to connect Visual Studio Code directly to your MC Account, enables syntax highlighting for AMPScript, has built-in documentation for all AMPScript functions and also adds code snippets for language elements and functions.
Stars: ✭ 37 (-32.73%)
Mutual labels:  syntax-highlighting
vscode-angular-html
Angular syntax highlighting for HTML templates
Stars: ✭ 35 (-36.36%)
Mutual labels:  syntax-highlighting

GHC syntax highligher

License FreeBSD Hackage Stackage Nightly Stackage LTS CI

This is a syntax highlighter library for Haskell using the lexer of GHC.

Here is a blog post announcing the package, the readme is mostly derived from it:

Motivation

Parsing Haskell is hard, because Haskell is a complex language with countless features. The only way to get it right 100% is to use the parser of GHC itself. Fortunately, now there is the ghc package, which as of version 8.4.1 exports enough of GHC's source code to allow us use its lexer.

Alternative approaches, even decent ones like highlight.js either don't support cutting-edge features or do their work without sufficient precision so that many tokens end up combined and the end result is typically still hard to read.

How to use it in your blog

Depends on your markdown processor. If you're an mmark user, good news, since version 0.2.1.0 of mmark-ext it includes the ghcSyntaxHighlighter extension. Due to flexibility of MMark, it's possible to use this highlighter for Haskell and skylighting as a fall-back for everything else. Consult the docs for more information.

skylighting is what Pandoc uses. And from what I can tell it's hardcoded to use only that library for highlighting, so some creativity may be necessary to get it work.

Limitations

CPP directives are not lexed correctly, because the GHC parser is not designed to parse them.

Contribution

Issues, bugs, and questions may be reported in the GitHub issue tracker for this project.

Pull requests are also welcome.

License

Copyright © 2018–present Mark Karpov

Distributed under BSD 3 clause license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].