Skip to content

Commit 1dbae61

Browse files
committed
Release 0.6; and unexpose examples
1 parent bd0d1ba commit 1dbae61

File tree

5 files changed

+12
-15
lines changed

5 files changed

+12
-15
lines changed

CHANGELOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Revision history for ema
22

3-
## Unreleased
3+
## 0.6.0.0 -- 2022-02-05
44

55
- Websocket API: Add `ema.switchRoute` to switch to other routes in live server.
66
- Smaller core: remove helpers and examples (examples can be enabled by a flag)
@@ -9,7 +9,7 @@
99
- `Ema.Helpers.FileSystem` moved to separate package *unionmount*.
1010
- `Ema.Helpers.Markdown` moved to separate package *commonmark-simple*.
1111
- `Ema.Helpers.Blaze` is no more. See `ema-template` if you need a ready made template using blaze HTML and TailwindCSS.
12-
- Examples `with-examples` cabal flag is made False by default.
12+
- Examples `with-examples` cabal flag is made False by default. Examples are not exposed modules.
1313
- `Ema.Route.Slug` moved to separate package *url-slug*
1414

1515
## 0.4.0.0 -- 2022-01-19

ema.cabal

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 2.4
22
name: ema
3-
version: 0.5.5.0
3+
version: 0.6.0.0
44
license: AGPL-3.0-only
55
copyright: 2021 Sridhar Ratnakumar
66
maintainer: [email protected]
@@ -38,7 +38,6 @@ library
3838
, containers
3939
, data-default
4040
, dependent-sum
41-
, url-slug
4241
, dependent-sum-template
4342
, directory
4443
, filepath
@@ -52,6 +51,7 @@ library
5251
, relude >=0.7 && <1.0
5352
, text
5453
, unliftio
54+
, url-slug
5555
, wai
5656
, wai-middleware-static
5757
, wai-websockets
@@ -128,7 +128,7 @@ library
128128
Ema.Server
129129

130130
if flag(with-examples)
131-
exposed-modules:
131+
other-modules:
132132
Ema.Example.Common
133133
Ema.Example.Ex01_HelloWorld
134134
Ema.Example.Ex02_Basic

src/Ema/Example/Common.hs

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
-- | Use Tailwind CSS with blaze-html? Try this module for rapid prototyping of
2-
-- websites in Ema.
31
module Ema.Example.Common
4-
( -- * Main functions
5-
twindLayout,
2+
( tailwindLayout,
63
)
74
where
85

@@ -12,8 +9,8 @@ import Text.Blaze.Html5 qualified as H
129
import Text.Blaze.Html5.Attributes qualified as A
1310

1411
-- | A simple and off-the-shelf layout using Tailwind CSS
15-
twindLayout :: H.Html -> H.Html -> LByteString
16-
twindLayout h b =
12+
tailwindLayout :: H.Html -> H.Html -> LByteString
13+
tailwindLayout h b =
1714
layoutWith "en" "UTF-8" (tailwind2ShimCdn >> h) $
1815
-- The "overflow-y-scroll" makes the scrollbar visible always, so as to
1916
-- avoid janky shifts when switching to routes with suddenly scrollable content.

src/Ema/Example/Ex02_Basic.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Data.LVar qualified as LVar
66
import Ema (Ema (..))
77
import Ema qualified
88
import Ema.CLI qualified as CLI
9-
import Ema.Example.Common (twindLayout)
9+
import Ema.Example.Common (tailwindLayout)
1010
import Text.Blaze.Html5 ((!))
1111
import Text.Blaze.Html5 qualified as H
1212
import Text.Blaze.Html5.Attributes qualified as A
@@ -38,7 +38,7 @@ main = do
3838

3939
render :: Model -> Route -> LByteString
4040
render model r =
41-
twindLayout (H.title "Basic site" >> H.base ! A.href "/") $
41+
tailwindLayout (H.title "Basic site" >> H.base ! A.href "/") $
4242
H.div ! A.class_ "container mx-auto" $ do
4343
H.div ! A.class_ "mt-8 p-2 text-center" $ do
4444
case r of

src/Ema/Example/Ex03_Clock.hs

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import Data.List ((!!))
1414
import Data.Time (UTCTime, defaultTimeLocale, formatTime, getCurrentTime)
1515
import Ema (Ema (..))
1616
import Ema qualified
17-
import Ema.Example.Common (twindLayout)
17+
import Ema.Example.Common (tailwindLayout)
1818
import Text.Blaze.Html5 ((!))
1919
import Text.Blaze.Html5 qualified as H
2020
import Text.Blaze.Html5.Attributes qualified as A
@@ -44,7 +44,7 @@ main = do
4444

4545
render :: UTCTime -> Route -> LByteString
4646
render now r =
47-
twindLayout (H.title "Clock" >> H.base ! A.href "/") $
47+
tailwindLayout (H.title "Clock" >> H.base ! A.href "/") $
4848
H.div ! A.class_ "container mx-auto" $ do
4949
H.div ! A.class_ "mt-8 p-2 text-center" $ do
5050
case r of

0 commit comments

Comments
 (0)