1
1
mirror of https://github.com/srid/ema.git synced 2024-12-01 15:13:36 +03:00
Haskell static site generator that is change-aware
Go to file
Sridhar Ratnakumar 6e7c9f2dde doc: misc...
2021-04-24 21:42:17 -04:00
.github/workflows Fix CI yaml again 2021-04-24 12:35:54 -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
docs doc: misc... 2021-04-24 21:42:17 -04:00
src doc: misc... 2021-04-24 21:42:17 -04:00
.ghcid Add documentation site example (#14) 2021-04-23 22:00:46 -04:00
.gitignore Publish docs to GitHub Pages (#15) 2021-04-24 12:04:16 -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 Add features, etc.wq 2021-04-24 13:10:31 -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 Publish docs to GitHub Pages (#15) 2021-04-24 12:04:16 -04:00
hie.yaml Publish docs to GitHub Pages (#15) 2021-04-24 12:04:16 -04:00
LICENSE initial commit of WIP code 2021-04-19 11:07:52 -04:00
README.md Reorg docs 2021-04-24 20:36:29 -04:00
shell.nix initial commit of WIP code 2021-04-19 11:07:52 -04:00

ema

Ema is a next-gen Haskell library for building jamstack-style static sites, with fast hot reload. See ema.srid.ca for documentation.

The simplest Ema app looks like this:

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

Quick Preview

If you have Nix installed with Flakes, give Ema a test-drive by running it to serve its own documentation:

PORT=8000 nix run github:srid/ema

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.

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/ breadcrumbs and possibly even search)

pre-announce,

  • CLI UX
    • opts
    • logging
  • How to serve non-generated files (css, img, etc.)
  • Publish Data.LVar to Hackage
  • documentation (guide)
  • Avoid tailwind CDN in docs (use twind or windicss) for better lighthouse score

doc notes,

  • hot reload fast, morphdom
    • html templates + tailwind for fast style feedback
  • use async:race to avoid ghcid ghosts
  • 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
  • messaging re: svelte
    • SSE