Skip to content

Commit

Permalink
nix: Update ema (again)
Browse files Browse the repository at this point in the history
  • Loading branch information
srid committed Dec 11, 2023
1 parent 0610cfc commit 06021a1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 21 deletions.
4 changes: 1 addition & 3 deletions emanote/emanote.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.4
name: emanote
version: 1.2.1.3
version: 1.2.1.4
license: AGPL-3.0-only
copyright: 2022 Sridhar Ratnakumar
maintainer: [email protected]
Expand Down Expand Up @@ -104,7 +104,6 @@ common library-common
, commonmark-wikilink
, containers
, data-default
, dependent-sum
, deriving-aeson
, directory
, ema >=0.10.1
Expand Down Expand Up @@ -138,7 +137,6 @@ common library-common
, profunctors
, relude >=1.0
, shower
, some
, stm
, tagged
, tagtree
Expand Down
16 changes: 6 additions & 10 deletions emanote/src/Emanote.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import Control.Monad.Logger (LogLevel (LevelError), runStderrLoggingT, runStdout
import Control.Monad.Logger.Extras (Logger (Logger), logToStderr, runLoggerLoggingT)
import Control.Monad.Writer.Strict (MonadWriter (tell), WriterT (runWriterT))
import Data.Default (def)
import Data.Dependent.Sum (DSum ((:=>)))
import Data.Map.Strict qualified as Map
import Ema (
EmaSite (..),
Expand Down Expand Up @@ -83,15 +82,12 @@ run cfg@EmanoteConfig {..} = do
then f loc src level msg
else pass

postRun :: EmanoteConfig -> (Model.ModelEma, DSum Ema.CLI.Action Identity) -> IO ()
postRun EmanoteConfig {..} = \case
(unModelEma -> model0, Ema.CLI.Generate outPath :=> Identity genPaths) -> do
when (model0 ^. modelCompileTailwind) $
compileTailwindCss (outPath </> generatedCssFile) genPaths
checkBrokenLinks _emanoteConfigCli $ Export.modelRels model0
checkBadMarkdownFiles $ Model.modelNoteErrors model0
_ ->
pass
postRun :: EmanoteConfig -> (Model.ModelEma, (FilePath, [FilePath])) -> IO ()
postRun EmanoteConfig {..} (unModelEma -> model0, (outPath, genPaths)) = do
when (model0 ^. modelCompileTailwind) $
compileTailwindCss (outPath </> generatedCssFile) genPaths
checkBrokenLinks _emanoteConfigCli $ Export.modelRels model0
checkBadMarkdownFiles $ Model.modelNoteErrors model0

unModelEma :: Model.ModelEma -> Model.Model
unModelEma m = Model.withRoutePrism (fromPrism_ $ routePrism @SiteRoute m) m
Expand Down
5 changes: 2 additions & 3 deletions emanote/src/Emanote/Model/Type.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import Data.Default (Default (def))
import Data.IxSet.Typed ((@=))
import Data.IxSet.Typed qualified as Ix
import Data.Map.Strict qualified as Map
import Data.Some (Some)
import Data.Time (UTCTime)
import Data.Tree (Tree)
import Data.Tree.Path qualified as PathTree
Expand Down Expand Up @@ -53,7 +52,7 @@ data Status = Status_Loading | Status_Ready
data ModelT encF = Model
{ _modelStatus :: Status
, _modelLayers :: Set Loc
, _modelEmaCLIAction :: Some Ema.CLI.Action
, _modelEmaCLIAction :: Ema.CLI.Action
, _modelRoutePrism :: encF (Prism' FilePath SiteRoute)
, _modelPandocRenderers :: EmanotePandocRenderers Model LMLRoute
-- ^ Dictates how exactly to render `Pandoc` to Heist nodes.
Expand Down Expand Up @@ -96,7 +95,7 @@ withRoutePrism enc Model {..} =
let _modelRoutePrism = Identity enc
in Model {..}

emptyModel :: Set Loc -> Some Ema.CLI.Action -> EmanotePandocRenderers Model LMLRoute -> Bool -> UUID -> Stork.IndexVar -> ModelEma
emptyModel :: Set Loc -> Ema.CLI.Action -> EmanotePandocRenderers Model LMLRoute -> Bool -> UUID -> Stork.IndexVar -> ModelEma
emptyModel layers act ren ctw instanceId =
Model Status_Loading layers act (Const ()) ren ctw instanceId Ix.empty Ix.empty Ix.empty Ix.empty mempty mempty def

Expand Down
3 changes: 1 addition & 2 deletions emanote/src/Emanote/Source/Dynamic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ module Emanote.Source.Dynamic (
import Control.Monad.Logger (MonadLogger, MonadLoggerIO)
import Data.Map.Strict qualified as Map
import Data.Set qualified as Set
import Data.Some (Some)
import Data.UUID.V4 qualified as UUID
import Ema (Dynamic (..))
import Ema.CLI qualified
Expand Down Expand Up @@ -51,7 +50,7 @@ data EmanoteConfig = EmanoteConfig
The bulk of logic for building the Dynamic is in `Patch.hs`.
-}
emanoteSiteInput :: (MonadUnliftIO m, MonadLoggerIO m) => Some Ema.CLI.Action -> EmanoteConfig -> m (Dynamic m Model.ModelEma)
emanoteSiteInput :: (MonadUnliftIO m, MonadLoggerIO m) => Ema.CLI.Action -> EmanoteConfig -> m (Dynamic m Model.ModelEma)
emanoteSiteInput cliAct EmanoteConfig {..} = do
defaultLayer <- Loc.defaultLayer <$> liftIO Paths_emanote.getDataDir
instanceId <- liftIO UUID.nextRandom
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

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

0 comments on commit 06021a1

Please sign in to comment.