Git Product home page Git Product logo

snap-heist-examples's Introduction

Heist

Heist is a Haskell templating library commonly used with the Snap Framework. Heist keeps business logic out of the templates by giving you facilities for manipulating the templates in code. For instance, extracting and repeating template nodes from code instead of having a special template syntax for looping and conditions.

snap-heist-examples

This app is designed to demonstrate a few of the flow control basics common to other templating systems, such as looping (mapping, in this case) and conditionally rendering text or conditionally injecting other templates. See src/handlers/ for standalone Snap handlers demonstrating different ways you can use Heist.

You can read an intro and the original motivation for it in this blog post, or jump straight to the compiled Heist walkthrough.

Build steps (using cabal sandboxes)

This was last built with ghc 7.6.3 and cabal 1.18.0. These steps assume you have those installed at the same major versions (ghc in particular sometimes introduces breaking changes in new major versions, so no guarantees for this building easily in future versions).

  1. git clone [email protected]:ericrasmussen/snap-heist-examples.git
  2. cd snap-heist-examples
  3. cabal sandbox init
  4. cabal install --only-dependencies
  5. (wait patiently)
  6. cabal build
  7. dist/build/snap-heist-examples/snap-heist-examples -p 3000

The last step will launch the app and server locally on port 3000 (you can use a different port if you like).

At that point you can interact with it in your browser (usually localhost:3000), modify the templates and restart the application to see the changes, or change the code and run cabal build again.

Have fun!

snap-heist-examples's People

Contributors

ericrasmussen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

alexanderaa

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.