2021-04-19 17:48:00 +03:00
# ema
2021-04-25 20:15:30 +03:00
< img width = "10%" src = "./docs/ema.svg" >
2021-04-20 22:20:12 +03:00
2021-04-24 20:44:53 +03:00
Ema is a next-gen **Haskell** library for building [jamstack-style ](https://jamstack.org/ ) static sites, with fast hot reload. See [ema.srid.ca ](https://ema.srid.ca/ ) for documentation.
2021-04-19 17:48:00 +03:00
2021-04-24 20:44:53 +03:00
The simplest Ema app looks like this:
2021-04-19 18:18:38 +03:00
```haskell
main :: IO ()
main = do
2021-04-22 23:46:02 +03:00
let name :: Text = "Ema"
runEmaPure $
encodeUtf8 $ "< b > Hello< / b > , from " < > name
2021-04-19 18:18:38 +03:00
```
2021-04-19 18:07:52 +03:00
## Hacking
2021-04-25 21:14:08 +03:00
Run `bin/run` (or < kbd > Ctrl+Shift+B</ kbd > in VSCode). This runs the documentation example; modify `./.ghcid` to run a different example, such as the clock example - which updates every second, demonstrating hot reload.
2021-04-19 18:07:52 +03:00
## TODO
- [x] MVP
2021-04-19 22:34:10 +03:00
- [x] Implement hot reload, and ditch browser-sync
2021-04-19 18:07:52 +03:00
- [x] server to client refresh
2021-04-19 22:22:41 +03:00
- [x] client to server reconnect (on ghcid reload, or accidental client disconnect)
- [x] or, investigate https://hackage.haskell.org/package/ghci-websockets
2021-04-20 03:05:18 +03:00
- [x] Multi-websocket-client support
2021-04-22 23:11:21 +03:00
- [x] Static site generation mode
2021-04-24 19:35:54 +03:00
- [x] add common examples,
2021-04-21 00:51:14 +03:00
- [x] filesystem watcher
2021-04-24 19:35:54 +03:00
- [x] docs site for self (w/ breadcrumbs and possibly even search)
2021-04-20 01:51:27 +03:00
2021-04-19 22:22:41 +03:00
pre-announce,
2021-04-24 19:35:54 +03:00
- CLI UX
- [x] opts
- [ ] logging
2021-04-25 21:14:08 +03:00
- Expose it to apps (inc/ helpers) in a simple way
2021-04-25 06:25:04 +03:00
- [x] [deal with errors ](https://github.com/srid/memoir/issues/1 )
2021-04-25 20:15:30 +03:00
- [x] How to serve non-generated files (css, img, etc.)
2021-04-21 00:51:14 +03:00
- [ ] Publish Data.LVar to Hackage
2021-04-25 03:36:29 +03:00
- [ ] documentation ([guide](https://documentation.divio.com/))
2021-04-25 04:53:37 +03:00
- [x] Avoid tailwind CDN in docs (use twind or windicss) for better lighthouse score