1
1
mirror of https://github.com/srid/ema.git synced 2024-11-26 06:03:50 +03:00
Haskell static site generator that is change-aware
Go to file
Sridhar Ratnakumar d83611a3e1 Introduce Ema type-class
Replacing IsRoute type class.

The new type-class is useful for a 3rd method, `modelRoutes` that returns all routes for the given model. IsRoute cannot do this, as it is not parametrized over model.
2021-04-22 16:39:06 -04:00
.github/workflows remove unused deps 2021-04-19 11:36:51 -04:00
.vscode Add script to run via tmux 2021-04-21 20:43:03 -04:00
bin Smooth route click (#9) 2021-04-22 10:34:01 -04:00
src Introduce Ema type-class 2021-04-22 16:39:06 -04:00
.ghcid Revert .ghcid to clock example 2021-04-20 15:23:21 -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
default.nix Add default.nix for legacy nix 2021-04-20 18:00:55 -04:00
ema.cabal Introduce Ema type-class 2021-04-22 16:39:06 -04:00
ema.svg Add logo 2021-04-20 15:20:12 -04:00
flake.lock Add Diary example using org-mode and fsnotify (#2) 2021-04-20 15:04:48 -04:00
flake.nix Add Diary example using org-mode and fsnotify (#2) 2021-04-20 15:04:48 -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 Create intermediate directories 2021-04-22 16:11:21 -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 change.

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

Run bin/run (or Ctrl+Shift+B in VSCode). This runs the clock example; modify ./.ghcid to run a different example.

TODO

  • MVP
  • Implement hot reload, and ditch browser-sync
  • Multi-websocket-client support
  • Static site generation mode
  • add common examples,
    • filesystem watcher
    • docs site for self (w/ sidebar and possibly even search)

pre-announce,

  • CLI UX (opts, logging, etc.)
  • How to serve non-generated files (css, img, etc.)
  • Publish Data.LVar to Hackage
  • documentation (howto)

doc notes,

  • hot reload fast, morphdom
    • html templates + tailwind for fast style feedback
  • 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
  • dealing with errors
  • messaging re: hakyll
    • safer/ simpler routes system
    • bring your own templates / DSL