heist-1.1.0.1/ 0000755 0000000 0000000 00000000000 13363531400 011150 5 ustar 00 0000000 0000000 heist-1.1.0.1/README.SNAP.md 0000644 0000000 0000000 00000002273 13363531400 013173 0 ustar 00 0000000 0000000 Snap Framework -------------- Snap is a simple and fast web development framework and server written in Haskell. For more information or to download the latest version, you can visit the Snap project website at http://snapframework.com/. Snap Status and Features ------------------------ The Snap core system consists of: * a high-speed HTTP server, with an optional high-concurrency backend using the [libev](http://software.schmorp.de/pkg/libev.html) library * a sensible and clean monad for web programming * an xml-based templating system for generating HTML that allows you to bind Haskell functionality to XML tags without getting PHP-style tag soup all over your pants * a "snaplet" system for building web sites from composable pieces. Snap is currently only officially supported on Unix platforms; it has been tested on Linux and Mac OSX Snow Leopard, and is reported to work on Windows. Snap Philosophy --------------- Snap aims to be the *de facto* web toolkit for Haskell, on the basis of: * High performance * High design standards * Simplicity and ease of use, even for Haskell beginners * Excellent documentation * Robustness and high test coverage heist-1.1.0.1/haddock.sh 0000755 0000000 0000000 00000000445 13363531400 013107 0 ustar 00 0000000 0000000 #!/bin/sh set -x HADDOCK_OPTS='--html-location=http://hackage.haskell.org/packages/archive/$pkg/latest/doc/html --css=extra/haddock.css' cabal haddock $HADDOCK_OPTS --hyperlink-source $@ cp extra/logo.gif dist/doc/html/heist/haskell_icon.gif cp extra/hscolour.css dist/doc/html/heist/src/ heist-1.1.0.1/Setup.hs 0000644 0000000 0000000 00000000057 13363531400 012606 0 ustar 00 0000000 0000000 import Distribution.Simple main = defaultMain heist-1.1.0.1/heist.cabal 0000644 0000000 0000000 00000021415 13363531400 013253 0 ustar 00 0000000 0000000 name: heist version: 1.1.0.1 synopsis: An Haskell template system supporting both HTML5 and XML. description: Heist is a powerful template system that supports both HTML5 and XML. Some of Heist's features are: . * Designer-friendly HTML5 (or XML) syntax . * Templates can be reloaded to make changes visible without recompiling your Haskell code . * Enforces near-perfect separation of business logic and view . * Powerful abstraction primitives allowing you to eliminate repetition . * Easy creation of domain-specific markup languages . * Built-in support for including JSON and Markdown content in templates . * Simple mechanism for designer-specified template caching . * Optional merging of multiple \
tags defined anywhere in the document license: BSD3 license-file: LICENSE author: Doug Beardsley, Gregory Collins maintainer: snap@snapframework.com build-type: Simple cabal-version: >= 1.8.0.4 homepage: http://snapframework.com/ category: Web, Snap Tested-With: GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.1, GHC == 8.2.2, GHC == 8.4.3, GHC == 8.6.1 extra-source-files: .ghci, CONTRIBUTORS, docs/Makefile, docs/templates.css, docs/templates.md, examples/ex01/home.tpl, examples/ex01/nav.tpl, examples/ex02/default.tpl, examples/ex02/home.tpl, examples/ex03/default.tpl, examples/ex03/home.tpl, examples/test01.tpl, examples/test02.tpl, extra/haddock.css, extra/hscolour.css, extra/logo.gif, haddock.sh, LICENSE, README.md, README.SNAP.md, test/suite/Benchmark.hs, test/suite/Heist/Compiled/Tests.hs, test/suite/Heist/Interpreted/Tests.hs, test/suite/Heist/TestCommon.hs, test/suite/Heist/Tests.hs, test/suite/Heist/Tutorial/AttributeSplices.lhs, test/suite/Heist/Tutorial/CompiledSplices.lhs, test/suite/Heist/Tutorial/Imports.hs, test/suite/TestSuite.hs, test/templates/a.tpl, test/templates/attr_splice.tpl, test/templates/attrs.tpl, test/templates/attrsubtest1.tpl, test/templates/attrsubtest2.tpl, test/templates/backslash.tpl test/templates/bar/a.tpl, test/templates/bar/index.tpl, test/templates/bind-apply-interaction/_outer.tpl, test/templates/bind-apply-interaction/caller.tpl, test/templates/bind-attrs.tpl, test/templates/bind_param.tpl, test/templates/cache.tpl, test/templates/div_expansion.tpl, test/templates/foo/a.tpl, test/templates/foo/b.tpl, test/templates/foo/markdown-chdir.tpl, test/templates/foo/markdown-origdir.tpl, test/templates/foo/test2.md, test/templates/head_merge/index.tpl, test/templates/head_merge/nav.tpl, test/templates/head_merge/wrap.tpl, test/templates/index.tpl, test/templates/ioc.tpl, test/templates/json.tpl, test/templates/json_array.tpl test/templates/json_object.tpl, test/templates/json_snippet.tpl, test/templates/markdown.tpl, test/templates/namespaces.tpl test/templates/page.tpl, test/templates/pandoc.tpl test/templates/pandocdiv.tpl test/templates/people.tpl, test/templates/post.tpl, test/templates/readme.txt, test/templates/rss.xtpl test/templates/test.md, test/templates/textarea_expansion.tpl, test/templates/title_expansion.tpl, test/templates/user/admin/main.tpl, test/templates/user/admin/menu.tpl, test/templates/user/main.tpl, test/templates/user/menu.tpl, test/templates-bad/apply-missing-attr.tpl, test/templates-bad/apply-template-not-found.tpl, test/templates-bad/bind-infinite-loop.tpl, test/templates-bad/bind-missing-attr.tpl, test/templates-defer/test.tpl, test/templates-loaderror/_error.tpl, test/templates-loaderror/_ok.tpl, test/templates-loaderror/test.tpl, test/templates-nsbind/nsbind.tpl, test/templates-nsbind/nsbinderror.tpl, test/templates-ns-nested/test.tpl, test/templates-nscall/_call.tpl, test/templates-nscall/_invalid.tpl, test/templates-nscall/nscall.tpl, TODO Library hs-source-dirs: src exposed-modules: Heist, Heist.Compiled, Heist.Compiled.LowLevel, Heist.Internal.Types, Heist.Interpreted, Heist.Splices, Heist.Splices.Apply, Heist.Splices.Bind, Heist.Splices.BindStrict, Heist.Splices.Cache, Heist.Splices.Html, Heist.Splices.Ignore, Heist.Splices.Json, Heist.Splices.Markdown, Heist.TemplateDirectory other-modules: Data.HeterogeneousEnvironment, Heist.Common, Heist.Compiled.Internal, Heist.Internal.Types.HeistState, Heist.Interpreted.Internal build-depends: aeson >= 0.6 && < 1.5, attoparsec >= 0.10 && < 0.14, base >= 4.5 && < 4.13, blaze-builder >= 0.2 && < 0.5, blaze-html >= 0.4 && < 0.10, bytestring >= 0.9 && < 0.11, containers >= 0.2 && < 0.7, directory >= 1.1 && < 1.4, directory-tree >= 0.10 && < 0.13, dlist >= 0.5 && < 0.9, filepath >= 1.3 && < 1.5, hashable >= 1.1 && < 1.3, lifted-base >= 0.2 && < 0.3, map-syntax >= 0.3 && < 0.4, monad-control >= 0.3 && < 1.1, mtl >= 2.0 && < 2.3, process >= 1.1 && < 1.7, random >= 1.0.1.0 && < 1.2, text >= 0.10 && < 1.3, time >= 1.1 && < 1.10, transformers >= 0.3 && < 0.6, transformers-base >= 0.4 && < 0.5, unordered-containers >= 0.1.4 && < 0.3, vector >= 0.9 && < 0.13, xmlhtml >= 0.2.3.5 && < 0.3 if !impl(ghc >= 8.0) build-depends: semigroups >= 0.16 && < 0.19 if impl(ghc >= 6.12.0) ghc-options: -Wall -fwarn-tabs -funbox-strict-fields -fno-warn-unused-do-bind else ghc-options: -Wall -fwarn-tabs -funbox-strict-fields Extensions: GeneralizedNewtypeDeriving, PackageImports, ScopedTypeVariables, DeriveDataTypeable, FlexibleInstances, MultiParamTypeClasses, UndecidableInstances, OverloadedStrings, TypeSynonymInstances, NoMonomorphismRestriction source-repository head type: git location: https://github.com/snapframework/heist.git Test-suite testsuite hs-source-dirs: src test/suite type: exitcode-stdio-1.0 main-is: TestSuite.hs build-depends: HUnit >= 1.2 && < 2, QuickCheck >= 2 && < 2.13, lens >= 4.3 && < 4.18, test-framework >= 0.4 && < 0.9, test-framework-hunit >= 0.2.7 && < 0.4, test-framework-quickcheck2 >= 0.2.12.1 && < 0.4, aeson, attoparsec, base, bifunctors >= 5.3 && < 5.6, blaze-builder, blaze-html, bytestring, containers, directory, directory-tree, dlist, filepath, hashable, lifted-base, map-syntax, monad-control, mtl, process, random, text, time, transformers, transformers-base, unordered-containers, vector, xmlhtml if !impl(ghc >= 8.0) build-depends: semigroups >= 0.16 && < 0.19 if impl(ghc >= 7.8) && impl(ghc < 7.10) build-depends: transformers-compat >= 0.3 && < 0.7 ghc-options: -Wall -fwarn-tabs -funbox-strict-fields -threaded Extensions: OverloadedStrings Benchmark benchmark hs-source-dirs: src test/suite type: exitcode-stdio-1.0 main-is: Benchmark.hs build-depends: HUnit, criterion >= 1.0 && < 1.6, criterion-measurement >= 0.1 && < 0.2, test-framework, test-framework-hunit, -- Copied from regular dependencies: aeson, attoparsec, base, blaze-builder, blaze-html, bytestring, containers, directory, directory-tree, dlist, filepath, hashable, lifted-base, map-syntax, monad-control, mtl, process, random, statistics >= 0.11 && < 0.16, text, time, transformers, transformers-base, unordered-containers, vector, xmlhtml if !impl(ghc >= 8.0) build-depends: semigroups >= 0.16 && < 0.19 if impl(ghc >= 7.8) && impl(ghc < 7.10) build-depends: transformers-compat ghc-options: -Wall -fwarn-tabs -funbox-strict-fields -threaded -fno-warn-unused-do-bind -rtsopts Extensions: GeneralizedNewtypeDeriving, PackageImports, ScopedTypeVariables, DeriveDataTypeable, FlexibleInstances, MultiParamTypeClasses, UndecidableInstances, OverloadedStrings, TypeSynonymInstances, NoMonomorphismRestriction heist-1.1.0.1/LICENSE 0000644 0000000 0000000 00000002745 13363531400 012165 0 ustar 00 0000000 0000000 Copyright (c) 2009, Snap Framework authors (see CONTRIBUTORS) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the Snap Framework authors nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. heist-1.1.0.1/TODO 0000644 0000000 0000000 00000000174 13363531400 011642 0 ustar 00 0000000 0000000 * Fix handling of ".." in apply tags Ongoing ------- * Improve test coverage * Head merging (ala the Lift Web Framework) heist-1.1.0.1/CONTRIBUTORS 0000644 0000000 0000000 00000000416 13363531400 013031 0 ustar 00 0000000 0000000 Doug Beardsleysome text
Likewise, if you need to add text to an attribute,Doe, John: 42 years old
\n\nSmith, Jane: 21 years old
\n\n" templateHC :: HeistConfig IO templateHC = HeistConfig sc "" False where sc = mempty & scLoadTimeSplices .~ defaultLoadTimeSplices & scCompiledSplices .~ ("foo" ## return (yieldPureText "aoeu")) & scTemplateLocations .~ [loadTemplates "templates"] genericTest :: String -> ByteString -> ByteString -> IO () genericTest nm template expected = do res <- runExceptT $ do hs <- ExceptT $ initHeist templateHC runner <- noteT ["Error rendering"] $ hoistMaybe $ renderTemplate hs template b <- lift $ fst runner return $ toByteString b H.assertEqual nm (Right expected) res doctypeTest :: IO () doctypeTest = genericTest "doctype test" "rss" expected where expected = encodeUtf8 "line
line
Welcome to our home page
~~~~~~~~~~~~~~~ When a user requests the `/home` URL, Heist would serve `home.tpl`, and the nav template would automatically be inserted into the page. Here is what the HTML will look like after Heist processes the template: ~~~~~~~~~~~~~~~ {.html}Welcome to our home page
~~~~~~~~~~~~~~~ ### The `Welcome to XYZ Inc
Welcome to XYZ Inc
Welcome to XYZ Inc