packages feed

pandoc-highlighting-extensions (empty) → 1.0.0.0

raw patch · 5 files changed

+183/−0 lines, 5 filesdep +basedep +data-default-classdep +pandoc

Dependencies added: base, data-default-class, pandoc, skylighting-core, skylighting-extensions, skylighting-modding, text

Files

+ changelog.md view
@@ -0,0 +1,3 @@+1.0.0.0++  * Initial release
+ library/Text/Pandoc/Highlighting/Extensions.hs view
@@ -0,0 +1,39 @@+{-# OPTIONS_GHC -Wall #-}++module Text.Pandoc.Highlighting.Extensions+  ( defaultSyntaxMap+  , extendedSyntaxMap+  ) where++-- data-default-class+import Data.Default.Class (def)++-- pandoc+import qualified Text.Pandoc as Pandoc++-- skylighting-extensions+import qualified Skylighting.Extensions++-- skylighting-modding+import Skylighting.Modding (SyntaxMap)++{- |++Pandoc's default syntax highlighting configuration.++-}++defaultSyntaxMap :: SyntaxMap+defaultSyntaxMap = Pandoc.writerSyntaxMap def++{- |++Pandoc's default syntax highlighting configuration, plus all extensions+provided by the @skylighting-extensions@ package. Use this for the value+of 'Pandoc.writerSyntaxMap' to use all of the extensions in your Pandoc+output.++-}++extendedSyntaxMap :: SyntaxMap+extendedSyntaxMap = Skylighting.Extensions.applyAll defaultSyntaxMap
+ library/Text/Pandoc/Highlighting/Extensions/WriterOptions.hs view
@@ -0,0 +1,79 @@+{-# OPTIONS_GHC -Wall #-}++{- |++Functions on 'WriterOptions' that modify the syntax highlighting.++-}++module Text.Pandoc.Highlighting.Extensions.WriterOptions+  ( applyAllSyntaxExtensions+  , modifySyntaxMap+  , modifySyntax+  , modifyContext+  ) where++-- pandoc+import Text.Pandoc (WriterOptions (..))++-- skylighting-core+import Skylighting.Types (Context, Syntax)++-- skylighting-extensions+import qualified Skylighting.Extensions++-- skylighting-modding+import Skylighting.Modding (SyntaxMap)+import qualified Skylighting.Modding++-- text+import Data.Text (Text)++{- |++Apply all of the syntax highlighting extensions provided by the+@skylighting-extensions@ package to Pandoc writer options.++-}++applyAllSyntaxExtensions :: WriterOptions -> WriterOptions+applyAllSyntaxExtensions = modifySyntaxMap Skylighting.Extensions.applyAll++{- |++Apply a function to the 'SyntaxMap' within Pandoc writer options.++-}++modifySyntaxMap :: (SyntaxMap -> SyntaxMap) -> WriterOptions -> WriterOptions+modifySyntaxMap f o = o{ writerSyntaxMap = f (writerSyntaxMap o) }++{- |++Modify a particular syntax by name.++-}++modifySyntax+    :: Text -- ^ Name of the syntax to modify+    -> (Syntax -> Syntax) -> WriterOptions -> WriterOptions++modifySyntax name =+    modifySyntaxMap .+    Skylighting.Modding.modifySyntax name++{- |++Modify a particular syntax context by name.++-}++modifyContext+    :: Text -- ^ Name of the syntax to modify+    -> Text -- ^ Name of the context to modify+    -> (Context -> Context) -> WriterOptions -> WriterOptions++modifyContext syntaxName contextName =+    modifySyntax syntaxName .+    Skylighting.Modding.modifySyntaxContexts .+    Skylighting.Modding.modifyContext contextName
+ license.txt view
@@ -0,0 +1,18 @@+Copyright 2019 Typeclass Consulting, LLC++Permission is hereby granted, free of charge, to any person obtaining a copy of+this software and associated documentation files (the "Software"), to deal in+the Software without restriction, including without limitation the rights to+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of+the Software, and to permit persons to whom the Software is furnished to do so,+subject to the following conditions:++The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ pandoc-highlighting-extensions.cabal view
@@ -0,0 +1,44 @@+cabal-version: 2.0++name: pandoc-highlighting-extensions+version: 1.0.0.0++synopsis: Syntax highlighting customization for Pandoc+category: Text++description:+    This package adapts the @skylighting-modding@ and+    @skylighting-extensions@ packages for use with Pandoc.++homepage:    https://github.com/typeclasses/pandoc-highlighting-ext+bug-reports: https://github.com/typeclasses/pandoc-highlighting-ext/issues++author:     Chris Martin+maintainer: Chris Martin, Julie Moronuki++copyright: 2018 Typeclass Consulting, LLC+license: MIT+license-file: license.txt++build-type: Simple+tested-with: GHC==8.6.1++extra-source-files:+    changelog.md++library+    hs-source-dirs: library+    default-language: Haskell2010++    exposed-modules:+        Text.Pandoc.Highlighting.Extensions+      , Text.Pandoc.Highlighting.Extensions.WriterOptions++    build-depends:+        base >=4.10 && <5+      , data-default-class+      , pandoc+      , skylighting-core+      , skylighting-extensions+      , skylighting-modding+      , text