MyNixOS website logo
Description

Rapid prototyping websites with Snap and Heist.

Charade is a tool for rapid website prototyping using Heist and Snap. Charade-generated sites can easily be dropped into Snap applications and work out of the box with no modification.

The main thing provided by this package is the charade executable that serves your prototype sites. The library provided contains a Heist splice that you use to make all evidence of charade disappear in your production app.

For more information, see the README: https://github.com/soostone/charade/blob/master/README.md

charade Build Status

Haskell program that fills Heist templates with randomly generated data in support of rapid UI prototyping.

To see charade in action follow these steps:

  1. git clone https://github.com/Soostone/charade.git
  2. cd charade
  3. cabal install
  4. dist/build/charade/charade
  5. Point your browser at http://localhost:8000
  6. Look in templates/index.tpl to see how this example works

Charade lets you prototype a site's HTML/CSS/JavaScript using exactly the Heist template markup that you will have in your final site, without needing to write any of the backend code to implement your splices. Every time you use a tag implemented as a Haskell splice, just include the "fake" attribute telling charade how to render dummy data for that tag.

Charade decouples the work of designers and backend developers. A site could be started by designers who have a good picture of what they want the front-end interface to look like using just a small amount of knowledge about splice tags should be structured. Then developers could be hired to fill in the back end. Alternatively, back end developers could start by developing a site's data model and back end. Then they could hire designers to build the look and feel without needing to set up any back end database infrastructure or give them an application binary. This allows designers to work in an environment much closer to what will ultimately be used in production.

The charade application is a snap application that serves Heist templates and static files. The charade application allows you to add a "fake" attribute anywhere in your HTML to generate fake data in the place of that tag. For instance, in the following paragraph charade will replace the \<myParagraph\> tag with a paragraph of lorem ipsum text.

<p>
  <myParagraph fake="lorem"/>
</p>

Charade provides the following built-in primitives for generating dummy content with the "fake" attribute:

  • bool - true/false
  • yesno - yes/no
  • int \<min\> \<max\> - an integer in the interval [min,max]
  • decimal \<min\> \<max\> - a decimal in the interval [min,max]
  • list - a list of 5 copies of its child nodes
  • list \<count\> - a list of \<count\> copies of its child nodes
  • list \<min\> \<max\> - a randomly sized list
  • lorem - a paragraph of lorem ipsum text
  • lorem \<count\> - a paragraph of lorem ipsum text repeated \<count\> times
  • first-name - randomly chosen English first names
  • last-name - randomly chosen English last names
  • enum - arbitrary enumerations specified in a file

The charade application also requires a file "charade.cfg" in the current directory for configuration. The config file should look like this:

# Select whether random data is generated every request or only once when the
# app is initialized.  If you specify "dynamic" here, then new random data
# will be generated every request.  If you specify "static", then random data
# will be generated once and every request will see the same data.
mode = "dynamic"

# Directory holding Heist templates
tdir = "snaplets/heist/templates"

# List of files with custom enumerations for random generation
enums = ["titles.txt"]

# Directory where static resources are located
staticDir = "static"

# Route for accessing static data
staticRoute = ""
Metadata

Version

0.1.1.2

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows