diff --git a/.gitignore b/.gitignore index 9836bb8b5..2688a7b5f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,8 @@ +dist-newstyle +dist .stack-work src/Skylighting/Syntax.hs src/Skylighting/Syntax/*.hs skylighting.cabal.orig +.*.swp +syntax-highlighting diff --git a/.travis.yml b/.travis.yml index 2bb9fabe5..bbbddf972 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,9 +31,6 @@ matrix: include: # We grab the appropriate GHC and cabal-install versions from hvr's PPA. See: # https://github.com/hvr/multi-ghc-travis - - env: BUILD=cabal GHCVER=7.8.4 CABALVER=1.18 - compiler: ": #GHC 7.8.4" - addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4,happy-1.19.5], sources: [hvr-ghc]}} - env: BUILD=cabal GHCVER=7.10.3 CABALVER=1.24 compiler: ": #GHC 7.10.3" addons: {apt: {packages: [cabal-install-1.24,ghc-7.10.3,happy-1.19.5], sources: [hvr-ghc]}} diff --git a/Makefile b/Makefile index 798b18f0f..bb08a17fd 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,3 @@ -#XMLS=haskell.xml cmake.xml diff.xml hamlet.xml alert.xml modelines.xml c.xml doxygen.xml -XMLS=$(wildcard xml/*.xml) - quick: stack install --test --flag "skylighting:executable" --test-arguments '--hide-successes $(TESTARGS)' @@ -10,17 +7,29 @@ test: bench: stack bench --flag 'skylighting:executable' -format: +format: skylighting-format skylighting-core-format + +skylighting-core-format: + stylish-haskell -i -c .stylish-haskell \ + skylighting-core/bin/*.hs \ + skylighting-core/test/test-skylighting.hs \ + skylighting-core/benchmark/benchmark.hs \ + skylighting-core/Setup.hs \ + skylighting-core/src/Skylighting/*.hs \ + skylighting-core/src/Skylighting/Format/*.hs + +skylighting-format: stylish-haskell -i -c .stylish-haskell \ - bin/*.hs test/test-skylighting.hs benchmark/benchmark.hs \ - prelude/Prelude.hs Setup.hs \ - src/Skylighting/*.hs src/Skylighting/Format/*.hs src/Skylighting.hs + skylighting/bin/*.hs \ + skylighting/Setup.hs \ + skylighting/src/Skylighting.hs +XMLS=$(wildcard skylighting-core/xml/*.xml) bootstrap: $(XMLS) - -rm -rf src/Skylighting/Syntax src/Skylighting/Syntax.hs - stack install --flag "skylighting:bootstrap" --fast --no-test --no-bench - skylighting-extract $(XMLS) - stack install --flag "skylighting:-bootstrap" --flag "skylighting:executable" --test --test-arguments '--hide-successes $(TESTARGS)' --fast + -rm -rf skylighting/src/Skylighting/Syntax skylighting/src/Skylighting/Syntax.hs + cd skylighting && skylighting-extract ../skylighting-core/xml/*.xml + stack install --flag "skylighting:executable" --test --test-arguments \ + '--hide-successes $(TESTARGS)' --fast syntax-highlighting: git clone https://github.com/KDE/syntax-highlighting @@ -28,8 +37,8 @@ syntax-highlighting: update-xml: syntax-highlighting cd syntax-highlighting; \ git pull; \ - cd ../xml; \ - for x in *.xml; do cp ../syntax-highlighting/data/syntax/$$x ./; done ; \ + cd ../skylighting-core/xml; \ + for x in *.xml; do cp ../../syntax-highlighting/data/syntax/$$x ./; done ; \ for x in *.xml.patch; do patch < $$x; done clean: diff --git a/README.md b/README.md deleted file mode 100644 index 32731ae71..000000000 --- a/README.md +++ /dev/null @@ -1,98 +0,0 @@ -skylighting -=========== - -[![license](https://img.shields.io/badge/license-GPLv2+-brightgreen.svg)](https://www.gnu.org/licenses/gpl.html) -[![travis build status](https://img.shields.io/travis/jgm/skylighting.svg)](https://travis-ci.org/jgm/skylighting) - -A Haskell syntax highlighting library with tokenizers derived -from KDE XML syntax highlighting descriptions. - -A command-line highlighter, `skylighting`, is also provided. - -Motivation ----------- - -This library is the successor to [highlighting-kate], which had -some problems that were difficult to resolve given its -architecture. - -In highlighting-kate, the XML syntax descriptions were converted -into individual parsec parsers, which were then compiled. This -made it difficult to handle IncludeRules properly without -circular imports. There was also no way to load a syntax -description dynamically. - -Skylighting, by contrast, parses the XML syntax descriptions -into Haskell data structures, which are then interpreted by -a "tokenize" function. IncludeRules can now be handled -properly, and users can add new syntax descriptions -dynamically. It is also now possible to convert `.theme` files -directly into styles. - -Skylighting is also faster than highlighting-kate, by a -factor of 3 in some cases. - -Installing ----------- - -To install the latest release from Hackage, do - - stack install skylighting -or - - cabal install skylighting - -If you want the command-line tool, set the `executable` flag -using `--flag "skylighting:executable"` in stack or -`-fexecutable` in cabal. - -The release tarballs include generated files not present in this -repository. Building from this repository is a two-step -process. In the first step we build a program, -`skylighting-extract`, which reads XML syntax highlighting -definitions from the `xml` directory and writes Haskell source -files. In the second we actually build the library. - -Using cabal: - - cabal install -fbootstrap --disable-optimization - cabal run skylighting-extract -- xml/*.xml - cabal install -f-bootstrap - -Command-line tool ------------------ - -A command-line executable, `skylighting`, is installed if -the `executable` cabal flag is set in building. - -For help, `skylighting --help`. - -Adding new syntaxes -------------------- - -To compile with additional syntaxes, simply add the syntax -definition (XML) file to the `xml` directory and repeat the -bootstrap build described above. - -Note that both the library and the executable can dynamically -load syntax definitions, so you may not need to compile them -in. - -License -------- - -Skylighting is licensed under the GPL, because some of the xml -syntax descriptions from which its tokenizers are generated are -GPL-licensed. - -References ----------- - -Kate syntax highlighting documentation: - - -Kate highlighting definitions: - - -[highlighting-kate]: https://github.com/jgm/highlighting-kate - diff --git a/README.md b/README.md new file mode 120000 index 000000000..19144cb57 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +skylighting/README.md \ No newline at end of file diff --git a/TODO b/TODO deleted file mode 100644 index 0d9e19bd4..000000000 --- a/TODO +++ /dev/null @@ -1,12 +0,0 @@ -_ include a basic example of use in main module - -_ proper tests - _ test formatters - _ hpc coverage stats? - -_ publish to Hackage - -_ change to use this in pandoc - -_ add deprecation notice on jgm/highlighting-kate and Hackage - diff --git a/prelude/Prelude.hs b/prelude/Prelude.hs deleted file mode 100644 index d6454d5c4..000000000 --- a/prelude/Prelude.hs +++ /dev/null @@ -1,26 +0,0 @@ -{-# LANGUAGE CPP #-} -{-# LANGUAGE PackageImports #-} - --- This custom Prelude emulates the API of the prelude --- with base 4.8. - -module Prelude -( - module P -#if MIN_VERSION_base(4,8,0) -#else -, Monoid(..) -, Applicative(..) -, (<$>) -, (<$) -#endif -) -where - -#if MIN_VERSION_base(4,8,0) -import "base" Prelude as P -#else -import Control.Applicative -import Data.Monoid -import "base" Prelude as P -#endif diff --git a/skylighting-core/LICENSE b/skylighting-core/LICENSE new file mode 100644 index 000000000..3911efee6 --- /dev/null +++ b/skylighting-core/LICENSE @@ -0,0 +1,30 @@ +Copyright (c) 2016-2018, John MacFarlane. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * The names of the contributors may not be used to endorse or + promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/skylighting-core/README.md b/skylighting-core/README.md new file mode 100644 index 000000000..c09ea1f47 --- /dev/null +++ b/skylighting-core/README.md @@ -0,0 +1,17 @@ +skylighting-core +================ + +[![license](https://img.shields.io/badge/license-BSD3-brightgreen.svg)](https://opensource.org/licenses/BSD-3-Clause) +[![skylighting-core build status](https://img.shields.io/travis/jgm/skylighting-core.svg)](https://travis-ci.org/jgm/skylighting-core) + +This package provides the core functionality of the Skylighting project, +a Haskell syntax highlighting library with support for KDE XML syntax +highlighting descriptions. + +For details on how to use this package, see the Haddock documentation and +the [Skylighting README](https://github.com/jgm/skylighting/blob/master/skylighting/README.md). + +The Haskell code and related files in this package are licensed under +the BSD3 license. This package also includes KDE XML syntax definitions +which are provided under various licenses; see the XML files for +details. diff --git a/Setup.hs b/skylighting-core/Setup.hs similarity index 100% rename from Setup.hs rename to skylighting-core/Setup.hs diff --git a/benchmark/benchmark.hs b/skylighting-core/benchmark/benchmark.hs similarity index 100% rename from benchmark/benchmark.hs rename to skylighting-core/benchmark/benchmark.hs diff --git a/bin/extract.hs b/skylighting-core/bin/extract.hs similarity index 100% rename from bin/extract.hs rename to skylighting-core/bin/extract.hs diff --git a/changelog.md b/skylighting-core/changelog.md similarity index 100% rename from changelog.md rename to skylighting-core/changelog.md diff --git a/skylighting-core/skylighting-core.cabal b/skylighting-core/skylighting-core.cabal new file mode 100644 index 000000000..1574f702a --- /dev/null +++ b/skylighting-core/skylighting-core.cabal @@ -0,0 +1,212 @@ +name: skylighting-core +version: 0.6 +synopsis: syntax highlighting library +description: Skylighting is a syntax highlighting library. + It derives its tokenizers from XML syntax + definitions used by KDE's KSyntaxHighlighting + framework, so any syntax supported by that + framework can be added. An optional command-line + program is provided. + + Skylighting is intended to be the successor to + highlighting-kate. + + This package provides the core highlighting + functionality under a permissive license. It also + bundles XML parser definitions licensed under the + GPL. + +homepage: https://github.com/jgm/skylighting +license: BSD3 +license-file: LICENSE +author: John MacFarlane +maintainer: jgm@berkeley.edu +copyright: (C) 2016-2018 John MacFarlane +category: Text +build-type: Simple +extra-source-files: README.md + changelog.md + xml/*.xml + xml/language.dtd + test/default.theme + test/cases/abc.ada + test/cases/abc.agda + test/cases/abc.c + test/cases/abc.clojure + test/cases/abc.cpp + test/cases/abc.cs + test/cases/abc.d + test/cases/abc.fortran + test/cases/abc.go + test/cases/abc.haskell + test/cases/abc.java + test/cases/abc.javascript + test/cases/abc.julia + test/cases/abc.kotlin + test/cases/abc.lisp + test/cases/abc.matlab + test/cases/abc.ocaml + test/cases/abc.perl + test/cases/abc.php + test/cases/abc.prolog + test/cases/abc.python + test/cases/abc.r + test/cases/abc.ruby + test/cases/abc.scala + test/cases/abc.scheme + test/cases/abc.tcl + test/cases/archive.rhtml + test/cases/life.lua + test/cases/hk91.html + test/cases/if.cmake + test/expected/abc.ada.native + test/expected/abc.agda.native + test/expected/abc.c.native + test/expected/abc.clojure.native + test/expected/abc.cpp.native + test/expected/abc.cs.native + test/expected/abc.d.native + test/expected/abc.fortran.native + test/expected/abc.go.native + test/expected/abc.haskell.native + test/expected/abc.java.native + test/expected/abc.javascript.native + test/expected/abc.julia.native + test/expected/abc.kotlin.native + test/expected/abc.lisp.native + test/expected/abc.matlab.native + test/expected/abc.ocaml.native + test/expected/abc.perl.native + test/expected/abc.php.native + test/expected/abc.prolog.native + test/expected/abc.python.native + test/expected/abc.r.native + test/expected/abc.ruby.native + test/expected/abc.scala.native + test/expected/abc.scheme.native + test/expected/abc.tcl.native + test/expected/archive.rhtml.native + test/expected/life.lua.native + test/expected/hk91.html.native + test/expected/if.cmake.native + +cabal-version: >=1.10 + +source-repository head + type: git + location: https://github.com/jgm/skylighting.git + +library + exposed-modules: Skylighting.Core + Skylighting.Types + Skylighting.Regex + Skylighting.Parser + Skylighting.Styles + Skylighting.Tokenizer + Skylighting.Format.ANSI + Skylighting.Format.HTML + Skylighting.Format.LaTeX + other-extensions: CPP, Arrows + build-depends: base >= 4.7 && < 5.0, + mtl, + text, + binary, + bytestring, + directory, + filepath, + aeson >= 1.0, + case-insensitive, + attoparsec, + utf8-string, + hxt, + safe, + base64-bytestring, + blaze-html >= 0.5, + containers, + ansi-terminal >= 0.7, + colour >= 2.0 + if flag(system-pcre) + build-depends: regex-pcre + else + build-depends: regex-pcre-builtin + hs-source-dirs: src + ghc-prof-options: -fprof-auto-exported + default-language: Haskell2010 + ghc-options: -Wall + +Flag executable + Description: Build skylighting CLI tools + Default: False + +Flag system-pcre + Description: Use regex-pcre instead of regex-pcre-builtin + Default: False + +test-suite test-skylighting + type: exitcode-stdio-1.0 + main-is: test-skylighting.hs + hs-source-dirs: test + build-depends: base >= 4.7 && < 5.0, + HUnit, + tasty, + tasty-golden, + tasty-hunit, + tasty-quickcheck, + QuickCheck, + containers, + random, + Diff, + text, + pretty-show, + aeson >= 1.0, + bytestring, + directory, + filepath, + skylighting-core + default-language: Haskell2010 + ghc-options: -Wall + +benchmark benchmark-skylighting + Type: exitcode-stdio-1.0 + Main-Is: benchmark.hs + Hs-Source-Dirs: benchmark + Build-Depends: skylighting-core, + base >= 4.2 && < 5, + filepath, + text, + containers, + directory, + criterion >= 1.0 && < 1.4 + Ghc-Options: -rtsopts -Wall -fno-warn-unused-do-bind + Default-Language: Haskell2010 + +executable skylighting-extract + build-depends: base >= 4.7 && < 5.0, + skylighting-core, + filepath, + bytestring, + base64-bytestring, + text, + safe, + hxt, + utf8-string, + case-insensitive, + aeson >= 1.0, + binary, + containers, + directory, + ansi-terminal >= 0.7, + colour >= 2.0 + if flag(system-pcre) + build-depends: regex-pcre + else + build-depends: regex-pcre-builtin + if flag(executable) + buildable: True + else + buildable: False + hs-source-dirs: bin + main-is: extract.hs + default-language: Haskell2010 + other-extensions: CPP + ghc-options: -Wall diff --git a/src/Skylighting.hs b/skylighting-core/src/Skylighting/Core.hs similarity index 97% rename from src/Skylighting.hs rename to skylighting-core/src/Skylighting/Core.hs index 56aff2053..32c1b4ad3 100644 --- a/src/Skylighting.hs +++ b/skylighting-core/src/Skylighting/Core.hs @@ -1,4 +1,4 @@ -module Skylighting ( +module Skylighting.Core ( lookupSyntax , syntaxByName , syntaxByShortName @@ -8,7 +8,6 @@ module Skylighting ( , module Skylighting.Tokenizer , module Skylighting.Parser , module Skylighting.Regex - , module Skylighting.Syntax , module Skylighting.Styles , module Skylighting.Format.ANSI , module Skylighting.Format.HTML @@ -26,7 +25,6 @@ import Skylighting.Format.LaTeX import Skylighting.Parser import Skylighting.Regex import Skylighting.Styles -import Skylighting.Syntax import Skylighting.Tokenizer import Skylighting.Types diff --git a/src/Skylighting/Format/ANSI.hs b/skylighting-core/src/Skylighting/Format/ANSI.hs similarity index 100% rename from src/Skylighting/Format/ANSI.hs rename to skylighting-core/src/Skylighting/Format/ANSI.hs diff --git a/src/Skylighting/Format/HTML.hs b/skylighting-core/src/Skylighting/Format/HTML.hs similarity index 100% rename from src/Skylighting/Format/HTML.hs rename to skylighting-core/src/Skylighting/Format/HTML.hs diff --git a/src/Skylighting/Format/LaTeX.hs b/skylighting-core/src/Skylighting/Format/LaTeX.hs similarity index 100% rename from src/Skylighting/Format/LaTeX.hs rename to skylighting-core/src/Skylighting/Format/LaTeX.hs diff --git a/src/Skylighting/Parser.hs b/skylighting-core/src/Skylighting/Parser.hs similarity index 100% rename from src/Skylighting/Parser.hs rename to skylighting-core/src/Skylighting/Parser.hs diff --git a/src/Skylighting/Regex.hs b/skylighting-core/src/Skylighting/Regex.hs similarity index 100% rename from src/Skylighting/Regex.hs rename to skylighting-core/src/Skylighting/Regex.hs diff --git a/src/Skylighting/Styles.hs b/skylighting-core/src/Skylighting/Styles.hs similarity index 100% rename from src/Skylighting/Styles.hs rename to skylighting-core/src/Skylighting/Styles.hs diff --git a/src/Skylighting/Syntax.hs.bootstrap b/skylighting-core/src/Skylighting/Syntax.hs.bootstrap similarity index 100% rename from src/Skylighting/Syntax.hs.bootstrap rename to skylighting-core/src/Skylighting/Syntax.hs.bootstrap diff --git a/src/Skylighting/Tokenizer.hs b/skylighting-core/src/Skylighting/Tokenizer.hs similarity index 100% rename from src/Skylighting/Tokenizer.hs rename to skylighting-core/src/Skylighting/Tokenizer.hs diff --git a/src/Skylighting/Types.hs b/skylighting-core/src/Skylighting/Types.hs similarity index 100% rename from src/Skylighting/Types.hs rename to skylighting-core/src/Skylighting/Types.hs diff --git a/test/cases/abc.ada b/skylighting-core/test/cases/abc.ada similarity index 100% rename from test/cases/abc.ada rename to skylighting-core/test/cases/abc.ada diff --git a/test/cases/abc.agda b/skylighting-core/test/cases/abc.agda similarity index 100% rename from test/cases/abc.agda rename to skylighting-core/test/cases/abc.agda diff --git a/test/cases/abc.c b/skylighting-core/test/cases/abc.c similarity index 100% rename from test/cases/abc.c rename to skylighting-core/test/cases/abc.c diff --git a/test/cases/abc.clojure b/skylighting-core/test/cases/abc.clojure similarity index 100% rename from test/cases/abc.clojure rename to skylighting-core/test/cases/abc.clojure diff --git a/test/cases/abc.cpp b/skylighting-core/test/cases/abc.cpp similarity index 100% rename from test/cases/abc.cpp rename to skylighting-core/test/cases/abc.cpp diff --git a/test/cases/abc.cs b/skylighting-core/test/cases/abc.cs similarity index 100% rename from test/cases/abc.cs rename to skylighting-core/test/cases/abc.cs diff --git a/test/cases/abc.d b/skylighting-core/test/cases/abc.d similarity index 100% rename from test/cases/abc.d rename to skylighting-core/test/cases/abc.d diff --git a/test/cases/abc.elixir b/skylighting-core/test/cases/abc.elixir similarity index 100% rename from test/cases/abc.elixir rename to skylighting-core/test/cases/abc.elixir diff --git a/test/cases/abc.fortran b/skylighting-core/test/cases/abc.fortran similarity index 100% rename from test/cases/abc.fortran rename to skylighting-core/test/cases/abc.fortran diff --git a/test/cases/abc.go b/skylighting-core/test/cases/abc.go similarity index 100% rename from test/cases/abc.go rename to skylighting-core/test/cases/abc.go diff --git a/test/cases/abc.haskell b/skylighting-core/test/cases/abc.haskell similarity index 100% rename from test/cases/abc.haskell rename to skylighting-core/test/cases/abc.haskell diff --git a/test/cases/abc.idris b/skylighting-core/test/cases/abc.idris similarity index 100% rename from test/cases/abc.idris rename to skylighting-core/test/cases/abc.idris diff --git a/test/cases/abc.java b/skylighting-core/test/cases/abc.java similarity index 100% rename from test/cases/abc.java rename to skylighting-core/test/cases/abc.java diff --git a/test/cases/abc.javascript b/skylighting-core/test/cases/abc.javascript similarity index 100% rename from test/cases/abc.javascript rename to skylighting-core/test/cases/abc.javascript diff --git a/test/cases/abc.julia b/skylighting-core/test/cases/abc.julia similarity index 100% rename from test/cases/abc.julia rename to skylighting-core/test/cases/abc.julia diff --git a/test/cases/abc.kotlin b/skylighting-core/test/cases/abc.kotlin similarity index 100% rename from test/cases/abc.kotlin rename to skylighting-core/test/cases/abc.kotlin diff --git a/test/cases/abc.lisp b/skylighting-core/test/cases/abc.lisp similarity index 100% rename from test/cases/abc.lisp rename to skylighting-core/test/cases/abc.lisp diff --git a/test/cases/abc.matlab b/skylighting-core/test/cases/abc.matlab similarity index 100% rename from test/cases/abc.matlab rename to skylighting-core/test/cases/abc.matlab diff --git a/test/cases/abc.ocaml b/skylighting-core/test/cases/abc.ocaml similarity index 100% rename from test/cases/abc.ocaml rename to skylighting-core/test/cases/abc.ocaml diff --git a/test/cases/abc.perl b/skylighting-core/test/cases/abc.perl similarity index 100% rename from test/cases/abc.perl rename to skylighting-core/test/cases/abc.perl diff --git a/test/cases/abc.php b/skylighting-core/test/cases/abc.php similarity index 100% rename from test/cases/abc.php rename to skylighting-core/test/cases/abc.php diff --git a/test/cases/abc.prolog b/skylighting-core/test/cases/abc.prolog similarity index 100% rename from test/cases/abc.prolog rename to skylighting-core/test/cases/abc.prolog diff --git a/test/cases/abc.python b/skylighting-core/test/cases/abc.python similarity index 100% rename from test/cases/abc.python rename to skylighting-core/test/cases/abc.python diff --git a/test/cases/abc.r b/skylighting-core/test/cases/abc.r similarity index 100% rename from test/cases/abc.r rename to skylighting-core/test/cases/abc.r diff --git a/test/cases/abc.ruby b/skylighting-core/test/cases/abc.ruby similarity index 100% rename from test/cases/abc.ruby rename to skylighting-core/test/cases/abc.ruby diff --git a/test/cases/abc.scala b/skylighting-core/test/cases/abc.scala similarity index 100% rename from test/cases/abc.scala rename to skylighting-core/test/cases/abc.scala diff --git a/test/cases/abc.scheme b/skylighting-core/test/cases/abc.scheme similarity index 100% rename from test/cases/abc.scheme rename to skylighting-core/test/cases/abc.scheme diff --git a/test/cases/abc.tcl b/skylighting-core/test/cases/abc.tcl similarity index 100% rename from test/cases/abc.tcl rename to skylighting-core/test/cases/abc.tcl diff --git a/test/cases/archive.rhtml b/skylighting-core/test/cases/archive.rhtml similarity index 100% rename from test/cases/archive.rhtml rename to skylighting-core/test/cases/archive.rhtml diff --git a/test/cases/hk91.html b/skylighting-core/test/cases/hk91.html similarity index 100% rename from test/cases/hk91.html rename to skylighting-core/test/cases/hk91.html diff --git a/test/cases/if.cmake b/skylighting-core/test/cases/if.cmake similarity index 100% rename from test/cases/if.cmake rename to skylighting-core/test/cases/if.cmake diff --git a/test/cases/life.lua b/skylighting-core/test/cases/life.lua similarity index 100% rename from test/cases/life.lua rename to skylighting-core/test/cases/life.lua diff --git a/test/default.theme b/skylighting-core/test/default.theme similarity index 100% rename from test/default.theme rename to skylighting-core/test/default.theme diff --git a/test/expected/abc.ada.native b/skylighting-core/test/expected/abc.ada.native similarity index 100% rename from test/expected/abc.ada.native rename to skylighting-core/test/expected/abc.ada.native diff --git a/test/expected/abc.agda.native b/skylighting-core/test/expected/abc.agda.native similarity index 100% rename from test/expected/abc.agda.native rename to skylighting-core/test/expected/abc.agda.native diff --git a/test/expected/abc.c.native b/skylighting-core/test/expected/abc.c.native similarity index 100% rename from test/expected/abc.c.native rename to skylighting-core/test/expected/abc.c.native diff --git a/test/expected/abc.clojure.native b/skylighting-core/test/expected/abc.clojure.native similarity index 100% rename from test/expected/abc.clojure.native rename to skylighting-core/test/expected/abc.clojure.native diff --git a/test/expected/abc.cpp.native b/skylighting-core/test/expected/abc.cpp.native similarity index 100% rename from test/expected/abc.cpp.native rename to skylighting-core/test/expected/abc.cpp.native diff --git a/test/expected/abc.cs.native b/skylighting-core/test/expected/abc.cs.native similarity index 100% rename from test/expected/abc.cs.native rename to skylighting-core/test/expected/abc.cs.native diff --git a/test/expected/abc.d.native b/skylighting-core/test/expected/abc.d.native similarity index 100% rename from test/expected/abc.d.native rename to skylighting-core/test/expected/abc.d.native diff --git a/test/expected/abc.elixir.native b/skylighting-core/test/expected/abc.elixir.native similarity index 100% rename from test/expected/abc.elixir.native rename to skylighting-core/test/expected/abc.elixir.native diff --git a/test/expected/abc.fortran.native b/skylighting-core/test/expected/abc.fortran.native similarity index 100% rename from test/expected/abc.fortran.native rename to skylighting-core/test/expected/abc.fortran.native diff --git a/test/expected/abc.go.native b/skylighting-core/test/expected/abc.go.native similarity index 100% rename from test/expected/abc.go.native rename to skylighting-core/test/expected/abc.go.native diff --git a/test/expected/abc.haskell.native b/skylighting-core/test/expected/abc.haskell.native similarity index 100% rename from test/expected/abc.haskell.native rename to skylighting-core/test/expected/abc.haskell.native diff --git a/test/expected/abc.idris.native b/skylighting-core/test/expected/abc.idris.native similarity index 100% rename from test/expected/abc.idris.native rename to skylighting-core/test/expected/abc.idris.native diff --git a/test/expected/abc.java.native b/skylighting-core/test/expected/abc.java.native similarity index 100% rename from test/expected/abc.java.native rename to skylighting-core/test/expected/abc.java.native diff --git a/test/expected/abc.javascript.native b/skylighting-core/test/expected/abc.javascript.native similarity index 100% rename from test/expected/abc.javascript.native rename to skylighting-core/test/expected/abc.javascript.native diff --git a/test/expected/abc.julia.native b/skylighting-core/test/expected/abc.julia.native similarity index 100% rename from test/expected/abc.julia.native rename to skylighting-core/test/expected/abc.julia.native diff --git a/test/expected/abc.kotlin.native b/skylighting-core/test/expected/abc.kotlin.native similarity index 100% rename from test/expected/abc.kotlin.native rename to skylighting-core/test/expected/abc.kotlin.native diff --git a/test/expected/abc.lisp.native b/skylighting-core/test/expected/abc.lisp.native similarity index 100% rename from test/expected/abc.lisp.native rename to skylighting-core/test/expected/abc.lisp.native diff --git a/test/expected/abc.matlab.native b/skylighting-core/test/expected/abc.matlab.native similarity index 100% rename from test/expected/abc.matlab.native rename to skylighting-core/test/expected/abc.matlab.native diff --git a/test/expected/abc.ocaml.native b/skylighting-core/test/expected/abc.ocaml.native similarity index 100% rename from test/expected/abc.ocaml.native rename to skylighting-core/test/expected/abc.ocaml.native diff --git a/test/expected/abc.perl.native b/skylighting-core/test/expected/abc.perl.native similarity index 100% rename from test/expected/abc.perl.native rename to skylighting-core/test/expected/abc.perl.native diff --git a/test/expected/abc.php.native b/skylighting-core/test/expected/abc.php.native similarity index 100% rename from test/expected/abc.php.native rename to skylighting-core/test/expected/abc.php.native diff --git a/test/expected/abc.prolog.native b/skylighting-core/test/expected/abc.prolog.native similarity index 100% rename from test/expected/abc.prolog.native rename to skylighting-core/test/expected/abc.prolog.native diff --git a/test/expected/abc.python.native b/skylighting-core/test/expected/abc.python.native similarity index 100% rename from test/expected/abc.python.native rename to skylighting-core/test/expected/abc.python.native diff --git a/test/expected/abc.r.native b/skylighting-core/test/expected/abc.r.native similarity index 100% rename from test/expected/abc.r.native rename to skylighting-core/test/expected/abc.r.native diff --git a/test/expected/abc.ruby.native b/skylighting-core/test/expected/abc.ruby.native similarity index 100% rename from test/expected/abc.ruby.native rename to skylighting-core/test/expected/abc.ruby.native diff --git a/test/expected/abc.scala.native b/skylighting-core/test/expected/abc.scala.native similarity index 100% rename from test/expected/abc.scala.native rename to skylighting-core/test/expected/abc.scala.native diff --git a/test/expected/abc.scheme.native b/skylighting-core/test/expected/abc.scheme.native similarity index 100% rename from test/expected/abc.scheme.native rename to skylighting-core/test/expected/abc.scheme.native diff --git a/test/expected/abc.tcl.native b/skylighting-core/test/expected/abc.tcl.native similarity index 100% rename from test/expected/abc.tcl.native rename to skylighting-core/test/expected/abc.tcl.native diff --git a/test/expected/archive.rhtml.native b/skylighting-core/test/expected/archive.rhtml.native similarity index 100% rename from test/expected/archive.rhtml.native rename to skylighting-core/test/expected/archive.rhtml.native diff --git a/test/expected/hk91.html.native b/skylighting-core/test/expected/hk91.html.native similarity index 100% rename from test/expected/hk91.html.native rename to skylighting-core/test/expected/hk91.html.native diff --git a/test/expected/if.cmake.native b/skylighting-core/test/expected/if.cmake.native similarity index 100% rename from test/expected/if.cmake.native rename to skylighting-core/test/expected/if.cmake.native diff --git a/test/expected/life.lua.native b/skylighting-core/test/expected/life.lua.native similarity index 100% rename from test/expected/life.lua.native rename to skylighting-core/test/expected/life.lua.native diff --git a/test/test-skylighting.hs b/skylighting-core/test/test-skylighting.hs similarity index 100% rename from test/test-skylighting.hs rename to skylighting-core/test/test-skylighting.hs diff --git a/xml/abc.xml b/skylighting-core/xml/abc.xml similarity index 100% rename from xml/abc.xml rename to skylighting-core/xml/abc.xml diff --git a/xml/actionscript.xml b/skylighting-core/xml/actionscript.xml similarity index 100% rename from xml/actionscript.xml rename to skylighting-core/xml/actionscript.xml diff --git a/xml/ada.xml b/skylighting-core/xml/ada.xml similarity index 100% rename from xml/ada.xml rename to skylighting-core/xml/ada.xml diff --git a/xml/agda.xml b/skylighting-core/xml/agda.xml similarity index 100% rename from xml/agda.xml rename to skylighting-core/xml/agda.xml diff --git a/xml/alert.xml b/skylighting-core/xml/alert.xml similarity index 100% rename from xml/alert.xml rename to skylighting-core/xml/alert.xml diff --git a/xml/alert_indent.xml b/skylighting-core/xml/alert_indent.xml similarity index 100% rename from xml/alert_indent.xml rename to skylighting-core/xml/alert_indent.xml diff --git a/xml/apache.xml b/skylighting-core/xml/apache.xml similarity index 100% rename from xml/apache.xml rename to skylighting-core/xml/apache.xml diff --git a/xml/asn1.xml b/skylighting-core/xml/asn1.xml similarity index 100% rename from xml/asn1.xml rename to skylighting-core/xml/asn1.xml diff --git a/xml/asp.xml b/skylighting-core/xml/asp.xml similarity index 100% rename from xml/asp.xml rename to skylighting-core/xml/asp.xml diff --git a/xml/ats.xml b/skylighting-core/xml/ats.xml similarity index 100% rename from xml/ats.xml rename to skylighting-core/xml/ats.xml diff --git a/xml/awk.xml b/skylighting-core/xml/awk.xml similarity index 100% rename from xml/awk.xml rename to skylighting-core/xml/awk.xml diff --git a/xml/bash.xml b/skylighting-core/xml/bash.xml similarity index 100% rename from xml/bash.xml rename to skylighting-core/xml/bash.xml diff --git a/xml/bibtex.xml b/skylighting-core/xml/bibtex.xml similarity index 100% rename from xml/bibtex.xml rename to skylighting-core/xml/bibtex.xml diff --git a/xml/boo.xml b/skylighting-core/xml/boo.xml similarity index 100% rename from xml/boo.xml rename to skylighting-core/xml/boo.xml diff --git a/xml/c.xml b/skylighting-core/xml/c.xml similarity index 100% rename from xml/c.xml rename to skylighting-core/xml/c.xml diff --git a/xml/changelog.xml b/skylighting-core/xml/changelog.xml similarity index 100% rename from xml/changelog.xml rename to skylighting-core/xml/changelog.xml diff --git a/xml/clojure.xml b/skylighting-core/xml/clojure.xml similarity index 100% rename from xml/clojure.xml rename to skylighting-core/xml/clojure.xml diff --git a/xml/cmake.xml b/skylighting-core/xml/cmake.xml similarity index 100% rename from xml/cmake.xml rename to skylighting-core/xml/cmake.xml diff --git a/xml/coffee.xml b/skylighting-core/xml/coffee.xml similarity index 100% rename from xml/coffee.xml rename to skylighting-core/xml/coffee.xml diff --git a/xml/coldfusion.xml b/skylighting-core/xml/coldfusion.xml similarity index 100% rename from xml/coldfusion.xml rename to skylighting-core/xml/coldfusion.xml diff --git a/xml/commonlisp.xml b/skylighting-core/xml/commonlisp.xml similarity index 100% rename from xml/commonlisp.xml rename to skylighting-core/xml/commonlisp.xml diff --git a/xml/cpp.xml b/skylighting-core/xml/cpp.xml similarity index 100% rename from xml/cpp.xml rename to skylighting-core/xml/cpp.xml diff --git a/xml/cs.xml b/skylighting-core/xml/cs.xml similarity index 100% rename from xml/cs.xml rename to skylighting-core/xml/cs.xml diff --git a/xml/css.xml b/skylighting-core/xml/css.xml similarity index 100% rename from xml/css.xml rename to skylighting-core/xml/css.xml diff --git a/xml/curry.xml b/skylighting-core/xml/curry.xml similarity index 100% rename from xml/curry.xml rename to skylighting-core/xml/curry.xml diff --git a/xml/d.xml b/skylighting-core/xml/d.xml similarity index 100% rename from xml/d.xml rename to skylighting-core/xml/d.xml diff --git a/xml/diff.xml b/skylighting-core/xml/diff.xml similarity index 100% rename from xml/diff.xml rename to skylighting-core/xml/diff.xml diff --git a/xml/djangotemplate.xml b/skylighting-core/xml/djangotemplate.xml similarity index 100% rename from xml/djangotemplate.xml rename to skylighting-core/xml/djangotemplate.xml diff --git a/xml/dockerfile.xml b/skylighting-core/xml/dockerfile.xml similarity index 100% rename from xml/dockerfile.xml rename to skylighting-core/xml/dockerfile.xml diff --git a/xml/dot.xml b/skylighting-core/xml/dot.xml similarity index 100% rename from xml/dot.xml rename to skylighting-core/xml/dot.xml diff --git a/xml/doxygen.xml b/skylighting-core/xml/doxygen.xml similarity index 100% rename from xml/doxygen.xml rename to skylighting-core/xml/doxygen.xml diff --git a/xml/doxygenlua.xml b/skylighting-core/xml/doxygenlua.xml similarity index 100% rename from xml/doxygenlua.xml rename to skylighting-core/xml/doxygenlua.xml diff --git a/xml/dtd.xml b/skylighting-core/xml/dtd.xml similarity index 100% rename from xml/dtd.xml rename to skylighting-core/xml/dtd.xml diff --git a/xml/eiffel.xml b/skylighting-core/xml/eiffel.xml similarity index 100% rename from xml/eiffel.xml rename to skylighting-core/xml/eiffel.xml diff --git a/xml/elixir.xml b/skylighting-core/xml/elixir.xml similarity index 100% rename from xml/elixir.xml rename to skylighting-core/xml/elixir.xml diff --git a/xml/email.xml b/skylighting-core/xml/email.xml similarity index 100% rename from xml/email.xml rename to skylighting-core/xml/email.xml diff --git a/xml/erlang.xml b/skylighting-core/xml/erlang.xml similarity index 100% rename from xml/erlang.xml rename to skylighting-core/xml/erlang.xml diff --git a/xml/fasm.xml b/skylighting-core/xml/fasm.xml similarity index 100% rename from xml/fasm.xml rename to skylighting-core/xml/fasm.xml diff --git a/xml/fortran.xml b/skylighting-core/xml/fortran.xml similarity index 100% rename from xml/fortran.xml rename to skylighting-core/xml/fortran.xml diff --git a/xml/fsharp.xml b/skylighting-core/xml/fsharp.xml similarity index 100% rename from xml/fsharp.xml rename to skylighting-core/xml/fsharp.xml diff --git a/xml/gcc.xml b/skylighting-core/xml/gcc.xml similarity index 100% rename from xml/gcc.xml rename to skylighting-core/xml/gcc.xml diff --git a/xml/glsl.xml b/skylighting-core/xml/glsl.xml similarity index 100% rename from xml/glsl.xml rename to skylighting-core/xml/glsl.xml diff --git a/xml/gnuassembler.xml b/skylighting-core/xml/gnuassembler.xml similarity index 100% rename from xml/gnuassembler.xml rename to skylighting-core/xml/gnuassembler.xml diff --git a/xml/go.xml b/skylighting-core/xml/go.xml similarity index 100% rename from xml/go.xml rename to skylighting-core/xml/go.xml diff --git a/xml/hamlet.xml b/skylighting-core/xml/hamlet.xml similarity index 100% rename from xml/hamlet.xml rename to skylighting-core/xml/hamlet.xml diff --git a/xml/haskell.xml b/skylighting-core/xml/haskell.xml similarity index 100% rename from xml/haskell.xml rename to skylighting-core/xml/haskell.xml diff --git a/xml/haskell.xml.patch b/skylighting-core/xml/haskell.xml.patch similarity index 100% rename from xml/haskell.xml.patch rename to skylighting-core/xml/haskell.xml.patch diff --git a/xml/haxe.xml b/skylighting-core/xml/haxe.xml similarity index 100% rename from xml/haxe.xml rename to skylighting-core/xml/haxe.xml diff --git a/xml/html.xml b/skylighting-core/xml/html.xml similarity index 100% rename from xml/html.xml rename to skylighting-core/xml/html.xml diff --git a/xml/idris.xml b/skylighting-core/xml/idris.xml similarity index 100% rename from xml/idris.xml rename to skylighting-core/xml/idris.xml diff --git a/xml/ini.xml b/skylighting-core/xml/ini.xml similarity index 100% rename from xml/ini.xml rename to skylighting-core/xml/ini.xml diff --git a/xml/isocpp.xml b/skylighting-core/xml/isocpp.xml similarity index 100% rename from xml/isocpp.xml rename to skylighting-core/xml/isocpp.xml diff --git a/xml/java.xml b/skylighting-core/xml/java.xml similarity index 100% rename from xml/java.xml rename to skylighting-core/xml/java.xml diff --git a/xml/javadoc.xml b/skylighting-core/xml/javadoc.xml similarity index 100% rename from xml/javadoc.xml rename to skylighting-core/xml/javadoc.xml diff --git a/xml/javascript.xml b/skylighting-core/xml/javascript.xml similarity index 100% rename from xml/javascript.xml rename to skylighting-core/xml/javascript.xml diff --git a/xml/json.xml b/skylighting-core/xml/json.xml similarity index 100% rename from xml/json.xml rename to skylighting-core/xml/json.xml diff --git a/xml/jsp.xml b/skylighting-core/xml/jsp.xml similarity index 100% rename from xml/jsp.xml rename to skylighting-core/xml/jsp.xml diff --git a/xml/julia.xml b/skylighting-core/xml/julia.xml similarity index 100% rename from xml/julia.xml rename to skylighting-core/xml/julia.xml diff --git a/xml/kotlin.xml b/skylighting-core/xml/kotlin.xml similarity index 100% rename from xml/kotlin.xml rename to skylighting-core/xml/kotlin.xml diff --git a/xml/language.dtd b/skylighting-core/xml/language.dtd similarity index 100% rename from xml/language.dtd rename to skylighting-core/xml/language.dtd diff --git a/xml/language.xsd b/skylighting-core/xml/language.xsd similarity index 100% rename from xml/language.xsd rename to skylighting-core/xml/language.xsd diff --git a/xml/latex.xml b/skylighting-core/xml/latex.xml similarity index 100% rename from xml/latex.xml rename to skylighting-core/xml/latex.xml diff --git a/xml/lex.xml b/skylighting-core/xml/lex.xml similarity index 100% rename from xml/lex.xml rename to skylighting-core/xml/lex.xml diff --git a/xml/lilypond.xml b/skylighting-core/xml/lilypond.xml similarity index 100% rename from xml/lilypond.xml rename to skylighting-core/xml/lilypond.xml diff --git a/xml/literate-curry.xml b/skylighting-core/xml/literate-curry.xml similarity index 100% rename from xml/literate-curry.xml rename to skylighting-core/xml/literate-curry.xml diff --git a/xml/literate-haskell.xml b/skylighting-core/xml/literate-haskell.xml similarity index 100% rename from xml/literate-haskell.xml rename to skylighting-core/xml/literate-haskell.xml diff --git a/xml/llvm.xml b/skylighting-core/xml/llvm.xml similarity index 100% rename from xml/llvm.xml rename to skylighting-core/xml/llvm.xml diff --git a/xml/lua.xml b/skylighting-core/xml/lua.xml similarity index 100% rename from xml/lua.xml rename to skylighting-core/xml/lua.xml diff --git a/xml/lua.xml.patch b/skylighting-core/xml/lua.xml.patch similarity index 100% rename from xml/lua.xml.patch rename to skylighting-core/xml/lua.xml.patch diff --git a/xml/m4.xml b/skylighting-core/xml/m4.xml similarity index 100% rename from xml/m4.xml rename to skylighting-core/xml/m4.xml diff --git a/xml/makefile.xml b/skylighting-core/xml/makefile.xml similarity index 100% rename from xml/makefile.xml rename to skylighting-core/xml/makefile.xml diff --git a/xml/mandoc.xml b/skylighting-core/xml/mandoc.xml similarity index 100% rename from xml/mandoc.xml rename to skylighting-core/xml/mandoc.xml diff --git a/xml/markdown.xml b/skylighting-core/xml/markdown.xml similarity index 100% rename from xml/markdown.xml rename to skylighting-core/xml/markdown.xml diff --git a/xml/mathematica.xml b/skylighting-core/xml/mathematica.xml similarity index 100% rename from xml/mathematica.xml rename to skylighting-core/xml/mathematica.xml diff --git a/xml/matlab.xml b/skylighting-core/xml/matlab.xml similarity index 100% rename from xml/matlab.xml rename to skylighting-core/xml/matlab.xml diff --git a/xml/maxima.xml b/skylighting-core/xml/maxima.xml similarity index 100% rename from xml/maxima.xml rename to skylighting-core/xml/maxima.xml diff --git a/xml/mediawiki.xml b/skylighting-core/xml/mediawiki.xml similarity index 100% rename from xml/mediawiki.xml rename to skylighting-core/xml/mediawiki.xml diff --git a/xml/metafont.xml b/skylighting-core/xml/metafont.xml similarity index 100% rename from xml/metafont.xml rename to skylighting-core/xml/metafont.xml diff --git a/xml/mips.xml b/skylighting-core/xml/mips.xml similarity index 100% rename from xml/mips.xml rename to skylighting-core/xml/mips.xml diff --git a/xml/modelines.xml b/skylighting-core/xml/modelines.xml similarity index 100% rename from xml/modelines.xml rename to skylighting-core/xml/modelines.xml diff --git a/xml/modula-2.xml b/skylighting-core/xml/modula-2.xml similarity index 100% rename from xml/modula-2.xml rename to skylighting-core/xml/modula-2.xml diff --git a/xml/modula-3.xml b/skylighting-core/xml/modula-3.xml similarity index 100% rename from xml/modula-3.xml rename to skylighting-core/xml/modula-3.xml diff --git a/xml/monobasic.xml b/skylighting-core/xml/monobasic.xml similarity index 100% rename from xml/monobasic.xml rename to skylighting-core/xml/monobasic.xml diff --git a/xml/nasm.xml b/skylighting-core/xml/nasm.xml similarity index 100% rename from xml/nasm.xml rename to skylighting-core/xml/nasm.xml diff --git a/xml/noweb.xml b/skylighting-core/xml/noweb.xml similarity index 100% rename from xml/noweb.xml rename to skylighting-core/xml/noweb.xml diff --git a/xml/objectivec.xml b/skylighting-core/xml/objectivec.xml similarity index 100% rename from xml/objectivec.xml rename to skylighting-core/xml/objectivec.xml diff --git a/xml/objectivecpp.xml b/skylighting-core/xml/objectivecpp.xml similarity index 100% rename from xml/objectivecpp.xml rename to skylighting-core/xml/objectivecpp.xml diff --git a/xml/ocaml.xml b/skylighting-core/xml/ocaml.xml similarity index 100% rename from xml/ocaml.xml rename to skylighting-core/xml/ocaml.xml diff --git a/xml/octave.xml b/skylighting-core/xml/octave.xml similarity index 100% rename from xml/octave.xml rename to skylighting-core/xml/octave.xml diff --git a/xml/opencl.xml b/skylighting-core/xml/opencl.xml similarity index 100% rename from xml/opencl.xml rename to skylighting-core/xml/opencl.xml diff --git a/xml/pascal.xml b/skylighting-core/xml/pascal.xml similarity index 100% rename from xml/pascal.xml rename to skylighting-core/xml/pascal.xml diff --git a/xml/perl.xml b/skylighting-core/xml/perl.xml similarity index 100% rename from xml/perl.xml rename to skylighting-core/xml/perl.xml diff --git a/xml/perl.xml.patch b/skylighting-core/xml/perl.xml.patch similarity index 100% rename from xml/perl.xml.patch rename to skylighting-core/xml/perl.xml.patch diff --git a/xml/php.xml b/skylighting-core/xml/php.xml similarity index 100% rename from xml/php.xml rename to skylighting-core/xml/php.xml diff --git a/xml/php.xml.patch b/skylighting-core/xml/php.xml.patch similarity index 100% rename from xml/php.xml.patch rename to skylighting-core/xml/php.xml.patch diff --git a/xml/pike.xml b/skylighting-core/xml/pike.xml similarity index 100% rename from xml/pike.xml rename to skylighting-core/xml/pike.xml diff --git a/xml/postscript.xml b/skylighting-core/xml/postscript.xml similarity index 100% rename from xml/postscript.xml rename to skylighting-core/xml/postscript.xml diff --git a/xml/powershell.xml b/skylighting-core/xml/powershell.xml similarity index 100% rename from xml/powershell.xml rename to skylighting-core/xml/powershell.xml diff --git a/xml/prolog.xml b/skylighting-core/xml/prolog.xml similarity index 100% rename from xml/prolog.xml rename to skylighting-core/xml/prolog.xml diff --git a/xml/pure.xml b/skylighting-core/xml/pure.xml similarity index 100% rename from xml/pure.xml rename to skylighting-core/xml/pure.xml diff --git a/xml/purebasic.xml b/skylighting-core/xml/purebasic.xml similarity index 100% rename from xml/purebasic.xml rename to skylighting-core/xml/purebasic.xml diff --git a/xml/python.xml b/skylighting-core/xml/python.xml similarity index 100% rename from xml/python.xml rename to skylighting-core/xml/python.xml diff --git a/xml/r.xml b/skylighting-core/xml/r.xml similarity index 100% rename from xml/r.xml rename to skylighting-core/xml/r.xml diff --git a/xml/relaxng.xml b/skylighting-core/xml/relaxng.xml similarity index 100% rename from xml/relaxng.xml rename to skylighting-core/xml/relaxng.xml diff --git a/xml/relaxngcompact.xml b/skylighting-core/xml/relaxngcompact.xml similarity index 100% rename from xml/relaxngcompact.xml rename to skylighting-core/xml/relaxngcompact.xml diff --git a/xml/rest.xml b/skylighting-core/xml/rest.xml similarity index 100% rename from xml/rest.xml rename to skylighting-core/xml/rest.xml diff --git a/xml/rhtml.xml b/skylighting-core/xml/rhtml.xml similarity index 100% rename from xml/rhtml.xml rename to skylighting-core/xml/rhtml.xml diff --git a/xml/roff.xml b/skylighting-core/xml/roff.xml similarity index 100% rename from xml/roff.xml rename to skylighting-core/xml/roff.xml diff --git a/xml/ruby.xml b/skylighting-core/xml/ruby.xml similarity index 100% rename from xml/ruby.xml rename to skylighting-core/xml/ruby.xml diff --git a/xml/rust.xml b/skylighting-core/xml/rust.xml similarity index 100% rename from xml/rust.xml rename to skylighting-core/xml/rust.xml diff --git a/xml/scala.xml b/skylighting-core/xml/scala.xml similarity index 100% rename from xml/scala.xml rename to skylighting-core/xml/scala.xml diff --git a/xml/scheme.xml b/skylighting-core/xml/scheme.xml similarity index 100% rename from xml/scheme.xml rename to skylighting-core/xml/scheme.xml diff --git a/xml/sci.xml b/skylighting-core/xml/sci.xml similarity index 100% rename from xml/sci.xml rename to skylighting-core/xml/sci.xml diff --git a/xml/sed.xml b/skylighting-core/xml/sed.xml similarity index 100% rename from xml/sed.xml rename to skylighting-core/xml/sed.xml diff --git a/xml/sgml.xml b/skylighting-core/xml/sgml.xml similarity index 100% rename from xml/sgml.xml rename to skylighting-core/xml/sgml.xml diff --git a/xml/sql-mysql.xml b/skylighting-core/xml/sql-mysql.xml similarity index 100% rename from xml/sql-mysql.xml rename to skylighting-core/xml/sql-mysql.xml diff --git a/xml/sql-postgresql.xml b/skylighting-core/xml/sql-postgresql.xml similarity index 100% rename from xml/sql-postgresql.xml rename to skylighting-core/xml/sql-postgresql.xml diff --git a/xml/sql.xml b/skylighting-core/xml/sql.xml similarity index 100% rename from xml/sql.xml rename to skylighting-core/xml/sql.xml diff --git a/xml/tcl.xml b/skylighting-core/xml/tcl.xml similarity index 100% rename from xml/tcl.xml rename to skylighting-core/xml/tcl.xml diff --git a/xml/tcsh.xml b/skylighting-core/xml/tcsh.xml similarity index 100% rename from xml/tcsh.xml rename to skylighting-core/xml/tcsh.xml diff --git a/xml/tcsh.xml.patch b/skylighting-core/xml/tcsh.xml.patch similarity index 100% rename from xml/tcsh.xml.patch rename to skylighting-core/xml/tcsh.xml.patch diff --git a/xml/texinfo.xml b/skylighting-core/xml/texinfo.xml similarity index 100% rename from xml/texinfo.xml rename to skylighting-core/xml/texinfo.xml diff --git a/xml/validatehl.sh b/skylighting-core/xml/validatehl.sh similarity index 100% rename from xml/validatehl.sh rename to skylighting-core/xml/validatehl.sh diff --git a/xml/verilog.xml b/skylighting-core/xml/verilog.xml similarity index 100% rename from xml/verilog.xml rename to skylighting-core/xml/verilog.xml diff --git a/xml/vhdl.xml b/skylighting-core/xml/vhdl.xml similarity index 100% rename from xml/vhdl.xml rename to skylighting-core/xml/vhdl.xml diff --git a/xml/xml.xml b/skylighting-core/xml/xml.xml similarity index 100% rename from xml/xml.xml rename to skylighting-core/xml/xml.xml diff --git a/xml/xorg.xml b/skylighting-core/xml/xorg.xml similarity index 100% rename from xml/xorg.xml rename to skylighting-core/xml/xorg.xml diff --git a/xml/xslt.xml b/skylighting-core/xml/xslt.xml similarity index 100% rename from xml/xslt.xml rename to skylighting-core/xml/xslt.xml diff --git a/xml/xul.xml b/skylighting-core/xml/xul.xml similarity index 100% rename from xml/xul.xml rename to skylighting-core/xml/xul.xml diff --git a/xml/yacc.xml b/skylighting-core/xml/yacc.xml similarity index 100% rename from xml/yacc.xml rename to skylighting-core/xml/yacc.xml diff --git a/xml/yaml.xml b/skylighting-core/xml/yaml.xml similarity index 100% rename from xml/yaml.xml rename to skylighting-core/xml/yaml.xml diff --git a/xml/zsh.xml b/skylighting-core/xml/zsh.xml similarity index 100% rename from xml/zsh.xml rename to skylighting-core/xml/zsh.xml diff --git a/LICENSE b/skylighting/LICENSE similarity index 100% rename from LICENSE rename to skylighting/LICENSE diff --git a/skylighting/README.md b/skylighting/README.md new file mode 100644 index 000000000..6f276ca7b --- /dev/null +++ b/skylighting/README.md @@ -0,0 +1,120 @@ +skylighting +=========== + +| Package | License | Status | +|-|-|-| +| `skylighting` | [![license](https://img.shields.io/badge/license-GPLv2+-brightgreen.svg)](https://www.gnu.org/licenses/gpl.html) | [![skylighting build status](https://img.shields.io/travis/jgm/skylighting.svg)](https://travis-ci.org/jgm/skylighting) | +| `skylighting-core` | [![license](https://img.shields.io/badge/license-BSD3-brightgreen.svg)](https://opensource.org/licenses/BSD-3-Clause) | [![skylighting-core build status](https://img.shields.io/travis/jgm/skylighting-core.svg)](https://travis-ci.org/jgm/skylighting-core) | + +A Haskell syntax highlighting library with tokenizers derived +from KDE XML syntax highlighting descriptions. + +A command-line highlighter program, `skylighting`, is also provided. + +This project is divided up into two packages: + + * `skylighting-core`: this provides KDE XML parsing, data types, + and output formatters. This includes the core functionality of the + skylighting project licensed under the BSD3 license, along with the + KDE XML files, some of which are licensed under the LGPL or GPL. This + package does not provide any built-in parsers corresponding to the + XML descriptions, however. For that, use `skylighting`. + * `skylighting`: this exposes the `skylighting-core` API but also + provides bundled Haskell parser modules derived from the XML + descriptions in the `core` package. This package is entirely licensed + under the GPL. + +Motivation +---------- + +This library is the successor to [highlighting-kate], which had +some problems that were difficult to resolve given its +architecture. + +In highlighting-kate, the XML syntax descriptions were converted +into individual parsec parsers, which were then compiled. This +made it difficult to handle IncludeRules properly without +circular imports. There was also no way to load a syntax +description dynamically. + +Skylighting, by contrast, parses the XML syntax descriptions +into Haskell data structures, which are then interpreted by +a "tokenize" function. IncludeRules can now be handled +properly, and users can add new syntax descriptions +dynamically. It is also now possible to convert `.theme` files +directly into styles. + +Skylighting is also faster than highlighting-kate, by a +factor of 3 in some cases. + +Installing +---------- + +To install the latest release from Hackage, do + + stack install skylighting +or + + cabal install skylighting + +If you want the command-line tool, set the `executable` flag +using `--flag "skylighting:executable"` in stack or +`-fexecutable` in cabal. + +The release tarball for the `skylighting` package includes generated +files not present in this repository. Building from this repository is +a two-step process. In the first step we build the `skylighting-core` +package, which provides a program, `skylighting-extract`, which reads +XML syntax highlighting definitions from the `xml` directory and writes +Haskell source files. In the second we actually build the `skylighting` +package. + +Using cabal: + + cabal install -fexecutable + # or stack install --flag skylighting-core:executable + cd skylighting + skylighting-extract /path/to/skylighting-core/xml/*.xml + cabal install -fexecutable + # or stack install --flag skylighting:executable + +Command-line tool +----------------- + +A command-line executable, `skylighting`, is installed if +the `executable` cabal flag is set in building. + +For help, `skylighting --help`. + +Adding new syntaxes +------------------- + +To compile with additional syntaxes, simply add the syntax definition +(XML) file to the `xml` directory of the `skylighting-core` package and +repeat the bootstrap build described above. + +Note that both the library and the executable can dynamically load +syntax definitions, so you may not need to compile them in. If you +prefer this approach, you can use the `skylighting-core` package +directly which provides the XML files without the generated code +produced by the bootstrap process described above. + +License +------- + +The `skylighting` package is licensed under the GPL because some of the +XML syntax descriptions from which its tokenizers are generated are +GPL-licensed. However, the `skylighting-core` package, which provides +the core types and functions of this project is licensed under the BSD3 +license and bundles the GPL-licensed XML files separately. + +References +---------- + +Kate syntax highlighting documentation: + + +Kate highlighting definitions: + + +[highlighting-kate]: https://github.com/jgm/highlighting-kate diff --git a/skylighting/Setup.hs b/skylighting/Setup.hs new file mode 100644 index 000000000..9a994af67 --- /dev/null +++ b/skylighting/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain diff --git a/bin/main.hs b/skylighting/bin/main.hs similarity index 100% rename from bin/main.hs rename to skylighting/bin/main.hs diff --git a/skylighting.cabal b/skylighting/skylighting.cabal similarity index 58% rename from skylighting.cabal rename to skylighting/skylighting.cabal index c1e803de1..493224795 100644 --- a/skylighting.cabal +++ b/skylighting/skylighting.cabal @@ -11,6 +11,11 @@ description: Skylighting is a syntax highlighting library with Skylighting is intended to be the successor to highlighting-kate. + This package provides generated syntax modules + based on the KDE XML definitions provided by the + @skylighting-core@ package. As a result this + package is licensed under the GPL. + homepage: https://github.com/jgm/skylighting license: GPL-2 license-file: LICENSE @@ -19,73 +24,9 @@ maintainer: jgm@berkeley.edu copyright: (C) 2016 John MacFarlane category: Text build-type: Simple -extra-source-files: changelog.md - README.md - xml/*.xml - xml/language.dtd - test/default.theme - test/cases/abc.ada - test/cases/abc.agda - test/cases/abc.c - test/cases/abc.clojure - test/cases/abc.cpp - test/cases/abc.cs - test/cases/abc.d - test/cases/abc.fortran - test/cases/abc.go - test/cases/abc.haskell - test/cases/abc.java - test/cases/abc.javascript - test/cases/abc.julia - test/cases/abc.kotlin - test/cases/abc.lisp - test/cases/abc.matlab - test/cases/abc.ocaml - test/cases/abc.perl - test/cases/abc.php - test/cases/abc.prolog - test/cases/abc.python - test/cases/abc.r - test/cases/abc.ruby - test/cases/abc.scala - test/cases/abc.scheme - test/cases/abc.tcl - test/cases/archive.rhtml - test/cases/life.lua - test/cases/hk91.html - test/cases/if.cmake - test/expected/abc.ada.native - test/expected/abc.agda.native - test/expected/abc.c.native - test/expected/abc.clojure.native - test/expected/abc.cpp.native - test/expected/abc.cs.native - test/expected/abc.d.native - test/expected/abc.fortran.native - test/expected/abc.go.native - test/expected/abc.haskell.native - test/expected/abc.java.native - test/expected/abc.javascript.native - test/expected/abc.julia.native - test/expected/abc.kotlin.native - test/expected/abc.lisp.native - test/expected/abc.matlab.native - test/expected/abc.ocaml.native - test/expected/abc.perl.native - test/expected/abc.php.native - test/expected/abc.prolog.native - test/expected/abc.python.native - test/expected/abc.r.native - test/expected/abc.ruby.native - test/expected/abc.scala.native - test/expected/abc.scheme.native - test/expected/abc.tcl.native - test/expected/archive.rhtml.native - test/expected/life.lua.native - test/expected/hk91.html.native - test/expected/if.cmake.native +extra-doc-files: README.md -cabal-version: >=1.10 +cabal-version: >=1.22 source-repository head type: git @@ -93,15 +34,16 @@ source-repository head library exposed-modules: Skylighting - Skylighting.Types - Skylighting.Regex - Skylighting.Parser - Skylighting.Styles - Skylighting.Tokenizer - Skylighting.Format.ANSI - Skylighting.Format.HTML - Skylighting.Format.LaTeX Skylighting.Syntax + reexported-modules: skylighting-core:Skylighting.Core + , skylighting-core:Skylighting.Types + , skylighting-core:Skylighting.Regex + , skylighting-core:Skylighting.Parser + , skylighting-core:Skylighting.Styles + , skylighting-core:Skylighting.Tokenizer + , skylighting-core:Skylighting.Format.ANSI + , skylighting-core:Skylighting.Format.HTML + , skylighting-core:Skylighting.Format.LaTeX other-modules: Skylighting.Syntax.Abc Skylighting.Syntax.Actionscript @@ -229,6 +171,7 @@ library Skylighting.Syntax.Zsh other-extensions: CPP, Arrows build-depends: base >= 4.7 && < 5.0, + skylighting-core, mtl, text, binary, @@ -251,62 +194,17 @@ library else build-depends: regex-pcre-builtin hs-source-dirs: src - if impl(ghc < 7.10) - hs-source-dirs: prelude - other-modules: Prelude ghc-prof-options: -fprof-auto-exported default-language: Haskell2010 ghc-options: -Wall - if flag(bootstrap) - buildable: False - -Flag bootstrap - Description: Only build skylighting-extract - Default: False - -Flag executable - Description: Build skylighting CLI tool - Default: False Flag system-pcre Description: Use regex-pcre instead of regex-pcre-builtin Default: False -executable skylighting-extract - build-depends: base >= 4.7 && < 5.0, - filepath, - bytestring, - base64-bytestring, - text, - safe, - hxt, - utf8-string, - case-insensitive, - aeson >= 1.0, - binary, - containers, - directory, - ansi-terminal >= 0.7, - colour >= 2.0 - if flag(system-pcre) - build-depends: regex-pcre - else - build-depends: regex-pcre-builtin - hs-source-dirs: bin, src - if impl(ghc < 7.10) - hs-source-dirs: prelude - other-modules: Prelude - main-is: extract.hs - default-language: Haskell2010 - other-extensions: CPP - ghc-options: -Wall - other-modules: Skylighting.Types - Skylighting.Regex - Skylighting.Parser - if flag(bootstrap) - buildable: True - else - buildable: False +Flag executable + Description: Whether to build the skylighting program + Default: False executable skylighting build-depends: base >= 4.7 && < 5.0, @@ -319,65 +217,12 @@ executable skylighting blaze-html >= 0.5, skylighting hs-source-dirs: bin - if impl(ghc < 7.10) - hs-source-dirs: prelude - other-modules: Prelude main-is: main.hs default-language: Haskell2010 other-extensions: CPP ghc-options: -Wall - if flag(bootstrap) - buildable: False if flag(executable) buildable: True else buildable: False other-modules: Paths_skylighting - -test-suite test-skylighting - type: exitcode-stdio-1.0 - main-is: test-skylighting.hs - hs-source-dirs: test - if impl(ghc < 7.10) - hs-source-dirs: prelude - other-modules: Prelude - build-depends: base >= 4.7 && < 5.0, - HUnit, - tasty, - tasty-golden, - tasty-hunit, - tasty-quickcheck, - QuickCheck, - containers, - random, - Diff, - text, - pretty-show, - aeson >= 1.0, - bytestring, - directory, - filepath, - skylighting - default-language: Haskell2010 - ghc-options: -Wall - if flag(bootstrap) - buildable: False - -benchmark benchmark-skylighting - Type: exitcode-stdio-1.0 - Main-Is: benchmark.hs - Hs-Source-Dirs: benchmark - if impl(ghc < 7.10) - Hs-Source-Dirs: prelude - Other-Modules: Prelude - Build-Depends: skylighting, - base >= 4.2 && < 5, - filepath, - text, - containers, - directory, - criterion >= 1.0 && < 1.4 - Ghc-Options: -rtsopts -Wall -fno-warn-unused-do-bind - Default-Language: Haskell2010 - if flag(bootstrap) - buildable: False diff --git a/skylighting/src/Skylighting.hs b/skylighting/src/Skylighting.hs new file mode 100644 index 000000000..c7c8bd53c --- /dev/null +++ b/skylighting/src/Skylighting.hs @@ -0,0 +1,33 @@ +module Skylighting + ( lookupSyntax + , syntaxByName + , syntaxByShortName + , syntaxesByExtension + , syntaxesByFilename + + , module Skylighting.Syntax + + -- Re-exports from the skylighting-core package + , module Skylighting.Types + , module Skylighting.Tokenizer + , module Skylighting.Parser + , module Skylighting.Regex + , module Skylighting.Styles + , module Skylighting.Format.ANSI + , module Skylighting.Format.HTML + , module Skylighting.Format.LaTeX + + ) +where + +import Skylighting.Core +import Skylighting.Format.ANSI +import Skylighting.Format.HTML +import Skylighting.Format.LaTeX +import Skylighting.Parser +import Skylighting.Regex +import Skylighting.Styles +import Skylighting.Tokenizer +import Skylighting.Types + +import Skylighting.Syntax diff --git a/stack.lts9.yaml b/stack.lts9.yaml index 417df8ab3..5bfa7d844 100644 --- a/stack.lts9.yaml +++ b/stack.lts9.yaml @@ -1,5 +1,6 @@ packages: -- . +- skylighting-core +- skylighting extra-deps: - ansi-terminal-0.8 - ansi-wl-pprint-0.6.8.2 diff --git a/stack.yaml b/stack.yaml index 7484ae2e3..9b2fa5d95 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,4 +1,5 @@ packages: -- . +- skylighting-core +- skylighting extra-deps: [] resolver: lts-10.3