1
1
mirror of https://github.com/srid/ema.git synced 2024-12-01 23:23:42 +03:00
ema/README.md

64 lines
2.0 KiB
Markdown
Raw Normal View History

2021-04-19 17:48:00 +03:00
# ema
2021-04-20 22:20:12 +03:00
<img width="10%" src="./ema.svg">
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
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
2021-04-24 19:04:16 +03:00
## Quick Preview
If you have Nix installed with Flakes, give Ema a test-drive by running it to serve its own documentation:
```bash
2021-04-24 19:08:12 +03:00
PORT=8000 nix run github:srid/ema
2021-04-24 19:04:16 +03:00
```
2021-04-24 19:08:12 +03:00
NOTE: This will work if you have this repo's `./docs` directory locally. In future, ema should be made to include the docs in the nix derivation and reference it.
2021-04-19 18:07:52 +03:00
## Hacking
2021-04-20 18:14:29 +03:00
Run `bin/run` (or <kbd>Ctrl+Shift+B</kbd> in VSCode). This runs the clock example; modify `./.ghcid` to run a different example.
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
- [x] client to server reconnect (on ghcid reload, or accidental client disconnect)
- [x] or, investigate https://hackage.haskell.org/package/ghci-websockets
- [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
pre-announce,
2021-04-24 19:35:54 +03:00
- CLI UX
- [x] opts
- [ ] logging
- [ ] 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 03:18:38 +03:00
- [x] Avoid tailwind CDN in docs (use twind or windicss) for better lighthouse score
2021-04-19 18:07:52 +03:00
doc notes,
- hot reload fast, morphdom
- html templates + tailwind for fast style feedback
2021-04-19 18:07:52 +03:00
- use async:race to avoid ghcid ghosts
- tailwind + blaze-html layout (BlazeWind?) for no-frills getting started
2021-04-22 13:56:02 +03:00
- [dealing with errors](https://github.com/srid/memoir/issues/1)
- messaging re: hakyll
- safer/ simpler routes system
- bring your own templates / DSL
2021-04-24 19:35:54 +03:00
- messaging re: svelte
2021-04-24 18:35:52 +03:00
- SSE