ghc-syntax-highlighter alternatives and similar packages
Based on the "Text" category.
Alternatively, view ghc-syntax-highlighter alternatives based on common mentions on social networks and blogs.
-
pandoc-crossref
Pandoc filter for cross-references -
pandoc-citeproc
Library and executable for using citeproc with pandoc -
texmath
A Haskell library for converting LaTeX math to MathML. -
scholdoc
Fork of Pandoc for the implementation of a ScholarlyMarkdown parser -
yst
create static websites from YAML data and string templates -
prettyprinter
A modern, extensible and well-documented prettyprinter. -
skylighting
A Haskell syntax highlighting library with tokenizers derived from KDE syntax highlighting descriptions -
blaze-from-html
A blazingly fast HTML combinator library for Haskell. -
pandoc-types
types for representing structured documents -
commonmark
Pure Haskell commonmark parsing library, designed to be flexible and extensible -
arx
Bundles code and a job to run for local or remote execution. -
regex-genex
Given a list of regexes, generate all possible strings that matches all of them. -
text-offset
Emits code crossreference data for Haskell sources. -
regex-applicative
Regex-based parsing with an applicative interface -
pandoc-csv2table
A Pandoc filter that renders CSV as Pandoc Markdown Tables. -
pretty-show
Tools for working with derived Show instances in Haskell. -
servant-checked-exceptions
type-level errors for Servant APIs. -
double-conversion
A fast Haskell library for converting between double precision floating point numbers and text strings. It is implemented as a binding to the V8-derived C++ double-conversion library. -
text-format
A Haskell text formatting library optimized for ease of use and high performance. -
email-validate
Email address validation for Haskell -
diagrams-pandoc
A pandoc filter to express diagrams inline using the haskell EDSL diagrams. -
feed
Haskell package for handling various feed (RSS) formats. -
boxes
A pretty-printing library for laying out text in two dimensions, using a simple box model. -
marked-pretty
Pretty-printing library, with scoping.
Static code analysis for 29 languages.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of ghc-syntax-highlighter or a related project?
README
GHC syntax highligher
This is a syntax highlighter library for Haskell using lexer of GHC itself.
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 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 all licence references and agreements mentioned in the ghc-syntax-highlighter README section above
are relevant to that project's source code only.