diff --git a/bin/run b/bin/run index c68ed2b8e..5eabdf1ef 100755 --- a/bin/run +++ b/bin/run @@ -2,8 +2,9 @@ set -xe export PORT=9010 +nix flake lock # This will run ghcid, which uses `./.ghcid` to invoke your program main entry # point, with the specified args. # # If you change ./.ghcid, ghcid will automatically reload. -exec nix develop -c ghcid +exec nix-shell --run ghcid diff --git a/emanote.cabal b/emanote.cabal index c9b7bc003..7fca4fec1 100644 --- a/emanote.cabal +++ b/emanote.cabal @@ -1,6 +1,6 @@ cabal-version: 2.4 name: emanote -version: 0.1.64.1 +version: 0.3.0.0 license: AGPL-3.0-only copyright: 2021 Sridhar Ratnakumar maintainer: srid@srid.ca @@ -15,8 +15,7 @@ category: Web -- description: -- A URL where users can report bugs. --- bug-reports: - +bug-reports: https://github.com/srid/emanote/issues extra-source-files: LICENSE README.md @@ -79,15 +78,12 @@ executable emanote , xmlhtml , yaml - mixins: - base hiding (Prelude), - relude (Relude as Prelude, Relude.Container.One), - relude - ghc-options: - -Wall -Wincomplete-record-updates -Wincomplete-uni-patterns -threaded -rtsopts -with-rtsopts=-N + -Wall -Wincomplete-record-updates -Wincomplete-uni-patterns + -threaded -rtsopts -with-rtsopts=-N default-extensions: + NoImplicitPrelude FlexibleContexts FlexibleInstances KindSignatures diff --git a/flake.lock b/flake.lock index fb375bc57..c9d206cd2 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1632445658, - "narHash": "sha256-8TsRwLeuyLn2ZXwmTPx8+4arzUE9g0/i+KPSK4C9sVE=", + "lastModified": 1632525054, + "narHash": "sha256-vxA7Vhhhd77/a6OSk4bSK8rpVz9DFseATu7M8cQ9jsM=", "owner": "srid", "repo": "ema", - "rev": "8ecb900326170deede5a972b224ff46a4816d916", + "rev": "dfc9e7b9a7c917aa70b2dd6f8053df61778a72c6", "type": "github" }, "original": { @@ -102,17 +102,17 @@ }, "nixpkgs": { "locked": { - "lastModified": 1631315520, - "narHash": "sha256-Y8j0JYtZMifrHaWdTfTp1mYVXZ2PLJO/P0XZxMvo7KU=", + "lastModified": 1632146492, + "narHash": "sha256-+5LSb1alIWujWwFUZ2Juv1U9owBidLDONsz/T7ydDIY=", "owner": "nixos", "repo": "nixpkgs", - "rev": "b72ad04a8a324697d3fb92e19cd840379a902813", + "rev": "1a56d76d718afb6c47dd96602c915b6d23f7c45d", "type": "github" }, "original": { "owner": "nixos", "repo": "nixpkgs", - "rev": "b72ad04a8a324697d3fb92e19cd840379a902813", + "rev": "1a56d76d718afb6c47dd96602c915b6d23f7c45d", "type": "github" } }, diff --git a/src/Emanote/CLI.hs b/src/Emanote/CLI.hs index 6fcc0bbd1..57ef2608c 100644 --- a/src/Emanote/CLI.hs +++ b/src/Emanote/CLI.hs @@ -12,6 +12,7 @@ import Data.Version (showVersion) import qualified Ema.CLI import Options.Applicative hiding (action) import qualified Paths_emanote +import Relude import UnliftIO.Directory (getCurrentDirectory) data Cli = Cli diff --git a/src/Emanote/Model/Calendar.hs b/src/Emanote/Model/Calendar.hs index 2dec2f9de..300060279 100644 --- a/src/Emanote/Model/Calendar.hs +++ b/src/Emanote/Model/Calendar.hs @@ -9,6 +9,7 @@ import Emanote.Model.Title (Title) import Emanote.Model.Type (Model, modelLookupTitle) import Emanote.Route (LMLRoute) import qualified Emanote.Route as R +import Relude import qualified Text.Megaparsec as M import qualified Text.Megaparsec.Char as M diff --git a/src/Emanote/Model/Graph.hs b/src/Emanote/Model/Graph.hs index 8bf64397a..ff18996d3 100644 --- a/src/Emanote/Model/Graph.hs +++ b/src/Emanote/Model/Graph.hs @@ -16,8 +16,8 @@ import Emanote.Model.Type (Model, modelRels) import qualified Emanote.Pandoc.Markdown.Syntax.WikiLink as WL import qualified Emanote.Route as R import Emanote.Route.ModelRoute (ModelRoute) +import Relude hiding (empty) import qualified Text.Pandoc.Definition as B -import Prelude hiding (empty) -- TODO: Do breadth-first instead of depth-first modelFolgezettelAncestorTree :: ModelRoute -> Model -> Forest R.LMLRoute diff --git a/src/Emanote/Model/Link/Rel.hs b/src/Emanote/Model/Link/Rel.hs index a79e99013..cc459a646 100644 --- a/src/Emanote/Model/Link/Rel.hs +++ b/src/Emanote/Model/Link/Rel.hs @@ -18,6 +18,7 @@ import qualified Emanote.Pandoc.Markdown.Syntax.WikiLink as WL import Emanote.Route (LMLRoute, ModelRoute) import qualified Emanote.Route as R import qualified Emanote.Route.SiteRoute.Type as SR +import Relude import qualified Text.Pandoc.Definition as B import qualified Text.Pandoc.LinkContext as LC diff --git a/src/Emanote/Model/Link/Resolve.hs b/src/Emanote/Model/Link/Resolve.hs index cb1edd72e..3a345766b 100644 --- a/src/Emanote/Model/Link/Resolve.hs +++ b/src/Emanote/Model/Link/Resolve.hs @@ -11,6 +11,7 @@ import qualified Emanote.Model.Type as M import qualified Emanote.Pandoc.Markdown.Syntax.WikiLink as WL import qualified Emanote.Route as R import qualified Emanote.Route.SiteRoute as SR +import Relude resolveUnresolvedRelTarget :: Model -> diff --git a/src/Emanote/Model/Meta.hs b/src/Emanote/Model/Meta.hs index 5a87eab13..e07f9cb74 100644 --- a/src/Emanote/Model/Meta.hs +++ b/src/Emanote/Model/Meta.hs @@ -16,6 +16,7 @@ import Emanote.Model.Note (lookupAeson, _noteMeta) import Emanote.Model.SData (sdataValue) import qualified Emanote.Model.SData as SData import qualified Emanote.Route as R +import Relude -- | Look up a specific key in the meta for a given route. lookupRouteMeta :: FromJSON a => a -> NonEmpty Text -> R.LMLRoute -> Model -> a diff --git a/src/Emanote/Model/Note.hs b/src/Emanote/Model/Note.hs index 4a112bd5d..9da899f68 100644 --- a/src/Emanote/Model/Note.hs +++ b/src/Emanote/Model/Note.hs @@ -24,6 +24,7 @@ import qualified Emanote.Pandoc.Markdown.Syntax.HashTag as HT import qualified Emanote.Pandoc.Markdown.Syntax.WikiLink as WL import Emanote.Route (FileType (Folder), R) import qualified Emanote.Route as R +import Relude import Relude.Extra.Map (StaticMap (lookup)) import qualified Text.Pandoc.Builder as B import Text.Pandoc.Definition (Pandoc (..)) diff --git a/src/Emanote/Model/Query.hs b/src/Emanote/Model/Query.hs index fb39b467b..a6e0e70d8 100644 --- a/src/Emanote/Model/Query.hs +++ b/src/Emanote/Model/Query.hs @@ -14,6 +14,7 @@ import Emanote.Model.Type (Model, modelNotes, modelTags) import Emanote.Pandoc.Markdown.Syntax.HashTag (TagPattern) import qualified Emanote.Pandoc.Markdown.Syntax.HashTag as HT import qualified Emanote.Route as R +import Relude import System.FilePattern (FilePattern, (?==)) import qualified Text.Megaparsec as M import qualified Text.Megaparsec.Char as M diff --git a/src/Emanote/Model/SData.hs b/src/Emanote/Model/SData.hs index 2989635f4..872c19c42 100644 --- a/src/Emanote/Model/SData.hs +++ b/src/Emanote/Model/SData.hs @@ -15,6 +15,7 @@ import Data.IxSet.Typed (Indexable (..), IxSet, ixGen, ixList) import qualified Data.List.NonEmpty as NE import qualified Data.Yaml as Yaml import qualified Emanote.Route as R +import Relude -- | `S` for "structured". Refers to a per-route data file represented by Aeson -- value. Example: /foo/bar.yaml file diff --git a/src/Emanote/Model/StaticFile.hs b/src/Emanote/Model/StaticFile.hs index fb344243b..a841cc94a 100644 --- a/src/Emanote/Model/StaticFile.hs +++ b/src/Emanote/Model/StaticFile.hs @@ -13,6 +13,7 @@ import Data.IxSet.Typed (Indexable (..), IxSet, ixFun, ixList) import Data.Time (UTCTime) import qualified Emanote.Pandoc.Markdown.Syntax.WikiLink as WL import qualified Emanote.Route as R +import Relude data StaticFile = StaticFile { _staticFileRoute :: R.R 'R.AnyExt, diff --git a/src/Emanote/Model/Title.hs b/src/Emanote/Model/Title.hs index b580cb2b0..384f219d6 100644 --- a/src/Emanote/Model/Title.hs +++ b/src/Emanote/Model/Title.hs @@ -22,6 +22,7 @@ import qualified Emanote.Route as R import qualified Heist.Extra.Splices.Pandoc as HP import Heist.Extra.Splices.Pandoc.Render (plainify) import qualified Heist.Interpreted as HI +import Relude import qualified Text.Pandoc.Definition as B import qualified Text.Pandoc.Walk as W diff --git a/src/Emanote/Model/Type.hs b/src/Emanote/Model/Type.hs index a0e2b541f..09faf088b 100644 --- a/src/Emanote/Model/Type.hs +++ b/src/Emanote/Model/Type.hs @@ -34,6 +34,7 @@ import qualified Emanote.Pandoc.Markdown.Syntax.WikiLink as WL import Emanote.Route (FileType (AnyExt), LMLRoute, R) import qualified Emanote.Route as R import Heist.Extra.TemplateState (TemplateState) +import Relude data Status = Status_Loading | Status_Ready deriving (Eq, Show) diff --git a/src/Emanote/Pandoc/BuiltinFilters.hs b/src/Emanote/Pandoc/BuiltinFilters.hs index 489b8befd..25fb5929e 100644 --- a/src/Emanote/Pandoc/BuiltinFilters.hs +++ b/src/Emanote/Pandoc/BuiltinFilters.hs @@ -7,6 +7,7 @@ where import Emanote.Model.Type (Model) import qualified Emanote.Pandoc.Markdown.Syntax.HashTag as HT import qualified Emanote.Route.SiteRoute.Class as SR +import Relude import qualified Text.Pandoc.Definition as B import qualified Text.Pandoc.Walk as W diff --git a/src/Emanote/Pandoc/Link.hs b/src/Emanote/Pandoc/Link.hs index e47bf60f4..402b9fe7b 100644 --- a/src/Emanote/Pandoc/Link.hs +++ b/src/Emanote/Pandoc/Link.hs @@ -4,6 +4,7 @@ module Emanote.Pandoc.Link where import Ema.Helper.Markdown (plainify) import qualified Emanote.Pandoc.Markdown.Syntax.WikiLink as WL +import Relude import qualified Text.Pandoc.Definition as B -- | A Pandoc inline node that refers to something else. diff --git a/src/Emanote/Pandoc/Markdown/Parser.hs b/src/Emanote/Pandoc/Markdown/Parser.hs index 026d58e75..82a4ea76f 100644 --- a/src/Emanote/Pandoc/Markdown/Parser.hs +++ b/src/Emanote/Pandoc/Markdown/Parser.hs @@ -12,6 +12,7 @@ import Ema.Helper.Markdown (parseMarkdownWithFrontMatter) import qualified Emanote.Pandoc.Markdown.Syntax.HashTag as IT import qualified Emanote.Pandoc.Markdown.Syntax.Highlight as IH import qualified Emanote.Pandoc.Markdown.Syntax.WikiLink as WL +import Relude import Text.Pandoc.Definition (Pandoc) parseMarkdown :: FilePath -> Text -> Either Text (Maybe Aeson.Value, Pandoc) diff --git a/src/Emanote/Pandoc/Markdown/Syntax/HashTag.hs b/src/Emanote/Pandoc/Markdown/Syntax/HashTag.hs index b83f9d0a4..dfc53c818 100644 --- a/src/Emanote/Pandoc/Markdown/Syntax/HashTag.hs +++ b/src/Emanote/Pandoc/Markdown/Syntax/HashTag.hs @@ -25,6 +25,7 @@ import qualified Commonmark.Pandoc as CP import Commonmark.TokParsers (noneOfToks, symbol) import qualified Data.Map.Strict as Map import qualified Data.TagTree as TT +import Relude import qualified Text.Pandoc.Builder as B import qualified Text.Pandoc.Walk as W import qualified Text.Parsec as P diff --git a/src/Emanote/Pandoc/Markdown/Syntax/Highlight.hs b/src/Emanote/Pandoc/Markdown/Syntax/Highlight.hs index be1a87a44..9388ee59c 100644 --- a/src/Emanote/Pandoc/Markdown/Syntax/Highlight.hs +++ b/src/Emanote/Pandoc/Markdown/Syntax/Highlight.hs @@ -11,6 +11,7 @@ where import qualified Commonmark as CM import qualified Commonmark.Inlines as CM import qualified Commonmark.Pandoc as CP +import Relude import qualified Text.Pandoc.Builder as B highlightSpec :: diff --git a/src/Emanote/Pandoc/Markdown/Syntax/WikiLink.hs b/src/Emanote/Pandoc/Markdown/Syntax/WikiLink.hs index e0bf0bdd6..5b85a18a9 100644 --- a/src/Emanote/Pandoc/Markdown/Syntax/WikiLink.hs +++ b/src/Emanote/Pandoc/Markdown/Syntax/WikiLink.hs @@ -31,6 +31,7 @@ import qualified Ema import Ema.Helper.Markdown (plainify) import Emanote.Route.R (R (..)) import qualified Network.URI.Encode as UE +import Relude import qualified Text.Megaparsec as M import qualified Text.Pandoc.Builder as B import qualified Text.Parsec as P diff --git a/src/Emanote/Pandoc/Renderer.hs b/src/Emanote/Pandoc/Renderer.hs index 874e207bc..87c7d95b7 100644 --- a/src/Emanote/Pandoc/Renderer.hs +++ b/src/Emanote/Pandoc/Renderer.hs @@ -23,6 +23,7 @@ import Heist (HeistT) import qualified Heist.Extra.Splices.Pandoc as Splices import qualified Heist.Extra.Splices.Pandoc.Ctx as Splices import qualified Heist.Interpreted as HI +import Relude import qualified Text.Pandoc.Definition as B -- | Custom Heist renderer function for specific Pandoc AST nodes diff --git a/src/Emanote/Pandoc/Renderer/Embed.hs b/src/Emanote/Pandoc/Renderer/Embed.hs index 2ab13e4fd..8b455d488 100644 --- a/src/Emanote/Pandoc/Renderer/Embed.hs +++ b/src/Emanote/Pandoc/Renderer/Embed.hs @@ -23,6 +23,7 @@ import qualified Heist.Extra as HE import Heist.Extra.Splices.Pandoc (pandocSplice) import qualified Heist.Extra.Splices.Pandoc as HP import qualified Heist.Interpreted as HI +import Relude import qualified Text.Pandoc.Definition as B embedBlockWikiLinkResolvingSplice :: diff --git a/src/Emanote/Pandoc/Renderer/Query.hs b/src/Emanote/Pandoc/Renderer/Query.hs index b46274c14..5d3925964 100644 --- a/src/Emanote/Pandoc/Renderer/Query.hs +++ b/src/Emanote/Pandoc/Renderer/Query.hs @@ -23,6 +23,7 @@ import qualified Heist.Extra as HE import Heist.Extra.Splices.Pandoc (RenderCtx) import qualified Heist.Interpreted as HI import qualified Heist.Splices.Json as HJ +import Relude import qualified Text.Pandoc.Definition as B queryResolvingSplice :: forall n i. Monad n => PandocBlockRenderer n i LMLRoute diff --git a/src/Emanote/Pandoc/Renderer/Url.hs b/src/Emanote/Pandoc/Renderer/Url.hs index cbb1bda8f..430c17dab 100644 --- a/src/Emanote/Pandoc/Renderer/Url.hs +++ b/src/Emanote/Pandoc/Renderer/Url.hs @@ -27,6 +27,7 @@ import qualified Heist.Extra.Splices.Pandoc as HP import qualified Heist.Extra.Splices.Pandoc as Splices import Heist.Extra.Splices.Pandoc.Ctx (ctxSansCustomSplicing) import qualified Heist.Interpreted as HI +import Relude import qualified Text.Pandoc.Definition as B import qualified Text.Pandoc.Walk as W diff --git a/src/Emanote/Prelude.hs b/src/Emanote/Prelude.hs index 1924da70c..87923e0ba 100644 --- a/src/Emanote/Prelude.hs +++ b/src/Emanote/Prelude.hs @@ -14,6 +14,7 @@ import Data.WorldPeace.Union Remove, openUnionHandle, ) +import Relude -- | Monadic version of `chain` chainM :: Monad m => (b -> m (a -> a)) -> [b] -> m (a -> a) diff --git a/src/Emanote/Route/Ext.hs b/src/Emanote/Route/Ext.hs index e3f9c79d2..bbd3252c6 100644 --- a/src/Emanote/Route/Ext.hs +++ b/src/Emanote/Route/Ext.hs @@ -9,8 +9,8 @@ module Emanote.Route.Ext where import Data.Aeson (ToJSON) import Data.Data (Data) +import Relude hiding (show) import qualified System.FilePath as FP -import Prelude hiding (show) data FileType = LMLType LML diff --git a/src/Emanote/Route/ModelRoute.hs b/src/Emanote/Route/ModelRoute.hs index 3aa5ab806..83ff5e823 100644 --- a/src/Emanote/Route/ModelRoute.hs +++ b/src/Emanote/Route/ModelRoute.hs @@ -30,6 +30,7 @@ import Data.WorldPeace.Union import Emanote.Route.Ext (FileType (AnyExt, LMLType), LML (Md)) import Emanote.Route.R (R) import qualified Emanote.Route.R as R +import Relude type LMLRoutes' = '[ R ('LMLType 'Md) diff --git a/src/Emanote/Route/R.hs b/src/Emanote/Route/R.hs index 1b157250b..b8450ea59 100644 --- a/src/Emanote/Route/R.hs +++ b/src/Emanote/Route/R.hs @@ -13,6 +13,7 @@ import qualified Data.Text as T import Ema (Slug) import qualified Ema import Emanote.Route.Ext (FileType (AnyExt, Folder, Html), HasExt (..)) +import Relude import System.FilePath (splitPath) import qualified Text.Show (Show (show)) diff --git a/src/Emanote/Route/SiteRoute/Class.hs b/src/Emanote/Route/SiteRoute/Class.hs index eadc0414c..76a2eaef7 100644 --- a/src/Emanote/Route/SiteRoute/Class.hs +++ b/src/Emanote/Route/SiteRoute/Class.hs @@ -37,6 +37,7 @@ import qualified Emanote.Route as R import Emanote.Route.ModelRoute (LMLRoute, StaticFileRoute) import Emanote.Route.SiteRoute.Type import qualified Emanote.View.LiveServerFiles as LiveServerFile +import Relude instance Ema Model SiteRoute where encodeRoute :: HasCallStack => Model -> SiteRoute -> FilePath diff --git a/src/Emanote/Route/SiteRoute/Type.hs b/src/Emanote/Route/SiteRoute/Type.hs index 8fb63e8f3..5480289fa 100644 --- a/src/Emanote/Route/SiteRoute/Type.hs +++ b/src/Emanote/Route/SiteRoute/Type.hs @@ -27,8 +27,8 @@ import Emanote.Prelude (h) import qualified Emanote.Route.Ext as Ext import Emanote.Route.ModelRoute (LMLRoute, StaticFileRoute, lmlRouteCase) import qualified Emanote.Route.R as R +import Relude hiding (show) import Text.Show (show) -import Prelude hiding (show) data IndexR = IndexR deriving (Eq, Show, Ord) diff --git a/src/Emanote/Source.hs b/src/Emanote/Source.hs index 5f71bc39f..9a4e638c3 100644 --- a/src/Emanote/Source.hs +++ b/src/Emanote/Source.hs @@ -16,6 +16,7 @@ import Emanote.Prelude (log) import Emanote.Source.Loc import Emanote.Source.Patch (transformActions) import Emanote.Source.Pattern (filePatterns, ignorePatterns) +import Relude import UnliftIO (MonadUnliftIO) -- | Emanate on-disk sources onto an in-memory `Model` (stored in a LVar) diff --git a/src/Emanote/Source/Loc.hs b/src/Emanote/Source/Loc.hs index a61495c9a..1c24a07e9 100644 --- a/src/Emanote/Source/Loc.hs +++ b/src/Emanote/Source/Loc.hs @@ -2,6 +2,7 @@ module Emanote.Source.Loc where import qualified Paths_emanote +import Relude import System.FilePath (()) -- | Location of the notebook, even if it contains a subset of files. diff --git a/src/Emanote/Source/Patch.hs b/src/Emanote/Source/Patch.hs index 1296f8618..788140cd8 100644 --- a/src/Emanote/Source/Patch.hs +++ b/src/Emanote/Source/Patch.hs @@ -36,6 +36,7 @@ import qualified Emanote.Route as R import Emanote.Source.Loc (Loc, locResolve) import Emanote.Source.Pattern (filePatterns, ignorePatterns) import qualified Heist.Extra.TemplateState as T +import Relude import UnliftIO (BufferMode (..), hSetBuffering) import UnliftIO.Concurrent (threadDelay) import UnliftIO.Directory (doesDirectoryExist) diff --git a/src/Emanote/Source/Pattern.hs b/src/Emanote/Source/Pattern.hs index a02c048be..5cc507eed 100644 --- a/src/Emanote/Source/Pattern.hs +++ b/src/Emanote/Source/Pattern.hs @@ -4,6 +4,7 @@ module Emanote.Source.Pattern where import qualified Emanote.Route as R +import Relude import System.FilePattern (FilePattern) filePattern :: HasCallStack => R.FileType -> FilePath diff --git a/src/Emanote/View/Common.hs b/src/Emanote/View/Common.hs index 315bc14f6..49dc92c4e 100644 --- a/src/Emanote/View/Common.hs +++ b/src/Emanote/View/Common.hs @@ -40,6 +40,7 @@ import qualified Heist.Splices.Apply as HA import qualified Heist.Splices.Bind as HB import qualified Heist.Splices.Json as HJ import qualified Paths_emanote +import Relude import Text.Blaze.Html ((!)) import qualified Text.Blaze.Html5 as H import qualified Text.Blaze.Html5.Attributes as A diff --git a/src/Emanote/View/LiveServerFiles.hs b/src/Emanote/View/LiveServerFiles.hs index 9fe01cc47..de54bc629 100644 --- a/src/Emanote/View/LiveServerFiles.hs +++ b/src/Emanote/View/LiveServerFiles.hs @@ -5,6 +5,7 @@ module Emanote.View.LiveServerFiles where import qualified Data.Text as T +import Relude -- TODO: Check this compile-time using TH? diff --git a/src/Emanote/View/TagIndex.hs b/src/Emanote/View/TagIndex.hs index 783500238..aa9a5869d 100644 --- a/src/Emanote/View/TagIndex.hs +++ b/src/Emanote/View/TagIndex.hs @@ -20,6 +20,7 @@ import Emanote.View.Common (commonSplices, inlineRenderers, mkRendererFromMeta, import qualified Heist.Extra.Splices.List as Splices import Heist.Extra.Splices.Pandoc.Ctx (emptyRenderCtx) import qualified Heist.Interpreted as HI +import Relude -- An index view into the notebook indexed by the given tag path. data TagIndex = TagIndex diff --git a/src/Emanote/View/Template.hs b/src/Emanote/View/Template.hs index 58d95a8d0..7655c2179 100644 --- a/src/Emanote/View/Template.hs +++ b/src/Emanote/View/Template.hs @@ -38,6 +38,7 @@ import Heist.Extra.Splices.Pandoc.Ctx (emptyRenderCtx) import qualified Heist.Extra.Splices.Tree as Splices import qualified Heist.Interpreted as HI import qualified Heist.Splices as Heist +import Relude import qualified Shower import qualified Text.Pandoc.Builder as B import Text.Pandoc.Definition (Pandoc (..)) diff --git a/src/Heist/Extra.hs b/src/Heist/Extra.hs index 9f0a08bc1..4da9ef2aa 100644 --- a/src/Heist/Extra.hs +++ b/src/Heist/Extra.hs @@ -7,6 +7,7 @@ import qualified Heist as H import qualified Heist.Common as H import qualified Heist.Internal.Types as HT import qualified Heist.Interpreted as HI +import Relude import qualified Text.XmlHtml as X -- | Useful for running a splice against an arbitrary node (such as that pulled from pandoc.tpl) diff --git a/src/Heist/Extra/Splices/List.hs b/src/Heist/Extra/Splices/List.hs index 4dca3b6eb..2da8d792e 100644 --- a/src/Heist/Extra/Splices/List.hs +++ b/src/Heist/Extra/Splices/List.hs @@ -5,6 +5,7 @@ module Heist.Extra.Splices.List where import Data.Map.Syntax ((##)) import qualified Heist as H import qualified Heist.Interpreted as HI +import Relude -- | A splice that applies a non-empty list listSplice :: Monad n => [a] -> Text -> (a -> H.Splices (HI.Splice n)) -> HI.Splice n diff --git a/src/Heist/Extra/Splices/Pandoc.hs b/src/Heist/Extra/Splices/Pandoc.hs index dce30743d..78c5c9e21 100644 --- a/src/Heist/Extra/Splices/Pandoc.hs +++ b/src/Heist/Extra/Splices/Pandoc.hs @@ -27,6 +27,7 @@ import Heist.Extra.Splices.Pandoc.Render rpInline, ) import qualified Heist.Interpreted as HI +import Relude import Text.Pandoc.Definition (Pandoc (..)) -- | A splice to render a Pandoc AST diff --git a/src/Heist/Extra/Splices/Pandoc/Attr.hs b/src/Heist/Extra/Splices/Pandoc/Attr.hs index a238f76c4..fa121a33c 100644 --- a/src/Heist/Extra/Splices/Pandoc/Attr.hs +++ b/src/Heist/Extra/Splices/Pandoc/Attr.hs @@ -1,6 +1,7 @@ module Heist.Extra.Splices.Pandoc.Attr where import qualified Data.Text as T +import Relude import qualified Text.Pandoc.Definition as B -- | Convert Pandoc attributes to XmlHtml attributes diff --git a/src/Heist/Extra/Splices/Pandoc/Ctx.hs b/src/Heist/Extra/Splices/Pandoc/Ctx.hs index 48104c69c..fd4982c7f 100644 --- a/src/Heist/Extra/Splices/Pandoc/Ctx.hs +++ b/src/Heist/Extra/Splices/Pandoc/Ctx.hs @@ -15,6 +15,7 @@ import qualified Data.Text as T import qualified Heist as H import Heist.Extra.Splices.Pandoc.Attr (concatAttr) import qualified Heist.Interpreted as HI +import Relude import qualified Text.Pandoc.Builder as B import qualified Text.XmlHtml as X diff --git a/src/Heist/Extra/Splices/Pandoc/Footnotes.hs b/src/Heist/Extra/Splices/Pandoc/Footnotes.hs index e835ffb43..05feb3b81 100644 --- a/src/Heist/Extra/Splices/Pandoc/Footnotes.hs +++ b/src/Heist/Extra/Splices/Pandoc/Footnotes.hs @@ -7,6 +7,7 @@ import Heist.Extra (runCustomNode) import Heist.Extra.Splices.Pandoc.Ctx (RenderCtx (rootNode)) import Heist.Extra.Splices.Pandoc.Render (renderPandocWith) import qualified Heist.Interpreted as HI +import Relude import qualified Text.Pandoc.Builder as B import Text.Pandoc.Definition (Pandoc (..)) import qualified Text.Pandoc.Walk as W diff --git a/src/Heist/Extra/Splices/Pandoc/Render.hs b/src/Heist/Extra/Splices/Pandoc/Render.hs index 8c979b17d..e5def39e6 100644 --- a/src/Heist/Extra/Splices/Pandoc/Render.hs +++ b/src/Heist/Extra/Splices/Pandoc/Render.hs @@ -22,6 +22,7 @@ import Heist.Extra.Splices.Pandoc.Ctx rewriteClass, ) import qualified Heist.Interpreted as HI +import Relude import qualified Text.Pandoc.Builder as B import Text.Pandoc.Definition (Pandoc (..)) import qualified Text.Pandoc.Walk as W diff --git a/src/Heist/Extra/Splices/Tree.hs b/src/Heist/Extra/Splices/Tree.hs index 0f052b92e..4d543f7e2 100644 --- a/src/Heist/Extra/Splices/Tree.hs +++ b/src/Heist/Extra/Splices/Tree.hs @@ -11,6 +11,7 @@ import Data.Tree (Tree (..)) import qualified Heist as H import qualified Heist.Interpreted as HI import qualified Heist.Splices as Heist +import Relude treeSplice :: forall a n sortKey. diff --git a/src/Heist/Extra/TemplateState.hs b/src/Heist/Extra/TemplateState.hs index 37a92b892..bda029bdc 100644 --- a/src/Heist/Extra/TemplateState.hs +++ b/src/Heist/Extra/TemplateState.hs @@ -25,6 +25,7 @@ import qualified Heist as H import qualified Heist.Common as H import qualified Heist.Internal.Types as HT import qualified Heist.Interpreted as HI +import Relude import System.FilePath (splitExtension) import qualified Text.XmlHtml as XmlHtml diff --git a/src/Main.hs b/src/Main.hs index 5c4a9f504..a1aff91e4 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -8,6 +8,7 @@ import qualified Emanote.Model as Model import qualified Emanote.Source as Source import qualified Emanote.View as View import Main.Utf8 (withUtf8) +import Relude main :: IO () main =