Skip to content

Commit

Permalink
Advance nixpkgs (via ema) and increment version
Browse files Browse the repository at this point in the history
Drop implicit prelude because of kowainik/policeman#65

New nixpkgs appears to have broke HLS in vscode, but whatever.
  • Loading branch information
srid committed Sep 24, 2021
1 parent f41f26f commit 746c9ae
Show file tree
Hide file tree
Showing 49 changed files with 60 additions and 20 deletions.
3 changes: 2 additions & 1 deletion bin/run
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 5 additions & 9 deletions emanote.cabal
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Emanote/CLI.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/Emanote/Model/Calendar.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/Emanote/Model/Graph.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/Emanote/Model/Link/Rel.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions src/Emanote/Model/Link/Resolve.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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 ->
Expand Down
1 change: 1 addition & 0 deletions src/Emanote/Model/Meta.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/Emanote/Model/Note.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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 (..))
Expand Down
1 change: 1 addition & 0 deletions src/Emanote/Model/Query.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/Emanote/Model/SData.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/Emanote/Model/StaticFile.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/Emanote/Model/Title.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions src/Emanote/Model/Type.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/Emanote/Pandoc/BuiltinFilters.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions src/Emanote/Pandoc/Link.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions src/Emanote/Pandoc/Markdown/Parser.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/Emanote/Pandoc/Markdown/Syntax/HashTag.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/Emanote/Pandoc/Markdown/Syntax/Highlight.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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 ::
Expand Down
1 change: 1 addition & 0 deletions src/Emanote/Pandoc/Markdown/Syntax/WikiLink.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/Emanote/Pandoc/Renderer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/Emanote/Pandoc/Renderer/Embed.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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 ::
Expand Down
1 change: 1 addition & 0 deletions src/Emanote/Pandoc/Renderer/Query.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/Emanote/Pandoc/Renderer/Url.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions src/Emanote/Prelude.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/Emanote/Route/Ext.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/Emanote/Route/ModelRoute.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/Emanote/Route/R.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
1 change: 1 addition & 0 deletions src/Emanote/Route/SiteRoute/Class.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Emanote/Route/SiteRoute/Type.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/Emanote/Source.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/Emanote/Source/Loc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions src/Emanote/Source/Patch.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/Emanote/Source/Pattern.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/Emanote/View/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/Emanote/View/LiveServerFiles.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module Emanote.View.LiveServerFiles
where

import qualified Data.Text as T
import Relude

-- TODO: Check this compile-time using TH?

Expand Down
1 change: 1 addition & 0 deletions src/Emanote/View/TagIndex.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/Emanote/View/Template.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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 (..))
Expand Down
1 change: 1 addition & 0 deletions src/Heist/Extra.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/Heist/Extra/Splices/List.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 746c9ae

Please sign in to comment.