1
1
mirror of https://github.com/srid/ema.git synced 2024-11-25 20:12:20 +03:00
Haskell static site generator that is change-aware
Go to file
Sridhar Ratnakumar 27283651b7 Refactor examples
2021-04-19 15:41:24 -04:00
.github/workflows remove unused deps 2021-04-19 11:36:51 -04:00
.vscode initial commit of WIP code 2021-04-19 11:07:52 -04:00
bin initial commit of WIP code 2021-04-19 11:07:52 -04:00
src/Ema Refactor examples 2021-04-19 15:41:24 -04:00
.ghcid Refactor examples 2021-04-19 15:41:24 -04:00
.gitignore initial commit of WIP code 2021-04-19 11:07:52 -04:00
CHANGELOG.md initial commit of WIP code 2021-04-19 11:07:52 -04:00
ema.cabal Refactor examples 2021-04-19 15:41:24 -04:00
flake.lock initial commit of WIP code 2021-04-19 11:07:52 -04:00
flake.nix remove unused deps 2021-04-19 11:36:51 -04:00
hie.yaml initial commit of WIP code 2021-04-19 11:07:52 -04:00
LICENSE initial commit of WIP code 2021-04-19 11:07:52 -04:00
README.md refactor Ema.Route 2021-04-19 15:34:10 -04:00
shell.nix initial commit of WIP code 2021-04-19 11:07:52 -04:00

ema

ema is a WIP next-gen Haskell static site generator that is change-aware. In addition to static site generation, it provides a live server that hot-reload's on code or data change1.

The ultimate goal of ema is to make it possible to easily implement your own neuron, or just about any app that creates a browser view of arbitrarily changing data (on disk, database, or whatever). ema is designed to facilitate creation of apps whose data is normally edited via traditional mechanisms (eg: text editor) but rendered as a delightful web page - so as to provide an economical read-only view, of your data, on desktop & mobile.

The simplest ema app looks like this:

main :: IO ()
main = do
  let name :: Text = "Srid"
  runEmaPure $ \() ->
    encodeUtf8 $ "<b>Hello,</b> " <> name

Hacking

Open in VSCode, and run the build task.

TODO

  • MVP
  • Implement hot reload, and ditch browser-sync
  • Example: filesystem watcher
  • position re: hakyll

pre-announce,

  • refactor and simplify
  • examples
  • documentation (howto)

doc notes,

  • use async:race to avoid ghcid ghosts
  • at most one ws client supported right now
  • tailwind + blaze-html layout (BlazeWind?) for no-frills getting started

  1. At the moment, only data change triggers a true hot reload; but code change triggers reload via a full page refresh in the browser, which creates a subtle flicker. Ideally this should be improved somehow, possibly by persisting the server and websocket across ghci(d) restarts (cf. ghci-websockets). ↩︎