packages feed

skylighting 0.14.5 → 0.14.6

raw patch · 5 files changed

+32/−3 lines, 5 filesdep +skylighting-format-typstdep ~skylighting-corePVP ok

version bump matches the API change (PVP)

Dependencies added: skylighting-format-typst

Dependency ranges changed: skylighting-core

API changes (from Hackage documentation)

Files

README.md view
@@ -25,6 +25,8 @@    rendering skylighting tokens as ConTeXt. * `skylighting-format-latex`: this provides formatters for   rendering skylighting tokens as LaTeX.+* `skylighting-format-typst`: this provides formatters for+  rendering skylighting tokens as Typst. * `skylighting`: this exposes the `skylighting-core` API and    ANSI, HTML, ConTeXt, and LaTeX formatters, and also    provides bundled Haskell parser modules derived from the XML
bin/main.hs view
@@ -45,6 +45,7 @@                      | FormatConTeXt                      | FormatHtml                      | FormatLaTeX+                     | FormatTypst                      | FormatNative                      deriving (Eq, Show) @@ -61,7 +62,7 @@   ,Option ['f']           ["format"]           (ReqArg Format "FORMAT")-          "output format (ansi|context|html|latex|native)"+          "output format (ansi|context|html|latex|typst|native)"   ,Option ['r']           ["fragment"]           (NoArg Fragment)@@ -147,6 +148,7 @@                             "context"-> return FormatConTeXt                             "html"   -> return FormatHtml                             "latex"  -> return FormatLaTeX+                            "typst"  -> return FormatTypst                             "native" -> return FormatNative                             _        -> err $ "Unknown format: " ++ s formatOf (_ : xs) = formatOf xs@@ -249,6 +251,7 @@        FormatConTeXt-> hlConTeXt fragment fname highlightOpts style sourceLines        FormatHtml   -> hlHtml fragment fname highlightOpts style sourceLines        FormatLaTeX  -> hlLaTeX fragment fname highlightOpts style sourceLines+       FormatTypst  -> hlTypst fragment fname highlightOpts style sourceLines        FormatNative -> putStrLn $ ppShow sourceLines  hlANSI :: FormatOptions@@ -297,6 +300,21 @@   where fragment = formatLaTeXBlock opts sourceLines         macros = styleToLaTeX sty         pageTitle = "\\title{" <> Text.pack fname <> "}\n"++hlTypst :: Bool               -- ^ Fragment+        -> FilePath            -- ^ Filename+        -> FormatOptions+        -> Style+        -> [SourceLine]+        -> IO ()+hlTypst frag fname opts sty sourceLines =+ if frag+    then Text.putStrLn fragment+    else Text.putStrLn $ macros <> "\n" <> pageTitle <> "\n" <> fragment+  where fragment = formatTypstBlock opts sourceLines+        macros = styleToTypst sty+        pageTitle = "= " <> Text.pack fname <> "\n"+  hlConTeXt :: Bool               -- ^ Fragment           -> FilePath           -- ^ Filename
changelog.md view
@@ -1,5 +1,10 @@ # Revision history for skylighting and skylighting-core +## 0.14.6++  * Export Skylighting.Format.Typst from Skylighting [API change] (#201).+    Allow typst as an output format in the cli executable.+ ## 0.14.5    * Update xml syntax definitions for bash, cmake, commonlisp, isocpp,
skylighting.cabal view
@@ -1,5 +1,5 @@ name:                skylighting-version:             0.14.5+version:             0.14.6 synopsis:            syntax highlighting library description:         Skylighting is a syntax highlighting library with                      support for over one hundred languages.  It derives@@ -46,6 +46,7 @@                        , skylighting-format-blaze-html:Skylighting.Format.HTML                        , skylighting-format-context:Skylighting.Format.ConTeXt                        , skylighting-format-latex:Skylighting.Format.LaTeX+                       , skylighting-format-typst:Skylighting.Format.Typst   other-modules:                        Skylighting.Syntax.Abc                        Skylighting.Syntax.Actionscript@@ -212,11 +213,12 @@                        Skylighting.Syntax.Zsh   other-extensions:    CPP   build-depends:       base >= 4.8 && < 5.0,-                       skylighting-core == 0.14.5,+                       skylighting-core == 0.14.6,                        skylighting-format-ansi >= 0.1 && < 0.2,                        skylighting-format-context >= 0.1 && < 0.2,                        skylighting-format-latex >= 0.1 && < 0.2,                        skylighting-format-blaze-html >= 0.1 && < 0.2,+                       skylighting-format-typst >= 0.1 && < 0.2,                        containers,                        binary   hs-source-dirs:      src
src/Skylighting.hs view
@@ -17,6 +17,7 @@   , module Skylighting.Format.ConTeXt   , module Skylighting.Format.HTML   , module Skylighting.Format.LaTeX+  , module Skylighting.Format.Typst   , module Skylighting.Loader    )@@ -27,6 +28,7 @@ import Skylighting.Format.ConTeXt import Skylighting.Format.HTML import Skylighting.Format.LaTeX+import Skylighting.Format.Typst import Skylighting.Parser import Skylighting.Regex import Skylighting.Styles