diff options
author | Johannes Gerer <oss@johannesgerer.com> | 2016-10-26 02:07:02 +0200 |
---|---|---|
committer | Johannes Gerer <oss@johannesgerer.com> | 2016-10-26 02:07:02 +0200 |
commit | 675085c2e0b0b851378da08b7d73024766107c87 (patch) | |
tree | 5a927de4a9576aef7e6129b96e74aa5c96f9ffb6 | |
download | blazeT-675085c2e0b0b851378da08b7d73024766107c87.tar.gz blazeT-675085c2e0b0b851378da08b7d73024766107c87.tar.zst blazeT-675085c2e0b0b851378da08b7d73024766107c87.zip |
Initial
47 files changed, 4096 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..da61294 --- /dev/null +++ b/.gitignore | |||
@@ -0,0 +1,21 @@ | |||
1 | dist | ||
2 | dist-* | ||
3 | cabal-dev | ||
4 | *.o | ||
5 | *.hi | ||
6 | *.chi | ||
7 | *.chs.h | ||
8 | *.dyn_o | ||
9 | *.dyn_hi | ||
10 | .hpc | ||
11 | .hsenv | ||
12 | .cabal-sandbox/ | ||
13 | cabal.sandbox.config | ||
14 | *.prof | ||
15 | *.aux | ||
16 | *.hp | ||
17 | *.eventlog | ||
18 | .stack-work/ | ||
19 | cabal.project.local | ||
20 | report.html | ||
21 | src/Benchmarks/RunHtmlBenchmarks | ||
diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..fbf2adb --- /dev/null +++ b/.travis.yml | |||
@@ -0,0 +1,182 @@ | |||
1 | # from https://docs.haskellstack.org/en/stable/GUIDE/#travis-with-caching | ||
2 | |||
3 | # Use new container infrastructure to enable caching | ||
4 | sudo: false | ||
5 | |||
6 | # Choose a lightweight base image; we provide our own build tools. | ||
7 | language: c | ||
8 | |||
9 | # Caching so the next build will be fast too. | ||
10 | cache: | ||
11 | directories: | ||
12 | - $HOME/.ghc | ||
13 | - $HOME/.cabal | ||
14 | - $HOME/.stack | ||
15 | |||
16 | # The different configurations we want to test. We have BUILD=cabal which uses | ||
17 | # cabal-install, and BUILD=stack which uses Stack. More documentation on each | ||
18 | # of those below. | ||
19 | # | ||
20 | # We set the compiler values here to tell Travis to use a different | ||
21 | # cache file per set of arguments. | ||
22 | # | ||
23 | # If you need to have different apt packages for each combination in the | ||
24 | # matrix, you can use a line such as: | ||
25 | # addons: {apt: {packages: [libfcgi-dev,libgmp-dev]}} | ||
26 | matrix: | ||
27 | include: | ||
28 | # We grab the appropriate GHC and cabal-install versions from hvr's PPA. See: | ||
29 | # https://github.com/hvr/multi-ghc-travis | ||
30 | #- env: BUILD=cabal GHCVER=7.0.4 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7 | ||
31 | # compiler: ": #GHC 7.0.4" | ||
32 | # addons: {apt: {packages: [cabal-install-1.16,ghc-7.0.4,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}} | ||
33 | #- env: BUILD=cabal GHCVER=7.2.2 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7 | ||
34 | # compiler: ": #GHC 7.2.2" | ||
35 | # addons: {apt: {packages: [cabal-install-1.16,ghc-7.2.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}} | ||
36 | #- env: BUILD=cabal GHCVER=7.4.2 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7 | ||
37 | # compiler: ": #GHC 7.4.2" | ||
38 | # addons: {apt: {packages: [cabal-install-1.16,ghc-7.4.2,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}} | ||
39 | - env: BUILD=cabal GHCVER=7.6.3 CABALVER=1.16 HAPPYVER=1.19.5 ALEXVER=3.1.7 | ||
40 | compiler: ": #GHC 7.6.3" | ||
41 | addons: {apt: {packages: [cabal-install-1.16,ghc-7.6.3,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}} | ||
42 | - env: BUILD=cabal GHCVER=7.8.4 CABALVER=1.18 HAPPYVER=1.19.5 ALEXVER=3.1.7 | ||
43 | compiler: ": #GHC 7.8.4" | ||
44 | addons: {apt: {packages: [cabal-install-1.18,ghc-7.8.4,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}} | ||
45 | - env: BUILD=cabal GHCVER=7.10.3 CABALVER=1.22 HAPPYVER=1.19.5 ALEXVER=3.1.7 | ||
46 | compiler: ": #GHC 7.10.3" | ||
47 | addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}} | ||
48 | - env: BUILD=cabal GHCVER=8.0.1 CABALVER=1.24 HAPPYVER=1.19.5 ALEXVER=3.1.7 | ||
49 | compiler: ": #GHC 8.0.1" | ||
50 | addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}} | ||
51 | |||
52 | # Build with the newest GHC and cabal-install. This is an accepted failure, | ||
53 | # see below. | ||
54 | - env: BUILD=cabal GHCVER=head CABALVER=head HAPPYVER=1.19.5 ALEXVER=3.1.7 | ||
55 | compiler: ": #GHC HEAD" | ||
56 | addons: {apt: {packages: [cabal-install-head,ghc-head,happy-1.19.5,alex-3.1.7], sources: [hvr-ghc]}} | ||
57 | |||
58 | # # The Stack builds. We can pass in arbitrary Stack arguments via the ARGS | ||
59 | # # variable, such as using --stack-yaml to point to a different file. | ||
60 | # - env: BUILD=stack ARGS="" | ||
61 | # compiler: ": #stack default" | ||
62 | # addons: {apt: {packages: [ghc-7.10.3], sources: [hvr-ghc]}} | ||
63 | |||
64 | # - env: BUILD=stack ARGS="--resolver lts-2" | ||
65 | # compiler: ": #stack 7.8.4" | ||
66 | # addons: {apt: {packages: [ghc-7.8.4], sources: [hvr-ghc]}} | ||
67 | |||
68 | # - env: BUILD=stack ARGS="--resolver lts-3" | ||
69 | # compiler: ": #stack 7.10.2" | ||
70 | # addons: {apt: {packages: [ghc-7.10.2], sources: [hvr-ghc]}} | ||
71 | |||
72 | # - env: BUILD=stack ARGS="--resolver lts-6" | ||
73 | # compiler: ": #stack 7.10.3" | ||
74 | # addons: {apt: {packages: [ghc-7.10.3], sources: [hvr-ghc]}} | ||
75 | |||
76 | # # Nightly builds are allowed to fail | ||
77 | # - env: BUILD=stack ARGS="--resolver nightly" | ||
78 | # compiler: ": #stack nightly" | ||
79 | # addons: {apt: {packages: [libgmp,libgmp-dev]}} | ||
80 | |||
81 | # # Build on OS X in addition to Linux | ||
82 | # - env: BUILD=stack ARGS="" | ||
83 | # compiler: ": #stack default osx" | ||
84 | # os: osx | ||
85 | |||
86 | # - env: BUILD=stack ARGS="--resolver lts-2" | ||
87 | # compiler: ": #stack 7.8.4 osx" | ||
88 | # os: osx | ||
89 | |||
90 | # - env: BUILD=stack ARGS="--resolver lts-3" | ||
91 | # compiler: ": #stack 7.10.2 osx" | ||
92 | # os: osx | ||
93 | |||
94 | # - env: BUILD=stack ARGS="--resolver lts-6" | ||
95 | # compiler: ": #stack 7.10.3 osx" | ||
96 | # os: osx | ||
97 | |||
98 | # - env: BUILD=stack ARGS="--resolver nightly" | ||
99 | # compiler: ": #stack nightly osx" | ||
100 | # os: osx | ||
101 | |||
102 | allow_failures: | ||
103 | - env: BUILD=cabal GHCVER=head CABALVER=head HAPPYVER=1.19.5 ALEXVER=3.1.7 | ||
104 | # - env: BUILD=stack ARGS="--resolver nightly" | ||
105 | |||
106 | before_install: | ||
107 | # Using compiler above sets CC to an invalid value, so unset it | ||
108 | - unset CC | ||
109 | |||
110 | # We want to always allow newer versions of packages when building on GHC HEAD | ||
111 | - CABALARGS="" | ||
112 | - if [ "x$GHCVER" = "xhead" ]; then CABALARGS=--allow-newer; fi | ||
113 | |||
114 | # Download and unpack the stack executable | ||
115 | - export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$HOME/.local/bin:/opt/alex/$ALEXVER/bin:/opt/happy/$HAPPYVER/bin:$HOME/.cabal/bin:$PATH | ||
116 | - mkdir -p ~/.local/bin | ||
117 | - | | ||
118 | if [ `uname` = "Darwin" ] | ||
119 | then | ||
120 | travis_retry curl --insecure -L https://www.stackage.org/stack/osx-x86_64 | tar xz --strip-components=1 --include '*/stack' -C ~/.local/bin | ||
121 | else | ||
122 | travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack' | ||
123 | fi | ||
124 | |||
125 | # Use the more reliable S3 mirror of Hackage | ||
126 | mkdir -p $HOME/.cabal | ||
127 | echo 'remote-repo: hackage.haskell.org:http://hackage.fpcomplete.com/' > $HOME/.cabal/config | ||
128 | echo 'remote-repo-cache: $HOME/.cabal/packages' >> $HOME/.cabal/config | ||
129 | |||
130 | if [ "$CABALVER" != "1.16" ] | ||
131 | then | ||
132 | echo 'jobs: $ncpus' >> $HOME/.cabal/config | ||
133 | fi | ||
134 | |||
135 | # Get the list of packages from the stack.yaml file | ||
136 | - PACKAGES=$(stack --install-ghc query locals | grep '^ *path' | sed 's@^ *path:@@') | ||
137 | |||
138 | install: | ||
139 | - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]" | ||
140 | - if [ -f configure.ac ]; then autoreconf -i; fi | ||
141 | - | | ||
142 | set -ex | ||
143 | case "$BUILD" in | ||
144 | stack) | ||
145 | stack --no-terminal --install-ghc $ARGS test --bench --only-dependencies | ||
146 | ;; | ||
147 | cabal) | ||
148 | cabal --version | ||
149 | travis_retry cabal update | ||
150 | cabal install --only-dependencies --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES | ||
151 | ;; | ||
152 | esac | ||
153 | set +ex | ||
154 | |||
155 | script: | ||
156 | - | | ||
157 | set -ex | ||
158 | case "$BUILD" in | ||
159 | stack) | ||
160 | stack --no-terminal $ARGS test --bench --no-run-benchmarks --haddock --no-haddock-deps | ||
161 | ;; | ||
162 | cabal) | ||
163 | cabal install --enable-tests --enable-benchmarks --force-reinstalls --ghc-options=-O0 --reorder-goals --max-backjumps=-1 $CABALARGS $PACKAGES | ||
164 | |||
165 | ORIGDIR=$(pwd) | ||
166 | for dir in $PACKAGES | ||
167 | do | ||
168 | cd $dir | ||
169 | cabal check || [ "$CABALVER" == "1.16" ] | ||
170 | cabal sdist | ||
171 | PKGVER=$(cabal info . | awk '{print $2;exit}') | ||
172 | SRC_TGZ=$PKGVER.tar.gz | ||
173 | cd dist | ||
174 | tar zxfv "$SRC_TGZ" | ||
175 | cd "$PKGVER" | ||
176 | cabal configure --enable-tests | ||
177 | cabal build | ||
178 | cd $ORIGDIR | ||
179 | done | ||
180 | ;; | ||
181 | esac | ||
182 | set +ex | ||
@@ -0,0 +1,21 @@ | |||
1 | MIT License | ||
2 | |||
3 | Copyright (c) 2016 Johannes Gerer | ||
4 | |||
5 | Permission is hereby granted, free of charge, to any person obtaining a copy | ||
6 | of this software and associated documentation files (the "Software"), to deal | ||
7 | in the Software without restriction, including without limitation the rights | ||
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
9 | copies of the Software, and to permit persons to whom the Software is | ||
10 | furnished to do so, subject to the following conditions: | ||
11 | |||
12 | The above copyright notice and this permission notice shall be included in all | ||
13 | copies or substantial portions of the Software. | ||
14 | |||
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
21 | SOFTWARE. | ||
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..04b0ff9 --- /dev/null +++ b/Makefile | |||
@@ -0,0 +1,61 @@ | |||
1 | # Copyright Jasper Van der Jeugt 2010 | ||
2 | |||
3 | # All rights reserved. | ||
4 | |||
5 | # Redistribution and use in source and binary forms, with or without | ||
6 | # modification, are permitted provided that the following conditions are met: | ||
7 | |||
8 | # * Redistributions of source code must retain the above copyright | ||
9 | # notice, this list of conditions and the following disclaimer. | ||
10 | |||
11 | # * Redistributions in binary form must reproduce the above | ||
12 | # copyright notice, this list of conditions and the following | ||
13 | # disclaimer in the documentation and/or other materials provided | ||
14 | # with the distribution. | ||
15 | |||
16 | # * Neither the name of Jasper Van der Jeugt nor the names of other | ||
17 | # contributors may be used to endorse or promote products derived | ||
18 | # from this software without specific prior written permission. | ||
19 | |||
20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
21 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
22 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
23 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
24 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
25 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
26 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
27 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
28 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
29 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
30 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
31 | |||
32 | ################################################################################ | ||
33 | # Configuration | ||
34 | ################################################################################ | ||
35 | |||
36 | GHC = cabal exec -- ghc | ||
37 | GHCI = ghci | ||
38 | GHC_FLAGS = -O2 -fforce-recomp -ibenchmarks -isrc -itests -fsimpl-tick-factor=200 | ||
39 | |||
40 | BENCHMARK_FLAGS = --resamples 10000 | ||
41 | |||
42 | ################################################################################ | ||
43 | # Benchmarks | ||
44 | ################################################################################ | ||
45 | |||
46 | benchmark: | ||
47 | $(GHC) $(GHC_FLAGS) --make -main-is Benchmarks.RunHtmlBenchmarks src/Benchmarks/RunHtmlBenchmarks.hs | ||
48 | ./src/Benchmarks/RunHtmlBenchmarks $(BENCHMARK_FLAGS) -o report.html | ||
49 | |||
50 | benchmark-bigtable-non-haskell: | ||
51 | ruby benchmarks/bigtable/erb.rb | ||
52 | ruby benchmarks/bigtable/erubis.rb | ||
53 | php -n benchmarks/bigtable/php.php | ||
54 | |||
55 | |||
56 | ################################################################################ | ||
57 | # generate combinators | ||
58 | ################################################################################ | ||
59 | |||
60 | combinators: | ||
61 | runghc -isrc Util.GenerateHtmlTCombinators | ||
diff --git a/README.md b/README.md new file mode 100644 index 0000000..0169fab --- /dev/null +++ b/README.md | |||
@@ -0,0 +1,87 @@ | |||
1 | # blazeT [![Build Status](https://travis-ci.org/johannesgerer/blazeT.svg?branch=master)](https://travis-ci.org/johannesgerer/blazeT) [![Hackage](https://img.shields.io/hackage/v/blazeT.svg)](https://hackage.haskell.org/package/blazeT) | ||
2 | |||
3 | A true monad (transformer) version of the | ||
4 | [blaze-markup](https://hackage.haskell.org/package/blaze-markup) and | ||
5 | [blaze-html](https://hackage.haskell.org/package/blaze-html) | ||
6 | libraries. | ||
7 | |||
8 | # Why? | ||
9 | |||
10 | While blaze's `Markup` and `Html` types have `Monad` instances and can | ||
11 | leverage the the concise `do` notation, they do not satisfy | ||
12 | the | ||
13 | [Monad Laws](https://hackage.haskell.org/package/base-4.8.0.0/docs/Control-Monad.html#t:Monad) and | ||
14 | thus cannot be used as Monads, let alone Monad transformers. | ||
15 | |||
16 | ## Use Cases | ||
17 | |||
18 | The `MarkupT` Monad Transformer enables us to write Markup (e.g. HTML) | ||
19 | templates that have access to all those Monads you cannot live without | ||
20 | anymore. | ||
21 | |||
22 | Accessing an environment | ||
23 | ([MonadReader](https://hackage.haskell.org/package/mtl-2.2.1/docs/Control-Monad-Reader-Class.html)), | ||
24 | accumulating log or other diagnostic output | ||
25 | ([MonadWriter](https://hackage.haskell.org/package/mtl-2.2.1/docs/Control-Monad-Writer-Class.html)), | ||
26 | doing `IO` (like database access) are the first things that come to | ||
27 | mind. | ||
28 | |||
29 | The initial reason of existence of this library is its use | ||
30 | in [Lykah](http://johannesgerer.com/Lykah), which powers my personal | ||
31 | website | ||
32 | [http://johannesgerer.com](http://johannesgerer.com/johannesgerer.com). In | ||
33 | Lykah, the HTML templates have access to the whole site structure (to | ||
34 | build things like menus) and automatically check, insert and keep | ||
35 | track of referenced pages and assets, which turns out to be very | ||
36 | useful for the task of static website generation. | ||
37 | |||
38 | # How to use it? | ||
39 | |||
40 | ## Backwards compatible | ||
41 | |||
42 | The library is intended to serve as a drop-in replacement for the | ||
43 | `blaze-markup` and `blaze-html` libraries and should be backwards | ||
44 | compatible: | ||
45 | |||
46 | Simply replace your `module Text.Blaze.*` imports with `module | ||
47 | Text.BlazeT.*` and it should give the same results. | ||
48 | |||
49 | For usage of blaze check out | ||
50 | their [documentation](https://jaspervdj.be/blaze/). | ||
51 | |||
52 | ## Unleash the monads | ||
53 | |||
54 | |||
55 | |||
56 | # Implementation | ||
57 | |||
58 | ... is located | ||
59 | in | ||
60 | [Text.BlazeT.Internals](https://hackage.haskell.org/package/blazeT/docs/Text-BlazeT-Internals.html). | ||
61 | |||
62 | Everything build around the simple `newtype` definition of the | ||
63 | `MarkupT` transformer, which makes use of the fact that `Blaze.Markup` | ||
64 | is | ||
65 | a | ||
66 | [Monoid](https://hackage.haskell.org/package/base-4.7.0.2/docs/Data-Monoid.html) and | ||
67 | which is basically a `WriterT` transformer writing `Blaze.Markup`: | ||
68 | |||
69 | ```Haskell | ||
70 | newtype MarkupT m a = MarkupT { fromMarkupT :: WriterT B.Markup m a } | ||
71 | ``` | ||
72 | |||
73 | Wrappers used to lift all `Blaze` entities into `BlazeT` are trivially | ||
74 | expressible using basic `WriterT` class methods. Wrapping `Blaze.Markup` is simply `WriterT.tell`: | ||
75 | |||
76 | ```Haskell | ||
77 | wrapMarkupT :: Monad m => B.Markup -> MarkupT m () | ||
78 | wrapMarkupT = tell | ||
79 | ``` | ||
80 | Wrapping functions that modify `Blaze.Markup` is simply `WriterT.censor`: | ||
81 | |||
82 | ```Haskell | ||
83 | wrapMarkupT2 :: Monad m => (B.Markup -> B.Markup) -> MarkupT m a -> MarkupT m a | ||
84 | wrapMarkupT2 = censor | ||
85 | ``` | ||
86 | |||
87 | |||
diff --git a/Setup.hs b/Setup.hs new file mode 100644 index 0000000..c67c506 --- /dev/null +++ b/Setup.hs | |||
@@ -0,0 +1,13 @@ | |||
1 | import Distribution.Simple | ||
2 | import Distribution.Simple.Setup | ||
3 | import Distribution.Simple.Haddock | ||
4 | main = do | ||
5 | defaultMainWithHooks simpleUserHooks{ | ||
6 | haddockHook = \p l h f -> haddockHook simpleUserHooks p l h f{ | ||
7 | haddockHoogle = Flag True, | ||
8 | haddockHtml = Flag True, | ||
9 | haddockExecutables = Flag True, | ||
10 | haddockHscolour = Flag True | ||
11 | } | ||
12 | } | ||
13 | |||
diff --git a/blazeT.cabal b/blazeT.cabal new file mode 100644 index 0000000..eb3907e --- /dev/null +++ b/blazeT.cabal | |||
@@ -0,0 +1,100 @@ | |||
1 | Name: blazeT | ||
2 | Version: 0.0.1 | ||
3 | Homepage: | ||
4 | Bug-Reports: http://github.com/johannesgerer/blazeT/issues | ||
5 | License: MIT | ||
6 | License-file: LICENSE | ||
7 | Author: Johannes Gerer | ||
8 | Maintainer: Johannes Gerer <oss@johannesgerer.com> | ||
9 | Homepage: http://johannesgerer.com/blazeT | ||
10 | Stability: Experimental | ||
11 | Category: Text, Data, Web | ||
12 | Synopsis: A true monad (transformer) version of the blaze-markup and blaze-html libraries | ||
13 | Tested-with: GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.1 | ||
14 | Description: | ||
15 | A true monad (transformer) version of the blaze-markup and blaze-html libraries, implemented as as a very thin wrapper around and strict superset of these libraries. | ||
16 | . | ||
17 | See <https://github.com/johannesgerer/blazeT Readme> on Github. | ||
18 | |||
19 | |||
20 | |||
21 | Build-type: Custom | ||
22 | Cabal-version: >= 1.8 | ||
23 | |||
24 | Extra-source-files: | ||
25 | README.md | ||
26 | src/Util/GenerateHtmlCombinators.hs | ||
27 | src/Util/Sanitize.hs | ||
28 | src/Util/GenerateHtmlTCombinators.hs | ||
29 | |||
30 | Custom-setup | ||
31 | setup-depends: base >= 4.0.0.0 && < 5, Cabal | ||
32 | |||
33 | Library | ||
34 | -- Default-Language: Haskell2010 | ||
35 | Hs-source-dirs: src | ||
36 | Ghc-Options: -Wall | ||
37 | -fsimpl-tick-factor=200 | ||
38 | -- -ddump-simpl-stats | ||
39 | -- -ddump-to-file | ||
40 | Exposed-modules: | ||
41 | Text.BlazeT | ||
42 | Text.BlazeT.Internal | ||
43 | Text.BlazeT.Html | ||
44 | Text.BlazeT.Renderer.Utf8 | ||
45 | Text.BlazeT.Renderer.String | ||
46 | Text.BlazeT.Renderer.Pretty | ||
47 | Text.BlazeT.Renderer.Text | ||
48 | Text.BlazeT.Html4.FrameSet | ||
49 | Text.BlazeT.Html4.Strict | ||
50 | Text.BlazeT.Html4.Transitional | ||
51 | Text.BlazeT.Html5 | ||
52 | Text.BlazeT.XHtml1.FrameSet | ||
53 | Text.BlazeT.XHtml1.Strict | ||
54 | Text.BlazeT.XHtml1.Transitional | ||
55 | Text.BlazeT.XHtml5 | ||
56 | Text.BlazeT.Html4.FrameSet.Attributes | ||
57 | Text.BlazeT.Html4.Strict.Attributes | ||
58 | Text.BlazeT.Html4.Transitional.Attributes | ||
59 | Text.BlazeT.Html5.Attributes | ||
60 | Text.BlazeT.XHtml1.FrameSet.Attributes | ||
61 | Text.BlazeT.XHtml1.Strict.Attributes | ||
62 | Text.BlazeT.XHtml1.Transitional.Attributes | ||
63 | Text.BlazeT.XHtml5.Attributes | ||
64 | |||
65 | Build-depends: | ||
66 | base >= 4.0.0.0 && < 5 | ||
67 | ,blaze-markup >= 0.6.0.0 | ||
68 | ,blaze-html >= 0.6.0.0 | ||
69 | ,blaze-builder >= 0.2 | ||
70 | ,text | ||
71 | ,bytestring | ||
72 | ,mtl | ||
73 | ,transformers | ||
74 | |||
75 | -- Test-suite blaze-markup-tests | ||
76 | -- Type: exitcode-stdio-1.0 | ||
77 | -- Hs-source-dirs: src tests | ||
78 | -- Main-is: TestSuite.hs | ||
79 | -- Ghc-options: -Wall | ||
80 | |||
81 | -- Other-modules: | ||
82 | -- Text.Blaze.Tests | ||
83 | -- Text.Blaze.Tests.Util | ||
84 | |||
85 | -- Build-depends: | ||
86 | -- HUnit >= 1.2 && < 1.3, | ||
87 | -- QuickCheck >= 2.4 && < 2.8, | ||
88 | -- containers >= 0.3 && < 0.6, | ||
89 | -- test-framework >= 0.4 && < 0.9, | ||
90 | -- test-framework-hunit >= 0.3 && < 0.4, | ||
91 | -- test-framework-quickcheck2 >= 0.3 && < 0.4, | ||
92 | -- -- Copied from regular dependencies... | ||
93 | -- base >= 4 && < 5, | ||
94 | -- blaze-builder >= 0.2 && < 0.4, | ||
95 | -- text >= 0.10 && < 1.2, | ||
96 | -- bytestring >= 0.9 && < 0.11 | ||
97 | |||
98 | Source-repository head | ||
99 | Type: git | ||
100 | Location: http://github.com/johannesgerer/blazeT \ No newline at end of file | ||
diff --git a/src/BackwardsCompatibilty.hs b/src/BackwardsCompatibilty.hs new file mode 100644 index 0000000..a8733ed --- /dev/null +++ b/src/BackwardsCompatibilty.hs | |||
@@ -0,0 +1,29 @@ | |||
1 | {-# LANGUAGE OverloadedStrings #-} | ||
2 | {-# LANGUAGE NoMonomorphismRestriction #-} | ||
3 | {-# LANGUAGE RankNTypes #-} | ||
4 | {-# LANGUAGE CPP #-} | ||
5 | |||
6 | import Text.Blaze.Html5.Attributes | ||
7 | #if 1 | ||
8 | import Text.BlazeT | ||
9 | import Text.BlazeT.Html5 hiding (main) | ||
10 | import Text.BlazeT.Renderer.Utf8 | ||
11 | #else | ||
12 | import Text.Blaze | ||
13 | import Text.Blaze.Html5 hiding (main) | ||
14 | import Text.Blaze.Renderer.Utf8 | ||
15 | #endif | ||
16 | |||
17 | main :: IO () | ||
18 | main = print $ renderMarkup $ do | ||
19 | docType | ||
20 | -- "some text" -- does not work | ||
21 | html $ do text "some text" -- does not work | ||
22 | br | ||
23 | ("wow" :: Markup) -- overloaded strings | ||
24 | text "asd" ! href "asd" | ||
25 | string "string" ! href "asd" | ||
26 | toMarkup ("more text" :: String) | ||
27 | html "wow" | ||
28 | html ! src "asd" $ br | ||
29 | |||
diff --git a/src/Benchmarks/BenchmarkUtils.hs b/src/Benchmarks/BenchmarkUtils.hs new file mode 100644 index 0000000..4b9546c --- /dev/null +++ b/src/Benchmarks/BenchmarkUtils.hs | |||
@@ -0,0 +1,107 @@ | |||
1 | -- | This is a module which contains some ad-hoc HTML combinators for use when | ||
2 | -- benchmarking | ||
3 | -- | ||
4 | {-# LANGUAGE OverloadedStrings, NoMonomorphismRestriction #-} | ||
5 | module Benchmarks.BenchmarkUtils | ||
6 | ( Html | ||
7 | , toHtml | ||
8 | |||
9 | , tr | ||
10 | , td | ||
11 | , html | ||
12 | , head | ||
13 | , title | ||
14 | , body | ||
15 | , div | ||
16 | , h1 | ||
17 | , h2 | ||
18 | , p | ||
19 | , ol | ||
20 | , li | ||
21 | , table | ||
22 | , img | ||
23 | , id | ||
24 | ) where | ||
25 | |||
26 | import Prelude hiding (div, head, id) | ||
27 | import Text.Blaze | ||
28 | import Text.Blaze.Internal | ||
29 | |||
30 | type Html = Markup | ||
31 | |||
32 | toHtml :: ToMarkup a => a -> Html | ||
33 | toHtml = toMarkup | ||
34 | |||
35 | tr :: Html -- ^ Inner HTML. | ||
36 | -> Html -- ^ Resulting HTML. | ||
37 | tr = Parent "tr" "<tr" "</tr>" | ||
38 | {-# INLINE tr #-} | ||
39 | |||
40 | td :: Html -- ^ Inner HTML. | ||
41 | -> Html -- ^ Resulting HTML. | ||
42 | td = Parent "td" "<td" "</td>" | ||
43 | {-# INLINE td #-} | ||
44 | |||
45 | html :: Html -- ^ Inner HTML. | ||
46 | -> Html -- ^ Resulting HTML. | ||
47 | html = Parent "html" "<html" "</html>" | ||
48 | {-# INLINE html #-} | ||
49 | |||
50 | head :: Html -- ^ Inner HTML. | ||
51 | -> Html -- ^ Resulting HTML. | ||
52 | head = Parent "head" "<head" "</head>" | ||
53 | {-# INLINE head #-} | ||
54 | |||
55 | title :: Html -- ^ Inner HTML. | ||
56 | -> Html -- ^ Resulting HTML. | ||
57 | title = Parent "title" "<title" "</title>" | ||
58 | {-# INLINE title #-} | ||
59 | |||
60 | body :: Html -- ^ Inner HTML. | ||
61 | -> Html -- ^ Resulting HTML. | ||
62 | body = Parent "body" "<body" "</body>" | ||
63 | {-# INLINE body #-} | ||
64 | |||
65 | div :: Html -- ^ Inner HTML. | ||
66 | -> Html -- ^ Resulting HTML. | ||
67 | div = Parent "div" "<div" "</div>" | ||
68 | {-# INLINE div #-} | ||
69 | |||
70 | h1 :: Html -- ^ Inner HTML. | ||
71 | -> Html -- ^ Resulting HTML. | ||
72 | h1 = Parent "h1" "<h1" "</h1>" | ||
73 | {-# INLINE h1 #-} | ||
74 | |||
75 | h2 :: Html -- ^ Inner HTML. | ||
76 | -> Html -- ^ Resulting HTML. | ||
77 | h2 = Parent "h2" "<h2" "</h2>" | ||
78 | {-# INLINE h2 #-} | ||
79 | |||
80 | p :: Html -- ^ Inner HTML. | ||
81 | -> Html -- ^ Resulting HTML. | ||
82 | p = Parent "p" "<p" "</p>" | ||
83 | {-# INLINE p #-} | ||
84 | |||
85 | ol :: Html -- ^ Inner HTML. | ||
86 | -> Html -- ^ Resulting HTML. | ||
87 | ol = Parent "ol" "<ol" "</ol>" | ||
88 | {-# INLINE ol #-} | ||
89 | |||
90 | li :: Html -- ^ Inner HTML. | ||
91 | -> Html -- ^ Resulting HTML. | ||
92 | li = Parent "li" "<li" "</li>" | ||
93 | {-# INLINE li #-} | ||
94 | |||
95 | table :: Html -- ^ Inner HTML. | ||
96 | -> Html -- ^ Resulting HTML. | ||
97 | table = Parent "table" "<table" "</table>" | ||
98 | {-# INLINE table #-} | ||
99 | |||
100 | img :: Html -- ^ Resulting HTML. | ||
101 | img = Leaf "img" "<img" ">" | ||
102 | {-# INLINE img #-} | ||
103 | |||
104 | id :: AttributeValue -- ^ Attribute value. | ||
105 | -> Attribute -- ^ Resulting attribute. | ||
106 | id = attribute "id" " id=\"" | ||
107 | {-# INLINE id #-} | ||
diff --git a/src/Benchmarks/BlazeTBenchmarks.hs b/src/Benchmarks/BlazeTBenchmarks.hs new file mode 100644 index 0000000..83a38ad --- /dev/null +++ b/src/Benchmarks/BlazeTBenchmarks.hs | |||
@@ -0,0 +1,133 @@ | |||
1 | -- | This is a collection of HTML benchmarks for BlazeMarkup. | ||
2 | -- | ||
3 | {-# LANGUAGE OverloadedStrings, ExistentialQuantification, RankNTypes #-} | ||
4 | {-# OPTIONS_GHC -fno-warn-unused-do-bind #-} | ||
5 | module Benchmarks.BlazeTBenchmarks where | ||
6 | |||
7 | import Data.Monoid (Monoid, mempty, mconcat, mappend) | ||
8 | import Prelude hiding (div, id,map) | ||
9 | import qualified Prelude as P | ||
10 | |||
11 | import Text.BlazeT | ||
12 | import Text.BlazeT.Html5 | ||
13 | import qualified Text.BlazeT.Html5 as H | ||
14 | import qualified Text.BlazeT.Html5.Attributes as A | ||
15 | |||
16 | -- | Description of an HTML benchmark | ||
17 | -- | ||
18 | data HtmlBenchmark = forall a. HtmlBenchmark | ||
19 | String -- ^ Name. | ||
20 | (a -> Html) -- ^ Rendering function. | ||
21 | a -- ^ Data. | ||
22 | Html -- ^ Longer description. | ||
23 | |||
24 | -- | List containing all benchmarks. | ||
25 | -- | ||
26 | benchmarks :: [HtmlBenchmark] | ||
27 | benchmarks = | ||
28 | [ HtmlBenchmark "bigTable" bigTable bigTableData $ | ||
29 | let h = toHtml $ length bigTableData | ||
30 | w = toHtml $ length $ P.head bigTableData | ||
31 | in (string "Rendering of a big (") >> h >> (string "x") >> w >> ") HTML table" | ||
32 | , HtmlBenchmark "basic" basic basicData | ||
33 | "A simple, small basic template with a few holes to fill in" | ||
34 | , HtmlBenchmark "wideTree" wideTree wideTreeData $ | ||
35 | (string "A very wide tree (") >> toHtml (length wideTreeData) >> " elements)" | ||
36 | , HtmlBenchmark "wideTreeEscaping" wideTree wideTreeEscapingData $ do | ||
37 | (string "A very wide tree (") >> toHtml (length wideTreeData) >> (string " elements)") | ||
38 | " with lots of escaping" | ||
39 | , HtmlBenchmark "deepTree" deepTree deepTreeData $ do | ||
40 | (string "A really deep tree (") >> toHtml deepTreeData >> " nested templates)" | ||
41 | , HtmlBenchmark "manyAttributes" manyAttributes manyAttributesData $ do | ||
42 | (string "A single element with ") >> toHtml (length manyAttributesData) | ||
43 | " attributes." | ||
44 | , HtmlBenchmark "customAttribute" customAttributes customAttributesData $ | ||
45 | "Creating custom attributes" | ||
46 | ] | ||
47 | |||
48 | rows :: Int | ||
49 | rows = 1000 | ||
50 | |||
51 | bigTableData :: [[Int]] | ||
52 | bigTableData = replicate rows [1..10] | ||
53 | {-# NOINLINE bigTableData #-} | ||
54 | |||
55 | basicData :: (String, String, [String]) | ||
56 | basicData = ("Just a test", "joe", items) | ||
57 | {-# NOINLINE basicData #-} | ||
58 | |||
59 | items :: [String] | ||
60 | items = fmap (("Number " `mappend`) . show) [1 :: Int .. 14] | ||
61 | {-# NOINLINE items #-} | ||
62 | |||
63 | wideTreeData :: [String] | ||
64 | wideTreeData = take 5000 $ | ||
65 | cycle ["λf.(λx.fxx)(λx.fxx)", "These old days", "Foobar", "lol", "x ∈ A"] | ||
66 | {-# NOINLINE wideTreeData #-} | ||
67 | |||
68 | wideTreeEscapingData :: [String] | ||
69 | wideTreeEscapingData = take 1000 $ | ||
70 | cycle ["<><>", "\"lol\"", "<&>", "'>>'"] | ||
71 | {-# NOINLINE wideTreeEscapingData #-} | ||
72 | |||
73 | deepTreeData :: Int | ||
74 | deepTreeData = 1000 | ||
75 | {-# NOINLINE deepTreeData #-} | ||
76 | |||
77 | manyAttributesData :: [String] | ||
78 | manyAttributesData = wideTreeData | ||
79 | |||
80 | customAttributesData :: [(String, String)] | ||
81 | customAttributesData = zip wideTreeData wideTreeData | ||
82 | |||
83 | -- | Render the argument matrix as an HTML table. | ||
84 | -- | ||
85 | bigTable :: [[Int]] -- ^ Matrix. | ||
86 | -> Html -- ^ Result. | ||
87 | bigTable t = table $ mconcat $ fmap row t | ||
88 | where | ||
89 | row r = tr $ mconcat $ fmap (td . toHtml) r | ||
90 | |||
91 | -- | Render a simple HTML page with some data. | ||
92 | -- | ||
93 | basic :: (String, String, [String]) -- ^ (Title, User, Items) | ||
94 | -> Html -- ^ Result. | ||
95 | basic (title', user, items') = html $ do | ||
96 | H.head $ title $ toHtml title' | ||
97 | body $ do | ||
98 | div ! A.id "header" $ (h1 $ toHtml title') | ||
99 | p $ "Hello, " `mappend` toHtml user `mappend` "!" | ||
100 | p $ "Hello, me!" | ||
101 | p $ "Hello, world!" | ||
102 | h2 $ "loop" | ||
103 | ol $ mconcat $ fmap (li . toHtml) items' | ||
104 | div ! A.id "footer" $ mempty | ||
105 | |||
106 | -- | A benchmark producing a very wide but very shallow tree. | ||
107 | -- | ||
108 | wideTree :: [String] -- ^ Text to create a tree from. | ||
109 | -> Html -- ^ Result. | ||
110 | wideTree = div . mapM_ ((p ! A.id "foo") . toHtml) | ||
111 | |||
112 | -- | Create a very deep tree. | ||
113 | -- | ||
114 | deepTree :: Int -- ^ Depth of the tree. | ||
115 | -> Html -- ^ Result. | ||
116 | deepTree 0 = "foo" | ||
117 | deepTree n = p $ table $ tr $ td $ div $ deepTree (n - 1) | ||
118 | |||
119 | -- | Create an element with many attributes. | ||
120 | -- | ||
121 | manyAttributes :: [String] -- ^ List of attribute values. | ||
122 | -> Html -- ^ Result. | ||
123 | manyAttributes = foldl setAttribute img | ||
124 | where | ||
125 | setAttribute html' value' = html' ! A.id (toValue value') | ||
126 | {-# INLINE setAttribute #-} | ||
127 | |||
128 | customAttributes :: [(String, String)] -- ^ List of attribute name, value pairs | ||
129 | -> Html -- ^ Result | ||
130 | customAttributes = foldl setAttribute img | ||
131 | where | ||
132 | setAttribute html' (name, value') = | ||
133 | html' ! customAttribute (stringTag name) (toValue value') | ||
diff --git a/src/Benchmarks/HtmlBenchmarks.hs b/src/Benchmarks/HtmlBenchmarks.hs new file mode 100644 index 0000000..3070d52 --- /dev/null +++ b/src/Benchmarks/HtmlBenchmarks.hs | |||
@@ -0,0 +1,132 @@ | |||
1 | -- | This is a collection of HTML benchmarks for BlazeMarkup. | ||
2 | -- | ||
3 | {-# LANGUAGE OverloadedStrings, ExistentialQuantification #-} | ||
4 | {-# OPTIONS_GHC -fno-warn-unused-do-bind #-} | ||
5 | module Benchmarks.HtmlBenchmarks where | ||
6 | |||
7 | import Data.Monoid (Monoid, mempty, mconcat, mappend) | ||
8 | import Prelude hiding (div, id) | ||
9 | import qualified Prelude as P | ||
10 | |||
11 | import Benchmarks.BenchmarkUtils | ||
12 | import Text.Blaze | ||
13 | import qualified Benchmarks.BenchmarkUtils as H | ||
14 | |||
15 | -- | Description of an HTML benchmark | ||
16 | -- | ||
17 | data HtmlBenchmark = forall a. HtmlBenchmark | ||
18 | { hName :: String -- ^ Name. | ||
19 | , hR :: (a -> Html) -- ^ Rendering function. | ||
20 | , hD :: a -- ^ Data. | ||
21 | , hH :: Html } -- ^ Longer description. | ||
22 | |||
23 | -- | List containing all benchmarks. | ||
24 | -- | ||
25 | benchmarks :: [HtmlBenchmark] | ||
26 | benchmarks = | ||
27 | [ HtmlBenchmark "bigTable" bigTable bigTableData $ | ||
28 | let h = toHtml $ length bigTableData | ||
29 | w = toHtml $ length $ P.head bigTableData | ||
30 | in "Rendering of a big (" >> h >> "x" >> w >> ") HTML table" | ||
31 | , HtmlBenchmark "basic" basic basicData | ||
32 | "A simple, small basic template with a few holes to fill in" | ||
33 | , HtmlBenchmark "wideTree" wideTree wideTreeData $ | ||
34 | "A very wide tree (" >> toHtml (length wideTreeData) >> " elements)" | ||
35 | , HtmlBenchmark "wideTreeEscaping" wideTree wideTreeEscapingData $ do | ||
36 | "A very wide tree (" >> toHtml (length wideTreeData) >> " elements)" | ||
37 | " with lots of escaping" | ||
38 | , HtmlBenchmark "deepTree" deepTree deepTreeData $ do | ||
39 | "A really deep tree (" >> toHtml deepTreeData >> " nested templates)" | ||
40 | , HtmlBenchmark "manyAttributes" manyAttributes manyAttributesData $ do | ||
41 | "A single element with " >> toHtml (length manyAttributesData) | ||
42 | " attributes." | ||
43 | , HtmlBenchmark "customAttribute" customAttributes customAttributesData $ | ||
44 | "Creating custom attributes" | ||
45 | ] | ||
46 | |||
47 | rows :: Int | ||
48 | rows = 1000 | ||
49 | |||
50 | bigTableData :: [[Int]] | ||
51 | bigTableData = replicate rows [1..10] | ||
52 | {-# NOINLINE bigTableData #-} | ||
53 | |||
54 | basicData :: (String, String, [String]) | ||
55 | basicData = ("Just a test", "joe", items) | ||
56 | {-# NOINLINE basicData #-} | ||
57 | |||
58 | items :: [String] | ||
59 | items = map (("Number " `mappend`) . show) [1 :: Int .. 14] | ||
60 | {-# NOINLINE items #-} | ||
61 | |||
62 | wideTreeData :: [String] | ||
63 | wideTreeData = take 5000 $ | ||
64 | cycle ["λf.(λx.fxx)(λx.fxx)", "These old days", "Foobar", "lol", "x ∈ A"] | ||
65 | {-# NOINLINE wideTreeData #-} | ||
66 | |||
67 | wideTreeEscapingData :: [String] | ||
68 | wideTreeEscapingData = take 1000 $ | ||
69 | cycle ["<><>", "\"lol\"", "<&>", "'>>'"] | ||
70 | {-# NOINLINE wideTreeEscapingData #-} | ||
71 | |||
72 | deepTreeData :: Int | ||
73 | deepTreeData = 1000 | ||
74 | {-# NOINLINE deepTreeData #-} | ||
75 | |||
76 | manyAttributesData :: [String] | ||
77 | manyAttributesData = wideTreeData | ||
78 | |||
79 | customAttributesData :: [(String, String)] | ||
80 | customAttributesData = zip wideTreeData wideTreeData | ||
81 | |||
82 | -- | Render the argument matrix as an HTML table. | ||
83 | -- | ||
84 | bigTable :: [[Int]] -- ^ Matrix. | ||
85 | -> Html -- ^ Result. | ||
86 | bigTable t = table $ mconcat $ map row t | ||
87 | where | ||
88 | row r = tr $ mconcat $ map (td . toHtml) r | ||
89 | |||
90 | -- | Render a simple HTML page with some data. | ||
91 | -- | ||
92 | basic :: (String, String, [String]) -- ^ (Title, User, Items) | ||
93 | -> Html -- ^ Result. | ||
94 | basic (title', user, items') = html $ do | ||
95 | H.head $ title $ toHtml title' | ||
96 | body $ do | ||
97 | div ! id "header" $ (h1 $ toHtml title') | ||
98 | p $ "Hello, " `mappend` toHtml user `mappend` "!" | ||
99 | p $ "Hello, me!" | ||
100 | p $ "Hello, world!" | ||
101 | h2 $ "loop" | ||
102 | ol $ mconcat $ map (li . toHtml) items' | ||
103 | div ! id "footer" $ mempty | ||
104 | |||
105 | -- | A benchmark producing a very wide but very shallow tree. | ||
106 | -- | ||
107 | wideTree :: [String] -- ^ Text to create a tree from. | ||
108 | -> Html -- ^ Result. | ||
109 | wideTree = div . mapM_ ((p ! id "foo") . toHtml) | ||
110 | |||
111 | -- | Create a very deep tree. | ||
112 | -- | ||
113 | deepTree :: Int -- ^ Depth of the tree. | ||
114 | -> Html -- ^ Result. | ||
115 | deepTree 0 = "foo" | ||
116 | deepTree n = p $ table $ tr $ td $ div $ deepTree (n - 1) | ||
117 | |||
118 | -- | Create an element with many attributes. | ||
119 | -- | ||
120 | manyAttributes :: [String] -- ^ List of attribute values. | ||
121 | -> Html -- ^ Result. | ||
122 | manyAttributes = foldl setAttribute img | ||
123 | where | ||
124 | setAttribute html' value' = html' ! id (toValue value') | ||
125 | {-# INLINE setAttribute #-} | ||
126 | |||
127 | customAttributes :: [(String, String)] -- ^ List of attribute name, value pairs | ||
128 | -> Html -- ^ Result | ||
129 | customAttributes = foldl setAttribute img | ||
130 | where | ||
131 | setAttribute html' (name, value') = | ||
132 | html' ! customAttribute (stringTag name) (toValue value') | ||
diff --git a/src/Benchmarks/LICENSE b/src/Benchmarks/LICENSE new file mode 100644 index 0000000..8122505 --- /dev/null +++ b/src/Benchmarks/LICENSE | |||
@@ -0,0 +1,30 @@ | |||
1 | Copyright Jasper Van der Jeugt 2010 | ||
2 | |||
3 | All rights reserved. | ||
4 | |||
5 | Redistribution and use in source and binary forms, with or without | ||
6 | modification, are permitted provided that the following conditions are met: | ||
7 | |||
8 | * Redistributions of source code must retain the above copyright | ||
9 | notice, this list of conditions and the following disclaimer. | ||
10 | |||
11 | * Redistributions in binary form must reproduce the above | ||
12 | copyright notice, this list of conditions and the following | ||
13 | disclaimer in the documentation and/or other materials provided | ||
14 | with the distribution. | ||
15 | |||
16 | * Neither the name of Jasper Van der Jeugt nor the names of other | ||
17 | contributors may be used to endorse or promote products derived | ||
18 | from this software without specific prior written permission. | ||
19 | |||
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
21 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
22 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
23 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
24 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
25 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
26 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
27 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
28 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
diff --git a/src/Benchmarks/RunHtmlBenchmarks.hs b/src/Benchmarks/RunHtmlBenchmarks.hs new file mode 100644 index 0000000..04c28ff --- /dev/null +++ b/src/Benchmarks/RunHtmlBenchmarks.hs | |||
@@ -0,0 +1,36 @@ | |||
1 | -- | This is a module which runs the 'HtmlBenchmarks' module using the different | ||
2 | -- renderers available. | ||
3 | -- | ||
4 | module Benchmarks.RunHtmlBenchmarks where | ||
5 | |||
6 | import Criterion.Main | ||
7 | import qualified Data.Text.Lazy as LT | ||
8 | import Data.List | ||
9 | import qualified Data.ByteString.Lazy as LB | ||
10 | |||
11 | import qualified Text.Blaze.Renderer.Utf8 as Utf8 | ||
12 | import qualified Text.Blaze.Renderer.String as String | ||
13 | import qualified Text.Blaze.Renderer.Text as Text | ||
14 | |||
15 | import Benchmarks.HtmlBenchmarks (HtmlBenchmark (..), benchmarks) | ||
16 | import qualified Benchmarks.BlazeTBenchmarks as BT (HtmlBenchmark (..), benchmarks) | ||
17 | import qualified Text.BlazeT.Renderer.Utf8 as TUtf8 | ||
18 | import qualified Text.BlazeT.Renderer.String as TString | ||
19 | import qualified Text.BlazeT.Renderer.Text as TText | ||
20 | |||
21 | -- | Function to run the benchmarks using criterion | ||
22 | -- | ||
23 | main :: IO () | ||
24 | main = defaultMain $ zipWith g benchmarks BT.benchmarks | ||
25 | where | ||
26 | g x y = bgroup (hName x) $ benchHtml x ++ benchHtml2 y | ||
27 | benchHtml (HtmlBenchmark _ f x _) = | ||
28 | [ bench "Utf8" $ nf (LB.length . Utf8.renderMarkup . f) x | ||
29 | , bench "String" $ nf (String.renderMarkup . f) x | ||
30 | , bench "Text" $ nf (LT.length . Text.renderMarkup . f) x | ||
31 | ] | ||
32 | benchHtml2 (BT.HtmlBenchmark _ f x _) = | ||
33 | [ bench "BlazeT.Utf8" $ nf (LB.length . TUtf8.renderMarkup . f) x | ||
34 | , bench "BlazeT.String" $ nf (TString.renderMarkup . f) x | ||
35 | , bench "BlazeT.Text" $ nf (LT.length . TText.renderMarkup . f) x | ||
36 | ] | ||
diff --git a/src/Benchmarks/ServerChunkSize.hs b/src/Benchmarks/ServerChunkSize.hs new file mode 100644 index 0000000..7b01c68 --- /dev/null +++ b/src/Benchmarks/ServerChunkSize.hs | |||
@@ -0,0 +1,52 @@ | |||
1 | -- | A benchmark for measuring the impact of lazy bytestring chunk size on | ||
2 | -- server performance. | ||
3 | -- | ||
4 | {-# LANGUAGE OverloadedStrings #-} | ||
5 | module Main where | ||
6 | |||
7 | import Control.Concurrent (forkIO) | ||
8 | import Control.Monad (forever) | ||
9 | import Data.Monoid (mappend) | ||
10 | import Network (listenOn, PortID (PortNumber)) | ||
11 | import Network.Socket (accept, sClose) | ||
12 | import Prelude hiding (putStrLn) | ||
13 | import System.Environment (getArgs) | ||
14 | |||
15 | import Network.Socket.ByteString (recv, send) | ||
16 | import Network.Socket.ByteString.Lazy (sendAll) | ||
17 | import qualified Data.ByteString.Char8 as SBC | ||
18 | import qualified Data.ByteString.Lazy as LB | ||
19 | |||
20 | -- | Generate a 128k response, with a given chunk size. | ||
21 | -- | ||
22 | makeResponse :: Int -- ^ Chunk size. | ||
23 | -> LB.ByteString -- ^ Result. | ||
24 | makeResponse chunkSize = | ||
25 | let chunks = createChunks chunkSize totalSize | ||
26 | in LB.fromChunks chunks | ||
27 | where | ||
28 | -- A 64 kilobyte response. | ||
29 | totalSize = 128 * 1024 | ||
30 | |||
31 | createChunks c s | ||
32 | | c < s = SBC.replicate c 'a' : createChunks c (s - c) | ||
33 | | otherwise = SBC.replicate s 'a' : [] | ||
34 | |||
35 | main :: IO () | ||
36 | main = do | ||
37 | args <- getArgs | ||
38 | let port = PortNumber $ fromIntegral $ (read $ head args :: Int) | ||
39 | chunkSize = read $ args !! 1 | ||
40 | |||
41 | socket <- listenOn port | ||
42 | forever $ do | ||
43 | (s, _) <- accept socket | ||
44 | forkIO (respond chunkSize s) | ||
45 | where | ||
46 | respond chunkSize s = do | ||
47 | _ <- recv s 1024 | ||
48 | _ <- send s $ "HTTP/1.1 200 OK\r\n" | ||
49 | `mappend` "Content-Type: text/html; charset=UTF-8\r\n" | ||
50 | `mappend` "\r\n" | ||
51 | sendAll s $ makeResponse chunkSize | ||
52 | sClose s | ||
diff --git a/src/Benchmarks/bigtable/erb.rb b/src/Benchmarks/bigtable/erb.rb new file mode 100644 index 0000000..c3a675a --- /dev/null +++ b/src/Benchmarks/bigtable/erb.rb | |||
@@ -0,0 +1,32 @@ | |||
1 | # BigTable benchmark implemented in ERB. | ||
2 | # | ||
3 | require 'erb' | ||
4 | require 'benchmark' | ||
5 | include ERB::Util | ||
6 | |||
7 | table = (1 .. 1000).map do |_| (1 .. 10) end | ||
8 | |||
9 | template = ERB.new <<-EOF | ||
10 | <table> | ||
11 | <% table.each do |row| %> | ||
12 | <tr> | ||
13 | <% row.each do |value| %> | ||
14 | <td> | ||
15 | <%= value %> | ||
16 | </td> | ||
17 | <% end %> | ||
18 | </tr> | ||
19 | <% end %> | ||
20 | </table> | ||
21 | EOF | ||
22 | |||
23 | number_runs = 100 | ||
24 | start_time = Time.now.to_f | ||
25 | number_runs.times do | ||
26 | template.result(binding) | ||
27 | end | ||
28 | end_time = Time.now.to_f | ||
29 | |||
30 | # start_time and end_time are both in seconds now | ||
31 | ms = (end_time - start_time) * 1000 / number_runs | ||
32 | puts "\"ERB\", #{ms}" | ||
diff --git a/src/Benchmarks/bigtable/erubis.rb b/src/Benchmarks/bigtable/erubis.rb new file mode 100644 index 0000000..9a1edf9 --- /dev/null +++ b/src/Benchmarks/bigtable/erubis.rb | |||
@@ -0,0 +1,31 @@ | |||
1 | # BigTable benchmark implemented in erubis | ||
2 | # | ||
3 | require 'erubis' | ||
4 | require 'benchmark' | ||
5 | |||
6 | table = (1 .. 1000).map do |_| (1 .. 10) end | ||
7 | |||
8 | template = Erubis::Eruby.new <<-EOF | ||
9 | <table> | ||
10 | <% table.each do |row| %> | ||
11 | <tr> | ||
12 | <% row.each do |value| %> | ||
13 | <td> | ||
14 | <%= value %> | ||
15 | </td> | ||
16 | <% end %> | ||
17 | </tr> | ||
18 | <% end %> | ||
19 | </table> | ||
20 | EOF | ||
21 | |||
22 | number_runs = 100 | ||
23 | start_time = Time.now.to_f | ||
24 | number_runs.times do | ||
25 | template.result(binding) | ||
26 | end | ||
27 | end_time = Time.now.to_f | ||
28 | |||
29 | # start_time and end_time are both in seconds now | ||
30 | ms = (end_time - start_time) * 1000 / number_runs | ||
31 | puts "\"Erubis\", #{ms}" | ||
diff --git a/src/Benchmarks/bigtable/hamlet.hs b/src/Benchmarks/bigtable/hamlet.hs new file mode 100644 index 0000000..2778f2d --- /dev/null +++ b/src/Benchmarks/bigtable/hamlet.hs | |||
@@ -0,0 +1,33 @@ | |||
1 | -- | BigTable benchmark implemented using Hamlet. | ||
2 | -- | ||
3 | {-# LANGUAGE QuasiQuotes #-} | ||
4 | module Main where | ||
5 | |||
6 | import Criterion.Main | ||
7 | import Text.Hamlet | ||
8 | import Text.Hamlet.Monad | ||
9 | import Numeric (showInt) | ||
10 | import Data.Text (Text) | ||
11 | import qualified Data.Text as T | ||
12 | import Data.Maybe (fromJust) | ||
13 | |||
14 | main = defaultMain | ||
15 | [ bench "bigTable" $ nf bigTable bigTableData | ||
16 | ] | ||
17 | where | ||
18 | rows :: Int | ||
19 | rows = 1000 | ||
20 | |||
21 | bigTableData :: [[Int]] | ||
22 | bigTableData = replicate rows [1..10] | ||
23 | {-# NOINLINE bigTableData #-} | ||
24 | |||
25 | bigTable rows = fromJust $ hamletToText undefined [$hamlet| | ||
26 | %table | ||
27 | $forall rows row | ||
28 | %tr | ||
29 | $forall row cell | ||
30 | %td $showInt'.cell$ | ||
31 | |] | ||
32 | where | ||
33 | showInt' i = Encoded $ T.pack $ showInt i "" | ||
diff --git a/src/Benchmarks/bigtable/html-minimalist.hs b/src/Benchmarks/bigtable/html-minimalist.hs new file mode 100644 index 0000000..2a52751 --- /dev/null +++ b/src/Benchmarks/bigtable/html-minimalist.hs | |||
@@ -0,0 +1,20 @@ | |||
1 | -- | BigTable benchmark using the html-minimalist package from hackage. | ||
2 | -- | ||
3 | import Text.HTML.Light hiding (map) | ||
4 | import Criterion.Main | ||
5 | |||
6 | bigTable :: [[Int]] -> String | ||
7 | bigTable t = | ||
8 | renderXHTML xhtml_1_0_strict $ html [] $ return $ table [] $ map row t | ||
9 | where | ||
10 | row r = tr [] $ map (td [] . return . cdata . show) r | ||
11 | |||
12 | main = defaultMain | ||
13 | [ bench "bigTable" $ nf bigTable myTable ] | ||
14 | where | ||
15 | rows :: Int | ||
16 | rows = 1000 | ||
17 | |||
18 | myTable :: [[Int]] | ||
19 | myTable = replicate rows [1..10] | ||
20 | {-# NOINLINE myTable #-} | ||
diff --git a/src/Benchmarks/bigtable/html.hs b/src/Benchmarks/bigtable/html.hs new file mode 100644 index 0000000..57a62b3 --- /dev/null +++ b/src/Benchmarks/bigtable/html.hs | |||
@@ -0,0 +1,19 @@ | |||
1 | -- | BigTable benchmark using the HTML package from hackage. | ||
2 | -- | ||
3 | import Text.Html | ||
4 | import Criterion.Main | ||
5 | |||
6 | bigTable :: [[Int]] -> String | ||
7 | bigTable t = renderHtml $ table $ concatHtml $ map row t | ||
8 | where | ||
9 | row r = tr $ concatHtml $ map (td . stringToHtml . show) r | ||
10 | |||
11 | main = defaultMain | ||
12 | [ bench "bigTable" $ nf bigTable myTable ] | ||
13 | where | ||
14 | rows :: Int | ||
15 | rows = 1000 | ||
16 | |||
17 | myTable :: [[Int]] | ||
18 | myTable = replicate rows [1..10] | ||
19 | {-# NOINLINE myTable #-} | ||
diff --git a/src/Benchmarks/bigtable/php.php b/src/Benchmarks/bigtable/php.php new file mode 100644 index 0000000..f2e51a4 --- /dev/null +++ b/src/Benchmarks/bigtable/php.php | |||
@@ -0,0 +1,30 @@ | |||
1 | <?php | ||
2 | $table = array_fill(0, 1000, array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)); | ||
3 | |||
4 | function test_bigtable($table) { | ||
5 | ob_start(); | ||
6 | ?> | ||
7 | <table> | ||
8 | <?php foreach($table as $row) { ?> | ||
9 | <tr> | ||
10 | <?php foreach($row as $value) { ?> | ||
11 | <td><?php echo $value; ?></td> | ||
12 | <?php } ?> | ||
13 | </tr> | ||
14 | <?php } ?> | ||
15 | </table> | ||
16 | <?php | ||
17 | return ob_get_clean(); | ||
18 | } | ||
19 | |||
20 | $request_count = 1000; | ||
21 | |||
22 | $start = microtime(true); | ||
23 | for ($i = 0; $i < $request_count; $i++) | ||
24 | { | ||
25 | test_bigtable($table); | ||
26 | } | ||
27 | $elapsed = microtime(true) - $start; | ||
28 | $time_per_request = ($elapsed / $request_count) * 1000; | ||
29 | echo "\"PHP\", $time_per_request\n"; | ||
30 | ?> | ||
diff --git a/src/Benchmarks/bigtable/xhtml.hs b/src/Benchmarks/bigtable/xhtml.hs new file mode 100644 index 0000000..993994c --- /dev/null +++ b/src/Benchmarks/bigtable/xhtml.hs | |||
@@ -0,0 +1,19 @@ | |||
1 | -- | BigTable benchmark using the XHTML package from hackage. | ||
2 | -- | ||
3 | import Text.XHtml.Strict | ||
4 | import Criterion.Main | ||
5 | |||
6 | bigTable :: [[Int]] -> String | ||
7 | bigTable t = renderHtml $ table $ concatHtml $ map row t | ||
8 | where | ||
9 | row r = tr $ concatHtml $ map (td . stringToHtml . show) r | ||
10 | |||
11 | main = defaultMain | ||
12 | [ bench "bigTable" $ nf bigTable myTable ] | ||
13 | where | ||
14 | rows :: Int | ||
15 | rows = 1000 | ||
16 | |||
17 | myTable :: [[Int]] | ||
18 | myTable = replicate rows [1..10] | ||
19 | {-# NOINLINE myTable #-} | ||
diff --git a/src/Text/BlazeT.hs b/src/Text/BlazeT.hs new file mode 100644 index 0000000..27228fa --- /dev/null +++ b/src/Text/BlazeT.hs | |||
@@ -0,0 +1,81 @@ | |||
1 | {-# LANGUAGE UndecidableInstances #-} | ||
2 | {-# LANGUAGE FlexibleInstances #-} | ||
3 | {-# LANGUAGE RankNTypes #-} | ||
4 | module Text.BlazeT | ||
5 | ( | ||
6 | -- * Important types. | ||
7 | Markup | ||
8 | , Tag | ||
9 | , Attribute | ||
10 | , AttributeValue | ||
11 | |||
12 | -- * Creating attributes. | ||
13 | , dataAttribute | ||
14 | , customAttribute | ||
15 | |||
16 | -- * Converting values to Markup. | ||
17 | , ToMarkup (..) | ||
18 | , text | ||
19 | , preEscapedText | ||
20 | , lazyText | ||
21 | , preEscapedLazyText | ||
22 | , string | ||
23 | , preEscapedString | ||
24 | , unsafeByteString | ||
25 | , unsafeLazyByteString | ||
26 | |||
27 | -- * Comments | ||
28 | , textComment | ||
29 | , lazyTextComment | ||
30 | , stringComment | ||
31 | , unsafeByteStringComment | ||
32 | , unsafeLazyByteStringComment | ||
33 | |||
34 | -- * Creating tags. | ||
35 | , textTag | ||
36 | , stringTag | ||
37 | |||
38 | -- * Converting values to attribute values. | ||
39 | , B.ToValue (..) | ||
40 | , textValue | ||
41 | , preEscapedTextValue | ||
42 | , lazyTextValue | ||
43 | , preEscapedLazyTextValue | ||
44 | , stringValue | ||
45 | , preEscapedStringValue | ||
46 | , unsafeByteStringValue | ||
47 | , unsafeLazyByteStringValue | ||
48 | |||
49 | -- * Setting attributes | ||
50 | , (!) | ||
51 | , (!?) | ||
52 | |||
53 | -- * Modifiying Markup trees | ||
54 | , contents | ||
55 | |||
56 | -- * BlazeT new stuff | ||
57 | ,MarkupM | ||
58 | ,Markup2 | ||
59 | ,mapMarkupT | ||
60 | ,MarkupT | ||
61 | ,runMarkup | ||
62 | ,runMarkupT | ||
63 | ,execMarkup | ||
64 | ,execMarkupT | ||
65 | ) where | ||
66 | |||
67 | import qualified Text.Blaze as B | ||
68 | import Text.BlazeT.Internal | ||
69 | |||
70 | class ToMarkup a where | ||
71 | toMarkup :: a -> Markup | ||
72 | preEscapedToMarkup :: a -> Markup | ||
73 | |||
74 | -- test :: (ToMarkup a, Monad m) => a -> MarkupT m () | ||
75 | -- test = toMarkup | ||
76 | |||
77 | instance B.ToMarkup a => ToMarkup a where | ||
78 | toMarkup = wrapMarkup . B.toMarkup | ||
79 | {-# INLINE toMarkup #-} | ||
80 | preEscapedToMarkup = wrapMarkup . B.preEscapedToMarkup | ||
81 | {-# INLINE preEscapedToMarkup #-} | ||
diff --git a/src/Text/BlazeT/Html.hs b/src/Text/BlazeT/Html.hs new file mode 100644 index 0000000..4a21c03 --- /dev/null +++ b/src/Text/BlazeT/Html.hs | |||
@@ -0,0 +1,22 @@ | |||
1 | {-# LANGUAGE RankNTypes #-} | ||
2 | module Text.BlazeT.Html | ||
3 | ( module Text.BlazeT | ||
4 | , Html | ||
5 | , toHtml | ||
6 | , preEscapedToHtml | ||
7 | -- * BlazeT new stuff | ||
8 | ,HtmlM | ||
9 | ,HtmlT | ||
10 | ) where | ||
11 | |||
12 | import Text.BlazeT | ||
13 | |||
14 | type HtmlT = MarkupT | ||
15 | type HtmlM = MarkupM | ||
16 | type Html = Markup | ||
17 | |||
18 | toHtml ::(ToMarkup a) => a -> Html | ||
19 | toHtml = toMarkup | ||
20 | |||
21 | preEscapedToHtml ::(ToMarkup a) => a -> Html | ||
22 | preEscapedToHtml = preEscapedToMarkup | ||
diff --git a/src/Text/BlazeT/Html4/FrameSet.hs b/src/Text/BlazeT/Html4/FrameSet.hs new file mode 100644 index 0000000..5d6ec03 --- /dev/null +++ b/src/Text/BlazeT/Html4/FrameSet.hs | |||
@@ -0,0 +1,198 @@ | |||
1 | -- !! DO NOT EDIT | ||
2 | {-| | ||
3 | (Automatically generated by @src\/Util\/GenerateHtmlTCombinators.hs:49@) | ||
4 | |||
5 | This module wraps all exports of "Text.Blaze.Html4.FrameSet" using 'wrapMarkup' and 'wrapMarkup'. | ||
6 | -} | ||
7 | module Text.BlazeT.Html4.FrameSet | ||
8 | (module Text.BlazeT.Html4.FrameSet | ||
9 | ,module Text.BlazeT.Html | ||
10 | ) where | ||
11 | import qualified Text.Blaze.Html4.FrameSet | ||
12 | import Text.BlazeT | ||
13 | import Text.BlazeT.Html | ||
14 | import Text.BlazeT.Internal | ||
15 | |||
16 | docTypeHtml :: Markup2 | ||
17 | docTypeHtml = wrapMarkup2 Text.Blaze.Html4.FrameSet.docTypeHtml | ||
18 | a :: Markup2 | ||
19 | a = wrapMarkup2 Text.Blaze.Html4.FrameSet.a | ||
20 | abbr :: Markup2 | ||
21 | abbr = wrapMarkup2 Text.Blaze.Html4.FrameSet.abbr | ||
22 | acronym :: Markup2 | ||
23 | acronym = wrapMarkup2 Text.Blaze.Html4.FrameSet.acronym | ||
24 | address :: Markup2 | ||
25 | address = wrapMarkup2 Text.Blaze.Html4.FrameSet.address | ||
26 | b :: Markup2 | ||
27 | b = wrapMarkup2 Text.Blaze.Html4.FrameSet.b | ||
28 | bdo :: Markup2 | ||
29 | bdo = wrapMarkup2 Text.Blaze.Html4.FrameSet.bdo | ||
30 | big :: Markup2 | ||
31 | big = wrapMarkup2 Text.Blaze.Html4.FrameSet.big | ||
32 | blockquote :: Markup2 | ||
33 | blockquote = wrapMarkup2 Text.Blaze.Html4.FrameSet.blockquote | ||
34 | body :: Markup2 | ||
35 | body = wrapMarkup2 Text.Blaze.Html4.FrameSet.body | ||
36 | button :: Markup2 | ||
37 | button = wrapMarkup2 Text.Blaze.Html4.FrameSet.button | ||
38 | caption :: Markup2 | ||
39 | caption = wrapMarkup2 Text.Blaze.Html4.FrameSet.caption | ||
40 | cite :: Markup2 | ||
41 | cite = wrapMarkup2 Text.Blaze.Html4.FrameSet.cite | ||
42 | code :: Markup2 | ||
43 | code = wrapMarkup2 Text.Blaze.Html4.FrameSet.code | ||
44 | colgroup :: Markup2 | ||
45 | colgroup = wrapMarkup2 Text.Blaze.Html4.FrameSet.colgroup | ||
46 | dd :: Markup2 | ||
47 | dd = wrapMarkup2 Text.Blaze.Html4.FrameSet.dd | ||
48 | del :: Markup2 | ||
49 | del = wrapMarkup2 Text.Blaze.Html4.FrameSet.del | ||
50 | dfn :: Markup2 | ||
51 | dfn = wrapMarkup2 Text.Blaze.Html4.FrameSet.dfn | ||
52 | div :: Markup2 | ||
53 | div = wrapMarkup2 Text.Blaze.Html4.FrameSet.div | ||
54 | dl :: Markup2 | ||
55 | dl = wrapMarkup2 Text.Blaze.Html4.FrameSet.dl | ||
56 | dt :: Markup2 | ||
57 | dt = wrapMarkup2 Text.Blaze.Html4.FrameSet.dt | ||
58 | em :: Markup2 | ||
59 | em = wrapMarkup2 Text.Blaze.Html4.FrameSet.em | ||
60 | fieldset :: Markup2 | ||
61 | fieldset = wrapMarkup2 Text.Blaze.Html4.FrameSet.fieldset | ||
62 | form :: Markup2 | ||
63 | form = wrapMarkup2 Text.Blaze.Html4.FrameSet.form | ||
64 | h1 :: Markup2 | ||
65 | h1 = wrapMarkup2 Text.Blaze.Html4.FrameSet.h1 | ||
66 | h2 :: Markup2 | ||
67 | h2 = wrapMarkup2 Text.Blaze.Html4.FrameSet.h2 | ||
68 | h3 :: Markup2 | ||
69 | h3 = wrapMarkup2 Text.Blaze.Html4.FrameSet.h3 | ||
70 | h4 :: Markup2 | ||
71 | h4 = wrapMarkup2 Text.Blaze.Html4.FrameSet.h4 | ||
72 | h5 :: Markup2 | ||
73 | h5 = wrapMarkup2 Text.Blaze.Html4.FrameSet.h5 | ||
74 | h6 :: Markup2 | ||
75 | h6 = wrapMarkup2 Text.Blaze.Html4.FrameSet.h6 | ||
76 | head :: Markup2 | ||
77 | head = wrapMarkup2 Text.Blaze.Html4.FrameSet.head | ||
78 | html :: Markup2 | ||
79 | html = wrapMarkup2 Text.Blaze.Html4.FrameSet.html | ||
80 | i :: Markup2 | ||
81 | i = wrapMarkup2 Text.Blaze.Html4.FrameSet.i | ||
82 | ins :: Markup2 | ||
83 | ins = wrapMarkup2 Text.Blaze.Html4.FrameSet.ins | ||
84 | kbd :: Markup2 | ||
85 | kbd = wrapMarkup2 Text.Blaze.Html4.FrameSet.kbd | ||
86 | label :: Markup2 | ||
87 | label = wrapMarkup2 Text.Blaze.Html4.FrameSet.label | ||
88 | legend :: Markup2 | ||
89 | legend = wrapMarkup2 Text.Blaze.Html4.FrameSet.legend | ||
90 | li :: Markup2 | ||
91 | li = wrapMarkup2 Text.Blaze.Html4.FrameSet.li | ||
92 | map :: Markup2 | ||
93 | map = wrapMarkup2 Text.Blaze.Html4.FrameSet.map | ||
94 | noscript :: Markup2 | ||
95 | noscript = wrapMarkup2 Text.Blaze.Html4.FrameSet.noscript | ||
96 | object :: Markup2 | ||
97 | object = wrapMarkup2 Text.Blaze.Html4.FrameSet.object | ||
98 | ol :: Markup2 | ||
99 | ol = wrapMarkup2 Text.Blaze.Html4.FrameSet.ol | ||
100 | optgroup :: Markup2 | ||
101 | optgroup = wrapMarkup2 Text.Blaze.Html4.FrameSet.optgroup | ||
102 | option :: Markup2 | ||
103 | option = wrapMarkup2 Text.Blaze.Html4.FrameSet.option | ||
104 | p :: Markup2 | ||
105 | p = wrapMarkup2 Text.Blaze.Html4.FrameSet.p | ||
106 | pre :: Markup2 | ||
107 | pre = wrapMarkup2 Text.Blaze.Html4.FrameSet.pre | ||
108 | q :: Markup2 | ||
109 | q = wrapMarkup2 Text.Blaze.Html4.FrameSet.q | ||
110 | samp :: Markup2 | ||
111 | samp = wrapMarkup2 Text.Blaze.Html4.FrameSet.samp | ||
112 | script :: Markup2 | ||
113 | script = wrapMarkup2 Text.Blaze.Html4.FrameSet.script | ||
114 | select :: Markup2 | ||
115 | select = wrapMarkup2 Text.Blaze.Html4.FrameSet.select | ||
116 | small :: Markup2 | ||
117 | small = wrapMarkup2 Text.Blaze.Html4.FrameSet.small | ||
118 | span :: Markup2 | ||
119 | span = wrapMarkup2 Text.Blaze.Html4.FrameSet.span | ||
120 | strong :: Markup2 | ||
121 | strong = wrapMarkup2 Text.Blaze.Html4.FrameSet.strong | ||
122 | style :: Markup2 | ||
123 | style = wrapMarkup2 Text.Blaze.Html4.FrameSet.style | ||
124 | sub :: Markup2 | ||
125 | sub = wrapMarkup2 Text.Blaze.Html4.FrameSet.sub | ||
126 | sup :: Markup2 | ||
127 | sup = wrapMarkup2 Text.Blaze.Html4.FrameSet.sup | ||
128 | table :: Markup2 | ||
129 | table = wrapMarkup2 Text.Blaze.Html4.FrameSet.table | ||
130 | tbody :: Markup2 | ||
131 | tbody = wrapMarkup2 Text.Blaze.Html4.FrameSet.tbody | ||
132 | td :: Markup2 | ||
133 | td = wrapMarkup2 Text.Blaze.Html4.FrameSet.td | ||
134 | textarea :: Markup2 | ||
135 | textarea = wrapMarkup2 Text.Blaze.Html4.FrameSet.textarea | ||
136 | tfoot :: Markup2 | ||
137 | tfoot = wrapMarkup2 Text.Blaze.Html4.FrameSet.tfoot | ||
138 | th :: Markup2 | ||
139 | th = wrapMarkup2 Text.Blaze.Html4.FrameSet.th | ||
140 | thead :: Markup2 | ||
141 | thead = wrapMarkup2 Text.Blaze.Html4.FrameSet.thead | ||
142 | title :: Markup2 | ||
143 | title = wrapMarkup2 Text.Blaze.Html4.FrameSet.title | ||
144 | tr :: Markup2 | ||
145 | tr = wrapMarkup2 Text.Blaze.Html4.FrameSet.tr | ||
146 | tt :: Markup2 | ||
147 | tt = wrapMarkup2 Text.Blaze.Html4.FrameSet.tt | ||
148 | ul :: Markup2 | ||
149 | ul = wrapMarkup2 Text.Blaze.Html4.FrameSet.ul | ||
150 | var :: Markup2 | ||
151 | var = wrapMarkup2 Text.Blaze.Html4.FrameSet.var | ||
152 | applet :: Markup2 | ||
153 | applet = wrapMarkup2 Text.Blaze.Html4.FrameSet.applet | ||
154 | center :: Markup2 | ||
155 | center = wrapMarkup2 Text.Blaze.Html4.FrameSet.center | ||
156 | dir :: Markup2 | ||
157 | dir = wrapMarkup2 Text.Blaze.Html4.FrameSet.dir | ||
158 | font :: Markup2 | ||
159 | font = wrapMarkup2 Text.Blaze.Html4.FrameSet.font | ||
160 | iframe :: Markup2 | ||
161 | iframe = wrapMarkup2 Text.Blaze.Html4.FrameSet.iframe | ||
162 | isindex :: Markup2 | ||
163 | isindex = wrapMarkup2 Text.Blaze.Html4.FrameSet.isindex | ||
164 | menu :: Markup2 | ||
165 | menu = wrapMarkup2 Text.Blaze.Html4.FrameSet.menu | ||
166 | noframes :: Markup2 | ||
167 | noframes = wrapMarkup2 Text.Blaze.Html4.FrameSet.noframes | ||
168 | s :: Markup2 | ||
169 | s = wrapMarkup2 Text.Blaze.Html4.FrameSet.s | ||
170 | u :: Markup2 | ||
171 | u = wrapMarkup2 Text.Blaze.Html4.FrameSet.u | ||
172 | frameset :: Markup2 | ||
173 | frameset = wrapMarkup2 Text.Blaze.Html4.FrameSet.frameset | ||
174 | docType :: Markup | ||
175 | docType = wrapMarkup Text.Blaze.Html4.FrameSet.docType | ||
176 | area :: Markup | ||
177 | area = wrapMarkup Text.Blaze.Html4.FrameSet.area | ||
178 | br :: Markup | ||
179 | br = wrapMarkup Text.Blaze.Html4.FrameSet.br | ||
180 | col :: Markup | ||
181 | col = wrapMarkup Text.Blaze.Html4.FrameSet.col | ||
182 | hr :: Markup | ||
183 | hr = wrapMarkup Text.Blaze.Html4.FrameSet.hr | ||
184 | link :: Markup | ||
185 | link = wrapMarkup Text.Blaze.Html4.FrameSet.link | ||
186 | img :: Markup | ||
187 | img = wrapMarkup Text.Blaze.Html4.FrameSet.img | ||
188 | input :: Markup | ||
189 | input = wrapMarkup Text.Blaze.Html4.FrameSet.input | ||
190 | meta :: Markup | ||
191 | meta = wrapMarkup Text.Blaze.Html4.FrameSet.meta | ||
192 | param :: Markup | ||
193 | param = wrapMarkup Text.Blaze.Html4.FrameSet.param | ||
194 | basefont :: Markup | ||
195 | basefont = wrapMarkup Text.Blaze.Html4.FrameSet.basefont | ||
196 | frame :: Markup | ||
197 | frame = wrapMarkup Text.Blaze.Html4.FrameSet.frame | ||
198 | |||
diff --git a/src/Text/BlazeT/Html4/FrameSet/Attributes.hs b/src/Text/BlazeT/Html4/FrameSet/Attributes.hs new file mode 100644 index 0000000..d806f29 --- /dev/null +++ b/src/Text/BlazeT/Html4/FrameSet/Attributes.hs | |||
@@ -0,0 +1,11 @@ | |||
1 | -- !! DO NOT EDIT | ||
2 | {-| | ||
3 | (Automatically generated by @src\/Util\/GenerateHtmlTCombinators.hs:49@) | ||
4 | |||
5 | This module simply reexports the corresponding @blaze-html@ module. | ||
6 | -} | ||
7 | module Text.BlazeT.Html4.FrameSet.Attributes | ||
8 | (module Text.Blaze.Html4.FrameSet.Attributes | ||
9 | ) where | ||
10 | import Text.Blaze.Html4.FrameSet.Attributes | ||
11 | |||
diff --git a/src/Text/BlazeT/Html4/Strict.hs b/src/Text/BlazeT/Html4/Strict.hs new file mode 100644 index 0000000..90fd65a --- /dev/null +++ b/src/Text/BlazeT/Html4/Strict.hs | |||
@@ -0,0 +1,172 @@ | |||
1 | -- !! DO NOT EDIT | ||
2 | {-| | ||
3 | (Automatically generated by @src\/Util\/GenerateHtmlTCombinators.hs:49@) | ||
4 | |||
5 | This module wraps all exports of "Text.Blaze.Html4.Strict" using 'wrapMarkup' and 'wrapMarkup'. | ||
6 | -} | ||
7 | module Text.BlazeT.Html4.Strict | ||
8 | (module Text.BlazeT.Html4.Strict | ||
9 | ,module Text.BlazeT.Html | ||
10 | ) where | ||
11 | import qualified Text.Blaze.Html4.Strict | ||
12 | import Text.BlazeT | ||
13 | import Text.BlazeT.Html | ||
14 | import Text.BlazeT.Internal | ||
15 | |||
16 | docTypeHtml :: Markup2 | ||
17 | docTypeHtml = wrapMarkup2 Text.Blaze.Html4.Strict.docTypeHtml | ||
18 | a :: Markup2 | ||
19 | a = wrapMarkup2 Text.Blaze.Html4.Strict.a | ||
20 | abbr :: Markup2 | ||
21 | abbr = wrapMarkup2 Text.Blaze.Html4.Strict.abbr | ||
22 | acronym :: Markup2 | ||
23 | acronym = wrapMarkup2 Text.Blaze.Html4.Strict.acronym | ||
24 | address :: Markup2 | ||
25 | address = wrapMarkup2 Text.Blaze.Html4.Strict.address | ||
26 | b :: Markup2 | ||
27 | b = wrapMarkup2 Text.Blaze.Html4.Strict.b | ||
28 | bdo :: Markup2 | ||
29 | bdo = wrapMarkup2 Text.Blaze.Html4.Strict.bdo | ||
30 | big :: Markup2 | ||
31 | big = wrapMarkup2 Text.Blaze.Html4.Strict.big | ||
32 | blockquote :: Markup2 | ||
33 | blockquote = wrapMarkup2 Text.Blaze.Html4.Strict.blockquote | ||
34 | body :: Markup2 | ||
35 | body = wrapMarkup2 Text.Blaze.Html4.Strict.body | ||
36 | button :: Markup2 | ||
37 | button = wrapMarkup2 Text.Blaze.Html4.Strict.button | ||
38 | caption :: Markup2 | ||
39 | caption = wrapMarkup2 Text.Blaze.Html4.Strict.caption | ||
40 | cite :: Markup2 | ||
41 | cite = wrapMarkup2 Text.Blaze.Html4.Strict.cite | ||
42 | code :: Markup2 | ||
43 | code = wrapMarkup2 Text.Blaze.Html4.Strict.code | ||
44 | colgroup :: Markup2 | ||
45 | colgroup = wrapMarkup2 Text.Blaze.Html4.Strict.colgroup | ||
46 | dd :: Markup2 | ||
47 | dd = wrapMarkup2 Text.Blaze.Html4.Strict.dd | ||
48 | del :: Markup2 | ||
49 | del = wrapMarkup2 Text.Blaze.Html4.Strict.del | ||
50 | dfn :: Markup2 | ||
51 | dfn = wrapMarkup2 Text.Blaze.Html4.Strict.dfn | ||
52 | div :: Markup2 | ||
53 | div = wrapMarkup2 Text.Blaze.Html4.Strict.div | ||
54 | dl :: Markup2 | ||
55 | dl = wrapMarkup2 Text.Blaze.Html4.Strict.dl | ||
56 | dt :: Markup2 | ||
57 | dt = wrapMarkup2 Text.Blaze.Html4.Strict.dt | ||
58 | em :: Markup2 | ||
59 | em = wrapMarkup2 Text.Blaze.Html4.Strict.em | ||
60 | fieldset :: Markup2 | ||
61 | fieldset = wrapMarkup2 Text.Blaze.Html4.Strict.fieldset | ||
62 | form :: Markup2 | ||
63 | form = wrapMarkup2 Text.Blaze.Html4.Strict.form | ||
64 | h1 :: Markup2 | ||
65 | h1 = wrapMarkup2 Text.Blaze.Html4.Strict.h1 | ||
66 | h2 :: Markup2 | ||
67 | h2 = wrapMarkup2 Text.Blaze.Html4.Strict.h2 | ||
68 | h3 :: Markup2 | ||
69 | h3 = wrapMarkup2 Text.Blaze.Html4.Strict.h3 | ||
70 | h4 :: Markup2 | ||
71 | h4 = wrapMarkup2 Text.Blaze.Html4.Strict.h4 | ||
72 | h5 :: Markup2 | ||
73 | h5 = wrapMarkup2 Text.Blaze.Html4.Strict.h5 | ||
74 | h6 :: Markup2 | ||
75 | h6 = wrapMarkup2 Text.Blaze.Html4.Strict.h6 | ||
76 | head :: Markup2 | ||
77 | head = wrapMarkup2 Text.Blaze.Html4.Strict.head | ||
78 | html :: Markup2 | ||
79 | html = wrapMarkup2 Text.Blaze.Html4.Strict.html | ||
80 | i :: Markup2 | ||
81 | i = wrapMarkup2 Text.Blaze.Html4.Strict.i | ||
82 | ins :: Markup2 | ||
83 | ins = wrapMarkup2 Text.Blaze.Html4.Strict.ins | ||
84 | kbd :: Markup2 | ||
85 | kbd = wrapMarkup2 Text.Blaze.Html4.Strict.kbd | ||
86 | label :: Markup2 | ||
87 | label = wrapMarkup2 Text.Blaze.Html4.Strict.label | ||
88 | legend :: Markup2 | ||
89 | legend = wrapMarkup2 Text.Blaze.Html4.Strict.legend | ||
90 | li :: Markup2 | ||
91 | li = wrapMarkup2 Text.Blaze.Html4.Strict.li | ||
92 | map :: Markup2 | ||
93 | map = wrapMarkup2 Text.Blaze.Html4.Strict.map | ||
94 | noscript :: Markup2 | ||
95 | noscript = wrapMarkup2 Text.Blaze.Html4.Strict.noscript | ||
96 | object :: Markup2 | ||
97 | object = wrapMarkup2 Text.Blaze.Html4.Strict.object | ||
98 | ol :: Markup2 | ||
99 | ol = wrapMarkup2 Text.Blaze.Html4.Strict.ol | ||
100 | optgroup :: Markup2 | ||
101 | optgroup = wrapMarkup2 Text.Blaze.Html4.Strict.optgroup | ||
102 | option :: Markup2 | ||
103 | option = wrapMarkup2 Text.Blaze.Html4.Strict.option | ||
104 | p :: Markup2 | ||
105 | p = wrapMarkup2 Text.Blaze.Html4.Strict.p | ||
106 | pre :: Markup2 | ||
107 | pre = wrapMarkup2 Text.Blaze.Html4.Strict.pre | ||
108 | q :: Markup2 | ||
109 | q = wrapMarkup2 Text.Blaze.Html4.Strict.q | ||
110 | samp :: Markup2 | ||
111 | samp = wrapMarkup2 Text.Blaze.Html4.Strict.samp | ||
112 | script :: Markup2 | ||
113 | script = wrapMarkup2 Text.Blaze.Html4.Strict.script | ||
114 | select :: Markup2 | ||
115 | select = wrapMarkup2 Text.Blaze.Html4.Strict.select | ||
116 | small :: Markup2 | ||
117 | small = wrapMarkup2 Text.Blaze.Html4.Strict.small | ||
118 | span :: Markup2 | ||
119 | span = wrapMarkup2 Text.Blaze.Html4.Strict.span | ||
120 | strong :: Markup2 | ||
121 | strong = wrapMarkup2 Text.Blaze.Html4.Strict.strong | ||
122 | style :: Markup2 | ||
123 | style = wrapMarkup2 Text.Blaze.Html4.Strict.style | ||
124 | sub :: Markup2 | ||
125 | sub = wrapMarkup2 Text.Blaze.Html4.Strict.sub | ||
126 | sup :: Markup2 | ||
127 | sup = wrapMarkup2 Text.Blaze.Html4.Strict.sup | ||
128 | table :: Markup2 | ||
129 | table = wrapMarkup2 Text.Blaze.Html4.Strict.table | ||
130 | tbody :: Markup2 | ||
131 | tbody = wrapMarkup2 Text.Blaze.Html4.Strict.tbody | ||
132 | td :: Markup2 | ||
133 | td = wrapMarkup2 Text.Blaze.Html4.Strict.td | ||
134 | textarea :: Markup2 | ||
135 | textarea = wrapMarkup2 Text.Blaze.Html4.Strict.textarea | ||
136 | tfoot :: Markup2 | ||
137 | tfoot = wrapMarkup2 Text.Blaze.Html4.Strict.tfoot | ||
138 | th :: Markup2 | ||
139 | th = wrapMarkup2 Text.Blaze.Html4.Strict.th | ||
140 | thead :: Markup2 | ||
141 | thead = wrapMarkup2 Text.Blaze.Html4.Strict.thead | ||
142 | title :: Markup2 | ||
143 | title = wrapMarkup2 Text.Blaze.Html4.Strict.title | ||
144 | tr :: Markup2 | ||
145 | tr = wrapMarkup2 Text.Blaze.Html4.Strict.tr | ||
146 | tt :: Markup2 | ||
147 | tt = wrapMarkup2 Text.Blaze.Html4.Strict.tt | ||
148 | ul :: Markup2 | ||
149 | ul = wrapMarkup2 Text.Blaze.Html4.Strict.ul | ||
150 | var :: Markup2 | ||
151 | var = wrapMarkup2 Text.Blaze.Html4.Strict.var | ||
152 | docType :: Markup | ||
153 | docType = wrapMarkup Text.Blaze.Html4.Strict.docType | ||
154 | area :: Markup | ||
155 | area = wrapMarkup Text.Blaze.Html4.Strict.area | ||
156 | br :: Markup | ||
157 | br = wrapMarkup Text.Blaze.Html4.Strict.br | ||
158 | col :: Markup | ||
159 | col = wrapMarkup Text.Blaze.Html4.Strict.col | ||
160 | hr :: Markup | ||
161 | hr = wrapMarkup Text.Blaze.Html4.Strict.hr | ||
162 | link :: Markup | ||
163 | link = wrapMarkup Text.Blaze.Html4.Strict.link | ||
164 | img :: Markup | ||
165 | img = wrapMarkup Text.Blaze.Html4.Strict.img | ||
166 | input :: Markup | ||
167 | input = wrapMarkup Text.Blaze.Html4.Strict.input | ||
168 | meta :: Markup | ||
169 | meta = wrapMarkup Text.Blaze.Html4.Strict.meta | ||
170 | param :: Markup | ||
171 | param = wrapMarkup Text.Blaze.Html4.Strict.param | ||
172 | |||
diff --git a/src/Text/BlazeT/Html4/Strict/Attributes.hs b/src/Text/BlazeT/Html4/Strict/Attributes.hs new file mode 100644 index 0000000..18d1fe2 --- /dev/null +++ b/src/Text/BlazeT/Html4/Strict/Attributes.hs | |||
@@ -0,0 +1,11 @@ | |||
1 | -- !! DO NOT EDIT | ||
2 | {-| | ||
3 | (Automatically generated by @src\/Util\/GenerateHtmlTCombinators.hs:49@) | ||
4 | |||
5 | This module simply reexports the corresponding @blaze-html@ module. | ||
6 | -} | ||
7 | module Text.BlazeT.Html4.Strict.Attributes | ||
8 | (module Text.Blaze.Html4.Strict.Attributes | ||
9 | ) where | ||
10 | import Text.Blaze.Html4.Strict.Attributes | ||
11 | |||
diff --git a/src/Text/BlazeT/Html4/Transitional.hs b/src/Text/BlazeT/Html4/Transitional.hs new file mode 100644 index 0000000..a6dead6 --- /dev/null +++ b/src/Text/BlazeT/Html4/Transitional.hs | |||
@@ -0,0 +1,194 @@ | |||
1 | -- !! DO NOT EDIT | ||
2 | {-| | ||
3 | (Automatically generated by @src\/Util\/GenerateHtmlTCombinators.hs:49@) | ||
4 | |||
5 | This module wraps all exports of "Text.Blaze.Html4.Transitional" using 'wrapMarkup' and 'wrapMarkup'. | ||
6 | -} | ||
7 | module Text.BlazeT.Html4.Transitional | ||
8 | (module Text.BlazeT.Html4.Transitional | ||
9 | ,module Text.BlazeT.Html | ||
10 | ) where | ||
11 | import qualified Text.Blaze.Html4.Transitional | ||
12 | import Text.BlazeT | ||
13 | import Text.BlazeT.Html | ||
14 | import Text.BlazeT.Internal | ||
15 | |||
16 | docTypeHtml :: Markup2 | ||
17 | docTypeHtml = wrapMarkup2 Text.Blaze.Html4.Transitional.docTypeHtml | ||
18 | a :: Markup2 | ||
19 | a = wrapMarkup2 Text.Blaze.Html4.Transitional.a | ||
20 | abbr :: Markup2 | ||
21 | abbr = wrapMarkup2 Text.Blaze.Html4.Transitional.abbr | ||
22 | acronym :: Markup2 | ||
23 | acronym = wrapMarkup2 Text.Blaze.Html4.Transitional.acronym | ||
24 | address :: Markup2 | ||
25 | address = wrapMarkup2 Text.Blaze.Html4.Transitional.address | ||
26 | b :: Markup2 | ||
27 | b = wrapMarkup2 Text.Blaze.Html4.Transitional.b | ||
28 | bdo :: Markup2 | ||
29 | bdo = wrapMarkup2 Text.Blaze.Html4.Transitional.bdo | ||
30 | big :: Markup2 | ||
31 | big = wrapMarkup2 Text.Blaze.Html4.Transitional.big | ||
32 | blockquote :: Markup2 | ||
33 | blockquote = wrapMarkup2 Text.Blaze.Html4.Transitional.blockquote | ||
34 | body :: Markup2 | ||
35 | body = wrapMarkup2 Text.Blaze.Html4.Transitional.body | ||
36 | button :: Markup2 | ||
37 | button = wrapMarkup2 Text.Blaze.Html4.Transitional.button | ||
38 | caption :: Markup2 | ||
39 | caption = wrapMarkup2 Text.Blaze.Html4.Transitional.caption | ||
40 | cite :: Markup2 | ||
41 | cite = wrapMarkup2 Text.Blaze.Html4.Transitional.cite | ||
42 | code :: Markup2 | ||
43 | code = wrapMarkup2 Text.Blaze.Html4.Transitional.code | ||
44 | colgroup :: Markup2 | ||
45 | colgroup = wrapMarkup2 Text.Blaze.Html4.Transitional.colgroup | ||
46 | dd :: Markup2 | ||
47 | dd = wrapMarkup2 Text.Blaze.Html4.Transitional.dd | ||
48 | del :: Markup2 | ||
49 | del = wrapMarkup2 Text.Blaze.Html4.Transitional.del | ||
50 | dfn :: Markup2 | ||
51 | dfn = wrapMarkup2 Text.Blaze.Html4.Transitional.dfn | ||
52 | div :: Markup2 | ||
53 | div = wrapMarkup2 Text.Blaze.Html4.Transitional.div | ||
54 | dl :: Markup2 | ||
55 | dl = wrapMarkup2 Text.Blaze.Html4.Transitional.dl | ||
56 | dt :: Markup2 | ||
57 | dt = wrapMarkup2 Text.Blaze.Html4.Transitional.dt | ||
58 | em :: Markup2 | ||
59 | em = wrapMarkup2 Text.Blaze.Html4.Transitional.em | ||
60 | fieldset :: Markup2 | ||
61 | fieldset = wrapMarkup2 Text.Blaze.Html4.Transitional.fieldset | ||
62 | form :: Markup2 | ||
63 | form = wrapMarkup2 Text.Blaze.Html4.Transitional.form | ||
64 | h1 :: Markup2 | ||
65 | h1 = wrapMarkup2 Text.Blaze.Html4.Transitional.h1 | ||
66 | h2 :: Markup2 | ||
67 | h2 = wrapMarkup2 Text.Blaze.Html4.Transitional.h2 | ||
68 | h3 :: Markup2 | ||
69 | h3 = wrapMarkup2 Text.Blaze.Html4.Transitional.h3 | ||
70 | h4 :: Markup2 | ||
71 | h4 = wrapMarkup2 Text.Blaze.Html4.Transitional.h4 | ||
72 | h5 :: Markup2 | ||
73 | h5 = wrapMarkup2 Text.Blaze.Html4.Transitional.h5 | ||
74 | h6 :: Markup2 | ||
75 | h6 = wrapMarkup2 Text.Blaze.Html4.Transitional.h6 | ||
76 | head :: Markup2 | ||
77 | head = wrapMarkup2 Text.Blaze.Html4.Transitional.head | ||
78 | html :: Markup2 | ||
79 | html = wrapMarkup2 Text.Blaze.Html4.Transitional.html | ||
80 | i :: Markup2 | ||
81 | i = wrapMarkup2 Text.Blaze.Html4.Transitional.i | ||
82 | ins :: Markup2 | ||
83 | ins = wrapMarkup2 Text.Blaze.Html4.Transitional.ins | ||
84 | kbd :: Markup2 | ||
85 | kbd = wrapMarkup2 Text.Blaze.Html4.Transitional.kbd | ||
86 | label :: Markup2 | ||
87 | label = wrapMarkup2 Text.Blaze.Html4.Transitional.label | ||
88 | legend :: Markup2 | ||
89 | legend = wrapMarkup2 Text.Blaze.Html4.Transitional.legend | ||
90 | li :: Markup2 | ||
91 | li = wrapMarkup2 Text.Blaze.Html4.Transitional.li | ||
92 | map :: Markup2 | ||
93 | map = wrapMarkup2 Text.Blaze.Html4.Transitional.map | ||
94 | noscript :: Markup2 | ||
95 | noscript = wrapMarkup2 Text.Blaze.Html4.Transitional.noscript | ||
96 | object :: Markup2 | ||
97 | object = wrapMarkup2 Text.Blaze.Html4.Transitional.object | ||
98 | ol :: Markup2 | ||
99 | ol = wrapMarkup2 Text.Blaze.Html4.Transitional.ol | ||
100 | optgroup :: Markup2 | ||
101 | optgroup = wrapMarkup2 Text.Blaze.Html4.Transitional.optgroup | ||
102 | option :: Markup2 | ||
103 | option = wrapMarkup2 Text.Blaze.Html4.Transitional.option | ||
104 | p :: Markup2 | ||
105 | p = wrapMarkup2 Text.Blaze.Html4.Transitional.p | ||
106 | pre :: Markup2 | ||
107 | pre = wrapMarkup2 Text.Blaze.Html4.Transitional.pre | ||
108 | q :: Markup2 | ||
109 | q = wrapMarkup2 Text.Blaze.Html4.Transitional.q | ||
110 | samp :: Markup2 | ||
111 | samp = wrapMarkup2 Text.Blaze.Html4.Transitional.samp | ||
112 | script :: Markup2 | ||
113 | script = wrapMarkup2 Text.Blaze.Html4.Transitional.script | ||
114 | select :: Markup2 | ||
115 | select = wrapMarkup2 Text.Blaze.Html4.Transitional.select | ||
116 | small :: Markup2 | ||
117 | small = wrapMarkup2 Text.Blaze.Html4.Transitional.small | ||
118 | span :: Markup2 | ||
119 | span = wrapMarkup2 Text.Blaze.Html4.Transitional.span | ||
120 | strong :: Markup2 | ||
121 | strong = wrapMarkup2 Text.Blaze.Html4.Transitional.strong | ||
122 | style :: Markup2 | ||
123 | style = wrapMarkup2 Text.Blaze.Html4.Transitional.style | ||
124 | sub :: Markup2 | ||
125 | sub = wrapMarkup2 Text.Blaze.Html4.Transitional.sub | ||
126 | sup :: Markup2 | ||
127 | sup = wrapMarkup2 Text.Blaze.Html4.Transitional.sup | ||
128 | table :: Markup2 | ||
129 | table = wrapMarkup2 Text.Blaze.Html4.Transitional.table | ||
130 | tbody :: Markup2 | ||
131 | tbody = wrapMarkup2 Text.Blaze.Html4.Transitional.tbody | ||
132 | td :: Markup2 | ||
133 | td = wrapMarkup2 Text.Blaze.Html4.Transitional.td | ||
134 | textarea :: Markup2 | ||
135 | textarea = wrapMarkup2 Text.Blaze.Html4.Transitional.textarea | ||
136 | tfoot :: Markup2 | ||
137 | tfoot = wrapMarkup2 Text.Blaze.Html4.Transitional.tfoot | ||
138 | th :: Markup2 | ||
139 | th = wrapMarkup2 Text.Blaze.Html4.Transitional.th | ||
140 | thead :: Markup2 | ||
141 | thead = wrapMarkup2 Text.Blaze.Html4.Transitional.thead | ||
142 | title :: Markup2 | ||
143 | title = wrapMarkup2 Text.Blaze.Html4.Transitional.title | ||
144 | tr :: Markup2 | ||
145 | tr = wrapMarkup2 Text.Blaze.Html4.Transitional.tr | ||
146 | tt :: Markup2 | ||
147 | tt = wrapMarkup2 Text.Blaze.Html4.Transitional.tt | ||
148 | ul :: Markup2 | ||
149 | ul = wrapMarkup2 Text.Blaze.Html4.Transitional.ul | ||
150 | var :: Markup2 | ||
151 | var = wrapMarkup2 Text.Blaze.Html4.Transitional.var | ||
152 | applet :: Markup2 | ||
153 | applet = wrapMarkup2 Text.Blaze.Html4.Transitional.applet | ||
154 | center :: Markup2 | ||
155 | center = wrapMarkup2 Text.Blaze.Html4.Transitional.center | ||
156 | dir :: Markup2 | ||
157 | dir = wrapMarkup2 Text.Blaze.Html4.Transitional.dir | ||
158 | font :: Markup2 | ||
159 | font = wrapMarkup2 Text.Blaze.Html4.Transitional.font | ||
160 | iframe :: Markup2 | ||
161 | iframe = wrapMarkup2 Text.Blaze.Html4.Transitional.iframe | ||
162 | isindex :: Markup2 | ||
163 | isindex = wrapMarkup2 Text.Blaze.Html4.Transitional.isindex | ||
164 | menu :: Markup2 | ||
165 | menu = wrapMarkup2 Text.Blaze.Html4.Transitional.menu | ||
166 | noframes :: Markup2 | ||
167 | noframes = wrapMarkup2 Text.Blaze.Html4.Transitional.noframes | ||
168 | s :: Markup2 | ||
169 | s = wrapMarkup2 Text.Blaze.Html4.Transitional.s | ||
170 | u :: Markup2 | ||
171 | u = wrapMarkup2 Text.Blaze.Html4.Transitional.u | ||
172 | docType :: Markup | ||
173 | docType = wrapMarkup Text.Blaze.Html4.Transitional.docType | ||
174 | area :: Markup | ||
175 | area = wrapMarkup Text.Blaze.Html4.Transitional.area | ||
176 | br :: Markup | ||
177 | br = wrapMarkup Text.Blaze.Html4.Transitional.br | ||
178 | col :: Markup | ||
179 | col = wrapMarkup Text.Blaze.Html4.Transitional.col | ||
180 | hr :: Markup | ||
181 | hr = wrapMarkup Text.Blaze.Html4.Transitional.hr | ||
182 | link :: Markup | ||
183 | link = wrapMarkup Text.Blaze.Html4.Transitional.link | ||
184 | img :: Markup | ||
185 | img = wrapMarkup Text.Blaze.Html4.Transitional.img | ||
186 | input :: Markup | ||
187 | input = wrapMarkup Text.Blaze.Html4.Transitional.input | ||
188 | meta :: Markup | ||
189 | meta = wrapMarkup Text.Blaze.Html4.Transitional.meta | ||
190 | param :: Markup | ||
191 | param = wrapMarkup Text.Blaze.Html4.Transitional.param | ||
192 | basefont :: Markup | ||
193 | basefont = wrapMarkup Text.Blaze.Html4.Transitional.basefont | ||
194 | |||
diff --git a/src/Text/BlazeT/Html4/Transitional/Attributes.hs b/src/Text/BlazeT/Html4/Transitional/Attributes.hs new file mode 100644 index 0000000..2fc0d97 --- /dev/null +++ b/src/Text/BlazeT/Html4/Transitional/Attributes.hs | |||
@@ -0,0 +1,11 @@ | |||
1 | -- !! DO NOT EDIT | ||
2 | {-| | ||
3 | (Automatically generated by @src\/Util\/GenerateHtmlTCombinators.hs:49@) | ||
4 | |||
5 | This module simply reexports the corresponding @blaze-html@ module. | ||
6 | -} | ||
7 | module Text.BlazeT.Html4.Transitional.Attributes | ||
8 | (module Text.Blaze.Html4.Transitional.Attributes | ||
9 | ) where | ||
10 | import Text.Blaze.Html4.Transitional.Attributes | ||
11 | |||
diff --git a/src/Text/BlazeT/Html5.hs b/src/Text/BlazeT/Html5.hs new file mode 100644 index 0000000..8e93bf9 --- /dev/null +++ b/src/Text/BlazeT/Html5.hs | |||
@@ -0,0 +1,234 @@ | |||
1 | -- !! DO NOT EDIT | ||
2 | {-| | ||
3 | (Automatically generated by @src\/Util\/GenerateHtmlTCombinators.hs:49@) | ||
4 | |||
5 | This module wraps all exports of "Text.Blaze.Html5" using 'wrapMarkup' and 'wrapMarkup'. | ||
6 | -} | ||
7 | module Text.BlazeT.Html5 | ||
8 | (module Text.BlazeT.Html5 | ||
9 | ,module Text.BlazeT.Html | ||
10 | ) where | ||
11 | import qualified Text.Blaze.Html5 | ||
12 | import Text.BlazeT | ||
13 | import Text.BlazeT.Html | ||
14 | import Text.BlazeT.Internal | ||
15 | |||
16 | docTypeHtml :: Markup2 | ||
17 | docTypeHtml = wrapMarkup2 Text.Blaze.Html5.docTypeHtml | ||
18 | a :: Markup2 | ||
19 | a = wrapMarkup2 Text.Blaze.Html5.a | ||
20 | abbr :: Markup2 | ||
21 | abbr = wrapMarkup2 Text.Blaze.Html5.abbr | ||
22 | address :: Markup2 | ||
23 | address = wrapMarkup2 Text.Blaze.Html5.address | ||
24 | article :: Markup2 | ||
25 | article = wrapMarkup2 Text.Blaze.Html5.article | ||
26 | aside :: Markup2 | ||
27 | aside = wrapMarkup2 Text.Blaze.Html5.aside | ||
28 | audio :: Markup2 | ||
29 | audio = wrapMarkup2 Text.Blaze.Html5.audio | ||
30 | b :: Markup2 | ||
31 | b = wrapMarkup2 Text.Blaze.Html5.b | ||
32 | bdo :: Markup2 | ||
33 | bdo = wrapMarkup2 Text.Blaze.Html5.bdo | ||
34 | blockquote :: Markup2 | ||
35 | blockquote = wrapMarkup2 Text.Blaze.Html5.blockquote | ||
36 | body :: Markup2 | ||
37 | body = wrapMarkup2 Text.Blaze.Html5.body | ||
38 | button :: Markup2 | ||
39 | button = wrapMarkup2 Text.Blaze.Html5.button | ||
40 | canvas :: Markup2 | ||
41 | canvas = wrapMarkup2 Text.Blaze.Html5.canvas | ||
42 | caption :: Markup2 | ||
43 | caption = wrapMarkup2 Text.Blaze.Html5.caption | ||
44 | cite :: Markup2 | ||
45 | cite = wrapMarkup2 Text.Blaze.Html5.cite | ||
46 | code :: Markup2 | ||
47 | code = wrapMarkup2 Text.Blaze.Html5.code | ||
48 | colgroup :: Markup2 | ||
49 | colgroup = wrapMarkup2 Text.Blaze.Html5.colgroup | ||
50 | command :: Markup2 | ||
51 | command = wrapMarkup2 Text.Blaze.Html5.command | ||
52 | datalist :: Markup2 | ||
53 | datalist = wrapMarkup2 Text.Blaze.Html5.datalist | ||
54 | dd :: Markup2 | ||
55 | dd = wrapMarkup2 Text.Blaze.Html5.dd | ||
56 | del :: Markup2 | ||
57 | del = wrapMarkup2 Text.Blaze.Html5.del | ||
58 | details :: Markup2 | ||
59 | details = wrapMarkup2 Text.Blaze.Html5.details | ||
60 | dfn :: Markup2 | ||
61 | dfn = wrapMarkup2 Text.Blaze.Html5.dfn | ||
62 | div :: Markup2 | ||
63 | div = wrapMarkup2 Text.Blaze.Html5.div | ||
64 | dl :: Markup2 | ||
65 | dl = wrapMarkup2 Text.Blaze.Html5.dl | ||
66 | dt :: Markup2 | ||
67 | dt = wrapMarkup2 Text.Blaze.Html5.dt | ||
68 | em :: Markup2 | ||
69 | em = wrapMarkup2 Text.Blaze.Html5.em | ||
70 | fieldset :: Markup2 | ||
71 | fieldset = wrapMarkup2 Text.Blaze.Html5.fieldset | ||
72 | figcaption :: Markup2 | ||
73 | figcaption = wrapMarkup2 Text.Blaze.Html5.figcaption | ||
74 | figure :: Markup2 | ||
75 | figure = wrapMarkup2 Text.Blaze.Html5.figure | ||
76 | footer :: Markup2 | ||
77 | footer = wrapMarkup2 Text.Blaze.Html5.footer | ||
78 | form :: Markup2 | ||
79 | form = wrapMarkup2 Text.Blaze.Html5.form | ||
80 | h1 :: Markup2 | ||
81 | h1 = wrapMarkup2 Text.Blaze.Html5.h1 | ||
82 | h2 :: Markup2 | ||
83 | h2 = wrapMarkup2 Text.Blaze.Html5.h2 | ||
84 | h3 :: Markup2 | ||
85 | h3 = wrapMarkup2 Text.Blaze.Html5.h3 | ||
86 | h4 :: Markup2 | ||
87 | h4 = wrapMarkup2 Text.Blaze.Html5.h4 | ||
88 | h5 :: Markup2 | ||
89 | h5 = wrapMarkup2 Text.Blaze.Html5.h5 | ||
90 | h6 :: Markup2 | ||
91 | h6 = wrapMarkup2 Text.Blaze.Html5.h6 | ||
92 | head :: Markup2 | ||
93 | head = wrapMarkup2 Text.Blaze.Html5.head | ||
94 | header :: Markup2 | ||
95 | header = wrapMarkup2 Text.Blaze.Html5.header | ||
96 | hgroup :: Markup2 | ||
97 | hgroup = wrapMarkup2 Text.Blaze.Html5.hgroup | ||
98 | html :: Markup2 | ||
99 | html = wrapMarkup2 Text.Blaze.Html5.html | ||
100 | i :: Markup2 | ||
101 | i = wrapMarkup2 Text.Blaze.Html5.i | ||
102 | iframe :: Markup2 | ||
103 | iframe = wrapMarkup2 Text.Blaze.Html5.iframe | ||
104 | ins :: Markup2 | ||
105 | ins = wrapMarkup2 Text.Blaze.Html5.ins | ||
106 | kbd :: Markup2 | ||
107 | kbd = wrapMarkup2 Text.Blaze.Html5.kbd | ||
108 | label :: Markup2 | ||
109 | label = wrapMarkup2 Text.Blaze.Html5.label | ||
110 | legend :: Markup2 | ||
111 | legend = wrapMarkup2 Text.Blaze.Html5.legend | ||
112 | li :: Markup2 | ||
113 | li = wrapMarkup2 Text.Blaze.Html5.li | ||
114 | main :: Markup2 | ||
115 | main = wrapMarkup2 Text.Blaze.Html5.main | ||
116 | map :: Markup2 | ||
117 | map = wrapMarkup2 Text.Blaze.Html5.map | ||
118 | mark :: Markup2 | ||
119 | mark = wrapMarkup2 Text.Blaze.Html5.mark | ||
120 | menu :: Markup2 | ||
121 | menu = wrapMarkup2 Text.Blaze.Html5.menu | ||
122 | meter :: Markup2 | ||
123 | meter = wrapMarkup2 Text.Blaze.Html5.meter | ||
124 | nav :: Markup2 | ||
125 | nav = wrapMarkup2 Text.Blaze.Html5.nav | ||
126 | noscript :: Markup2 | ||
127 | noscript = wrapMarkup2 Text.Blaze.Html5.noscript | ||
128 | object :: Markup2 | ||
129 | object = wrapMarkup2 Text.Blaze.Html5.object | ||
130 | ol :: Markup2 | ||
131 | ol = wrapMarkup2 Text.Blaze.Html5.ol | ||
132 | optgroup :: Markup2 | ||
133 | optgroup = wrapMarkup2 Text.Blaze.Html5.optgroup | ||
134 | option :: Markup2 | ||
135 | option = wrapMarkup2 Text.Blaze.Html5.option | ||
136 | output :: Markup2 | ||
137 | output = wrapMarkup2 Text.Blaze.Html5.output | ||
138 | p :: Markup2 | ||
139 | p = wrapMarkup2 Text.Blaze.Html5.p | ||
140 | pre :: Markup2 | ||
141 | pre = wrapMarkup2 Text.Blaze.Html5.pre | ||
142 | progress :: Markup2 | ||
143 | progress = wrapMarkup2 Text.Blaze.Html5.progress | ||
144 | q :: Markup2 | ||
145 | q = wrapMarkup2 Text.Blaze.Html5.q | ||
146 | rp :: Markup2 | ||
147 | rp = wrapMarkup2 Text.Blaze.Html5.rp | ||
148 | rt :: Markup2 | ||
149 | rt = wrapMarkup2 Text.Blaze.Html5.rt | ||
150 | ruby :: Markup2 | ||
151 | ruby = wrapMarkup2 Text.Blaze.Html5.ruby | ||
152 | samp :: Markup2 | ||
153 | samp = wrapMarkup2 Text.Blaze.Html5.samp | ||
154 | script :: Markup2 | ||
155 | script = wrapMarkup2 Text.Blaze.Html5.script | ||
156 | section :: Markup2 | ||
157 | section = wrapMarkup2 Text.Blaze.Html5.section | ||
158 | select :: Markup2 | ||
159 | select = wrapMarkup2 Text.Blaze.Html5.select | ||
160 | small :: Markup2 | ||
161 | small = wrapMarkup2 Text.Blaze.Html5.small | ||
162 | span :: Markup2 | ||
163 | span = wrapMarkup2 Text.Blaze.Html5.span | ||
164 | strong :: Markup2 | ||
165 | strong = wrapMarkup2 Text.Blaze.Html5.strong | ||
166 | style :: Markup2 | ||
167 | style = wrapMarkup2 Text.Blaze.Html5.style | ||
168 | sub :: Markup2 | ||
169 | sub = wrapMarkup2 Text.Blaze.Html5.sub | ||
170 | summary :: Markup2 | ||
171 | summary = wrapMarkup2 Text.Blaze.Html5.summary | ||
172 | sup :: Markup2 | ||
173 | sup = wrapMarkup2 Text.Blaze.Html5.sup | ||
174 | table :: Markup2 | ||
175 | table = wrapMarkup2 Text.Blaze.Html5.table | ||
176 | tbody :: Markup2 | ||
177 | tbody = wrapMarkup2 Text.Blaze.Html5.tbody | ||
178 | td :: Markup2 | ||
179 | td = wrapMarkup2 Text.Blaze.Html5.td | ||
180 | textarea :: Markup2 | ||
181 | textarea = wrapMarkup2 Text.Blaze.Html5.textarea | ||
182 | tfoot :: Markup2 | ||
183 | tfoot = wrapMarkup2 Text.Blaze.Html5.tfoot | ||
184 | th :: Markup2 | ||
185 | th = wrapMarkup2 Text.Blaze.Html5.th | ||
186 | thead :: Markup2 | ||
187 | thead = wrapMarkup2 Text.Blaze.Html5.thead | ||
188 | time :: Markup2 | ||
189 | time = wrapMarkup2 Text.Blaze.Html5.time | ||
190 | title :: Markup2 | ||
191 | title = wrapMarkup2 Text.Blaze.Html5.title | ||
192 | tr :: Markup2 | ||
193 | tr = wrapMarkup2 Text.Blaze.Html5.tr | ||
194 | ul :: Markup2 | ||
195 | ul = wrapMarkup2 Text.Blaze.Html5.ul | ||
196 | var :: Markup2 | ||
197 | var = wrapMarkup2 Text.Blaze.Html5.var | ||
198 | video :: Markup2 | ||
199 | video = wrapMarkup2 Text.Blaze.Html5.video | ||
200 | docType :: Markup | ||
201 | docType = wrapMarkup Text.Blaze.Html5.docType | ||
202 | area :: Markup | ||
203 | area = wrapMarkup Text.Blaze.Html5.area | ||
204 | base :: Markup | ||
205 | base = wrapMarkup Text.Blaze.Html5.base | ||
206 | br :: Markup | ||
207 | br = wrapMarkup Text.Blaze.Html5.br | ||
208 | col :: Markup | ||
209 | col = wrapMarkup Text.Blaze.Html5.col | ||
210 | embed :: Markup | ||
211 | embed = wrapMarkup Text.Blaze.Html5.embed | ||
212 | hr :: Markup | ||
213 | hr = wrapMarkup Text.Blaze.Html5.hr | ||
214 | img :: Markup | ||
215 | img = wrapMarkup Text.Blaze.Html5.img | ||
216 | input :: Markup | ||
217 | input = wrapMarkup Text.Blaze.Html5.input | ||
218 | keygen :: Markup | ||
219 | keygen = wrapMarkup Text.Blaze.Html5.keygen | ||
220 | link :: Markup | ||
221 | link = wrapMarkup Text.Blaze.Html5.link | ||
222 | menuitem :: Markup | ||
223 | menuitem = wrapMarkup Text.Blaze.Html5.menuitem | ||
224 | meta :: Markup | ||
225 | meta = wrapMarkup Text.Blaze.Html5.meta | ||
226 | param :: Markup | ||
227 | param = wrapMarkup Text.Blaze.Html5.param | ||
228 | source :: Markup | ||
229 | source = wrapMarkup Text.Blaze.Html5.source | ||
230 | track :: Markup | ||
231 | track = wrapMarkup Text.Blaze.Html5.track | ||
232 | wbr :: Markup | ||
233 | wbr = wrapMarkup Text.Blaze.Html5.wbr | ||
234 | |||
diff --git a/src/Text/BlazeT/Html5/Attributes.hs b/src/Text/BlazeT/Html5/Attributes.hs new file mode 100644 index 0000000..1bcd773 --- /dev/null +++ b/src/Text/BlazeT/Html5/Attributes.hs | |||
@@ -0,0 +1,11 @@ | |||
1 | -- !! DO NOT EDIT | ||
2 | {-| | ||
3 | (Automatically generated by @src\/Util\/GenerateHtmlTCombinators.hs:49@) | ||
4 | |||
5 | This module simply reexports the corresponding @blaze-html@ module. | ||
6 | -} | ||
7 | module Text.BlazeT.Html5.Attributes | ||
8 | (module Text.Blaze.Html5.Attributes | ||
9 | ) where | ||
10 | import Text.Blaze.Html5.Attributes | ||
11 | |||
diff --git a/src/Text/BlazeT/Internal.hs b/src/Text/BlazeT/Internal.hs new file mode 100644 index 0000000..24ef1fe --- /dev/null +++ b/src/Text/BlazeT/Internal.hs | |||
@@ -0,0 +1,238 @@ | |||
1 | {-# LANGUAGE DeriveFunctor #-} | ||
2 | {-# LANGUAGE GeneralizedNewtypeDeriving #-} | ||
3 | {-# LANGUAGE FlexibleInstances #-} | ||
4 | {-# LANGUAGE RankNTypes #-} | ||
5 | {-# LANGUAGE CPP #-} | ||
6 | #if MIN_VERSION_blaze_markup(0,7,1) | ||
7 | #define PRE_BUILDER | ||
8 | #endif | ||
9 | module Text.BlazeT.Internal | ||
10 | ( | ||
11 | -- * Important types. | ||
12 | B.ChoiceString (..) | ||
13 | , B.StaticString (..) | ||
14 | , MarkupM | ||
15 | , Markup | ||
16 | , B.Tag | ||
17 | , B.Attribute | ||
18 | , B.AttributeValue | ||
19 | |||
20 | -- * Creating custom tags and attributes. | ||
21 | , customParent | ||
22 | , customLeaf | ||
23 | , B.attribute | ||
24 | , B.dataAttribute | ||
25 | , B.customAttribute | ||
26 | |||
27 | -- * Converting values to Markup. | ||
28 | , text | ||
29 | , preEscapedText | ||
30 | , lazyText | ||
31 | , preEscapedLazyText | ||
32 | , textBuilder | ||
33 | , preEscapedTextBuilder | ||
34 | , string | ||
35 | , preEscapedString | ||
36 | , unsafeByteString | ||
37 | , unsafeLazyByteString | ||
38 | |||
39 | -- * Comments | ||
40 | , B.textComment | ||
41 | , B.lazyTextComment | ||
42 | , B.stringComment | ||
43 | , B.unsafeByteStringComment | ||
44 | , B.unsafeLazyByteStringComment | ||
45 | |||
46 | -- * Converting values to tags. | ||
47 | , B.textTag | ||
48 | , B.stringTag | ||
49 | |||
50 | -- * Converting values to attribute values. | ||
51 | , B.textValue | ||
52 | , B.preEscapedTextValue | ||
53 | , B.lazyTextValue | ||
54 | , B.preEscapedLazyTextValue | ||
55 | , B.textBuilderValue | ||
56 | , B.preEscapedTextBuilderValue | ||
57 | , B.stringValue | ||
58 | , B.preEscapedStringValue | ||
59 | , B.unsafeByteStringValue | ||
60 | , B.unsafeLazyByteStringValue | ||
61 | |||
62 | -- * Setting attributes | ||
63 | , B.Attributable | ||
64 | , (B.!) | ||
65 | , (B.!?) | ||
66 | |||
67 | -- * Modifying Markup elements | ||
68 | , contents | ||
69 | , external | ||
70 | |||
71 | -- * Querying Markup elements | ||
72 | , null | ||
73 | |||
74 | -- * BlazeT new stuff | ||
75 | ,Markup2 | ||
76 | ,mapMarkupT | ||
77 | ,MarkupT | ||
78 | ,runMarkup | ||
79 | ,runMarkupT | ||
80 | ,execMarkup | ||
81 | ,execMarkupT | ||
82 | ,wrapMarkup | ||
83 | ,wrapMarkupT | ||
84 | ,wrapMarkup2 | ||
85 | ,wrapMarkupT2 | ||
86 | ) where | ||
87 | |||
88 | import Control.Monad.Identity | ||
89 | import Control.Monad.Trans.Class | ||
90 | import Control.Monad.Writer.Strict | ||
91 | import qualified Data.ByteString as BS | ||
92 | import qualified Data.ByteString.Lazy as BL | ||
93 | import Data.String | ||
94 | import qualified Data.Text as T | ||
95 | import qualified Data.Text.Lazy as LT | ||
96 | import qualified Data.Text.Lazy.Builder as LTB | ||
97 | import qualified Text.Blaze as B | ||
98 | import qualified Text.Blaze.Internal as B | ||
99 | |||
100 | newtype MarkupT m a= MarkupT { fromMarkupT :: WriterT B.Markup m a } | ||
101 | deriving (Functor | ||
102 | #if MIN_VERSION_base(4,8,0) | ||
103 | ,Applicative | ||
104 | #endif | ||
105 | ,Monad | ||
106 | ,MonadWriter B.Markup | ||
107 | ,MonadTrans | ||
108 | ) | ||
109 | |||
110 | -- | Map both the return value and markup of a computation using the | ||
111 | -- given function | ||
112 | mapMarkupT :: (m (a,B.Markup) -> n (b,B.Markup)) -> MarkupT m a -> MarkupT n b | ||
113 | mapMarkupT f = MarkupT . mapWriterT f . fromMarkupT | ||
114 | {-# INLINE mapMarkupT #-} | ||
115 | |||
116 | type MarkupM = MarkupT Identity | ||
117 | type Markup = forall m . Monad m => MarkupT m () | ||
118 | type Markup2 = forall m . Monad m => MarkupT m () -> MarkupT m () | ||
119 | |||
120 | runMarkupT :: MarkupT m a -> m (a,B.Markup) | ||
121 | runMarkupT = runWriterT . fromMarkupT | ||
122 | {-# INLINE runMarkupT #-} | ||
123 | |||
124 | execMarkupT :: Monad m => MarkupT m a -> m B.Markup | ||
125 | execMarkupT = liftM snd . runMarkupT | ||
126 | {-# INLINE execMarkupT #-} | ||
127 | |||
128 | runMarkup :: MarkupM a -> (a,B.Markup) | ||
129 | runMarkup = runIdentity . runMarkupT | ||
130 | {-# INLINE runMarkup #-} | ||
131 | |||
132 | execMarkup :: MarkupM a -> B.Markup | ||
133 | execMarkup = snd . runMarkup | ||
134 | {-# INLINE execMarkup #-} | ||
135 | |||
136 | -- instance MonadTrans MarkupT where | ||
137 | |||
138 | |||
139 | instance (Monad m,Monoid a) => Monoid (MarkupT m a) where | ||
140 | mempty = return mempty | ||
141 | {-# INLINE mempty #-} | ||
142 | a `mappend` b = do {a' <- a; b >>= return . (mappend a')} | ||
143 | {-# INLINE mappend #-} | ||
144 | |||
145 | |||
146 | instance Monad m => B.Attributable (MarkupT m a) where | ||
147 | h ! a = wrapMarkupT2 (B.! a) h | ||
148 | {-# INLINE (!) #-} | ||
149 | |||
150 | instance Monad m => B.Attributable (a -> MarkupT m b) where | ||
151 | h ! a = \x -> wrapMarkupT2 (B.! a) $ h x | ||
152 | {-# INLINE (!) #-} | ||
153 | |||
154 | instance Monad m => IsString (MarkupT m ()) where | ||
155 | fromString = wrapMarkup . fromString | ||
156 | {-# INLINE fromString #-} | ||
157 | |||
158 | wrapMarkupT :: Monad m => B.Markup -> MarkupT m () | ||
159 | wrapMarkupT = tell | ||
160 | {-# INLINE wrapMarkupT #-} | ||
161 | |||
162 | wrapMarkup :: B.Markup -> Markup | ||
163 | wrapMarkup = wrapMarkupT | ||
164 | {-# INLINE wrapMarkup #-} | ||
165 | |||
166 | wrapMarkupT2 :: Monad m => (B.Markup -> B.Markup) | ||
167 | -> MarkupT m a -> MarkupT m a | ||
168 | wrapMarkupT2 = censor | ||
169 | {-# INLINE wrapMarkupT2 #-} | ||
170 | |||
171 | wrapMarkup2 :: (B.Markup -> B.Markup) -> Markup2 | ||
172 | wrapMarkup2 = wrapMarkupT2 | ||
173 | {-# INLINE wrapMarkup2 #-} | ||
174 | |||
175 | unsafeByteString :: BS.ByteString -> Markup | ||
176 | unsafeByteString = wrapMarkup . B.unsafeByteString | ||
177 | {-# INLINE unsafeByteString #-} | ||
178 | |||
179 | -- | Insert a lazy 'BL.ByteString'. See 'unsafeByteString' for reasons why this | ||
180 | -- is an unsafe operation. | ||
181 | -- | ||
182 | unsafeLazyByteString :: BL.ByteString -- ^ Value to insert | ||
183 | -> Markup -- ^ Resulting HTML fragment | ||
184 | unsafeLazyByteString = wrapMarkup . B.unsafeLazyByteString | ||
185 | {-# INLINE unsafeLazyByteString #-} | ||
186 | |||
187 | external :: Monad m => MarkupT m a -> MarkupT m a | ||
188 | external = wrapMarkupT2 B.external | ||
189 | {-# INLINE external #-} | ||
190 | |||
191 | contents :: Monad m => MarkupT m a -> MarkupT m a | ||
192 | contents = wrapMarkupT2 B.contents | ||
193 | {-# INLINE contents #-} | ||
194 | |||
195 | customParent ::B.Tag -> Markup2 | ||
196 | customParent = wrapMarkup2 . B.customParent | ||
197 | {-# INLINE customParent #-} | ||
198 | |||
199 | customLeaf :: B.Tag -> Bool -> Markup | ||
200 | customLeaf = fmap wrapMarkup . B.customLeaf | ||
201 | {-# INLINE customLeaf #-} | ||
202 | |||
203 | preEscapedText :: T.Text -> Markup | ||
204 | preEscapedText = wrapMarkup . B.preEscapedText | ||
205 | {-# INLINE preEscapedText #-} | ||
206 | |||
207 | preEscapedLazyText :: LT.Text -> Markup | ||
208 | preEscapedLazyText = wrapMarkup . B.preEscapedLazyText | ||
209 | {-# INLINE preEscapedLazyText #-} | ||
210 | |||
211 | preEscapedTextBuilder :: LTB.Builder -> Markup | ||
212 | textBuilder :: LTB.Builder -> Markup | ||
213 | |||
214 | #ifdef PRE_BUILDER | ||
215 | preEscapedTextBuilder = wrapMarkup . B.preEscapedTextBuilder | ||
216 | textBuilder = wrapMarkup . B.textBuilder | ||
217 | {-# INLINE preEscapedTextBuilder #-} | ||
218 | {-# INLINE textBuilder #-} | ||
219 | #else | ||
220 | preEscapedTextBuilder = error "This function needs blaze-markup 0.7.1.0" | ||
221 | textBuilder = error "This function needs blaze-markup 0.7.1.0" | ||
222 | #endif | ||
223 | |||
224 | preEscapedString :: String -> Markup | ||
225 | preEscapedString = wrapMarkup . B.preEscapedString | ||
226 | {-# INLINE preEscapedString #-} | ||
227 | |||
228 | string :: String -> Markup | ||
229 | string = wrapMarkup . B.string | ||
230 | {-# INLINE string #-} | ||
231 | |||
232 | text :: T.Text -> Markup | ||
233 | text = wrapMarkup . B.text | ||
234 | {-# INLINE text #-} | ||
235 | |||
236 | lazyText :: LT.Text -> Markup | ||
237 | lazyText = wrapMarkup . B.lazyText | ||
238 | {-# INLINE lazyText #-} | ||
diff --git a/src/Text/BlazeT/Renderer/Pretty.hs b/src/Text/BlazeT/Renderer/Pretty.hs new file mode 100644 index 0000000..8977c94 --- /dev/null +++ b/src/Text/BlazeT/Renderer/Pretty.hs | |||
@@ -0,0 +1,22 @@ | |||
1 | module Text.BlazeT.Renderer.Pretty | ||
2 | ( renderMarkup | ||
3 | , renderHtml | ||
4 | , renderMarkupT | ||
5 | , renderHtmlT | ||
6 | ) where | ||
7 | |||
8 | import Control.Monad | ||
9 | import Control.Monad.Identity | ||
10 | import qualified Text.Blaze.Renderer.Pretty as BU | ||
11 | import Text.BlazeT | ||
12 | |||
13 | renderMarkup :: MarkupM a -> String | ||
14 | renderMarkup = runIdentity . renderMarkupT | ||
15 | renderMarkupT :: Monad m => MarkupT m a -> m String | ||
16 | renderMarkupT = liftM BU.renderMarkup . execMarkupT | ||
17 | |||
18 | renderHtml :: MarkupM a -> String | ||
19 | renderHtml = renderMarkup | ||
20 | renderHtmlT :: Monad m => MarkupT m a -> m String | ||
21 | renderHtmlT = renderMarkupT | ||
22 | |||
diff --git a/src/Text/BlazeT/Renderer/String.hs b/src/Text/BlazeT/Renderer/String.hs new file mode 100644 index 0000000..0a2de8a --- /dev/null +++ b/src/Text/BlazeT/Renderer/String.hs | |||
@@ -0,0 +1,27 @@ | |||
1 | module Text.BlazeT.Renderer.String | ||
2 | ( fromChoiceString | ||
3 | , renderMarkup | ||
4 | , renderHtml | ||
5 | , renderMarkupT | ||
6 | , renderHtmlT | ||
7 | ) where | ||
8 | |||
9 | import Control.Monad | ||
10 | import Control.Monad.Identity | ||
11 | import Text.Blaze.Internal (ChoiceString) | ||
12 | import qualified Text.Blaze.Renderer.String as BU | ||
13 | import Text.BlazeT | ||
14 | |||
15 | fromChoiceString :: ChoiceString -> String -> String | ||
16 | fromChoiceString = BU.fromChoiceString | ||
17 | |||
18 | renderMarkup :: MarkupM a -> String | ||
19 | renderMarkup = runIdentity . renderMarkupT | ||
20 | renderMarkupT :: Monad m => MarkupT m a -> m String | ||
21 | renderMarkupT = liftM BU.renderMarkup . execMarkupT | ||
22 | |||
23 | renderHtml :: MarkupM a -> String | ||
24 | renderHtml = renderMarkup | ||
25 | renderHtmlT :: Monad m => MarkupT m a -> m String | ||
26 | renderHtmlT = renderMarkupT | ||
27 | |||
diff --git a/src/Text/BlazeT/Renderer/Text.hs b/src/Text/BlazeT/Renderer/Text.hs new file mode 100644 index 0000000..31181eb --- /dev/null +++ b/src/Text/BlazeT/Renderer/Text.hs | |||
@@ -0,0 +1,75 @@ | |||
1 | module Text.BlazeT.Renderer.Text | ||
2 | ( renderMarkupBuilderT | ||
3 | , renderMarkupBuilder | ||
4 | , renderMarkupBuilderWithT | ||
5 | , renderMarkupT | ||
6 | , renderMarkupWithT | ||
7 | , renderHtmlBuilderT | ||
8 | , renderHtmlBuilderWithT | ||
9 | , renderHtmlT | ||
10 | , renderHtmlWithT | ||
11 | , renderMarkupBuilderWith | ||
12 | , renderMarkup | ||
13 | , renderMarkupWith | ||
14 | , renderHtmlBuilder | ||
15 | , renderHtmlBuilderWith | ||
16 | , renderHtml | ||
17 | , renderHtmlWith | ||
18 | ) where | ||
19 | |||
20 | import Control.Monad | ||
21 | import Data.ByteString (ByteString) | ||
22 | import Control.Monad.Identity | ||
23 | import Data.Text (Text) | ||
24 | import qualified Data.Text.Lazy as L | ||
25 | import qualified Data.Text.Lazy.Builder as B | ||
26 | import qualified Text.Blaze.Html.Renderer.Text as BH | ||
27 | import qualified Text.Blaze.Renderer.Text as BU | ||
28 | import Text.BlazeT | ||
29 | |||
30 | renderMarkupBuilder :: MarkupM a -> B.Builder | ||
31 | renderMarkupBuilder = runIdentity . renderMarkupBuilderT | ||
32 | |||
33 | renderMarkupBuilderT :: Monad m => MarkupT m a -> m B.Builder | ||
34 | renderMarkupBuilderT = liftM BU.renderMarkupBuilder . execMarkupT | ||
35 | |||
36 | renderHtmlBuilder :: MarkupM a -> B.Builder | ||
37 | renderHtmlBuilder = renderMarkupBuilder | ||
38 | |||
39 | renderHtmlBuilderT :: Monad m => MarkupT m a -> m B.Builder | ||
40 | renderHtmlBuilderT = renderMarkupBuilderT | ||
41 | |||
42 | renderMarkup :: MarkupM a -> L.Text | ||
43 | renderMarkup = runIdentity . renderMarkupT | ||
44 | renderMarkupT :: Monad m => MarkupT m a -> m L.Text | ||
45 | renderMarkupT = liftM BU.renderMarkup . execMarkupT | ||
46 | |||
47 | renderHtml :: MarkupM a -> L.Text | ||
48 | renderHtml = renderMarkup | ||
49 | renderHtmlT :: Monad m => MarkupT m a -> m L.Text | ||
50 | renderHtmlT = renderMarkupT | ||
51 | |||
52 | renderMarkupWithT :: Monad m => (ByteString -> Text) -> MarkupT m a -> m L.Text | ||
53 | renderMarkupWithT g = liftM (BU.renderMarkupWith g) . execMarkupT | ||
54 | |||
55 | renderMarkupWith :: (ByteString -> Text) -> MarkupM a -> L.Text | ||
56 | renderMarkupWith g = runIdentity . renderMarkupWithT g | ||
57 | |||
58 | renderHtmlWithT :: Monad m => (ByteString -> Text) -> MarkupT m a -> m L.Text | ||
59 | renderHtmlWithT g = liftM (BH.renderHtmlWith g) . execMarkupT | ||
60 | |||
61 | renderHtmlWith :: (ByteString -> Text) -> MarkupM a -> L.Text | ||
62 | renderHtmlWith g = runIdentity . renderHtmlWithT g | ||
63 | |||
64 | renderHtmlBuilderWithT :: Monad m => (ByteString -> Text) -> MarkupT m a -> m B.Builder | ||
65 | renderHtmlBuilderWithT g = liftM (BH.renderHtmlBuilderWith g) . execMarkupT | ||
66 | |||
67 | renderHtmlBuilderWith :: (ByteString -> Text) -> MarkupM a -> B.Builder | ||
68 | renderHtmlBuilderWith g = runIdentity . renderHtmlBuilderWithT g | ||
69 | |||
70 | |||
71 | renderMarkupBuilderWithT :: Monad m => (ByteString -> Text) -> MarkupT m a -> m B.Builder | ||
72 | renderMarkupBuilderWithT g = liftM (BU.renderMarkupBuilderWith g) . execMarkupT | ||
73 | |||
74 | renderMarkupBuilderWith :: (ByteString -> Text) -> MarkupM a -> B.Builder | ||
75 | renderMarkupBuilderWith g = runIdentity . renderMarkupBuilderWithT g | ||
diff --git a/src/Text/BlazeT/Renderer/Utf8.hs b/src/Text/BlazeT/Renderer/Utf8.hs new file mode 100644 index 0000000..292f81f --- /dev/null +++ b/src/Text/BlazeT/Renderer/Utf8.hs | |||
@@ -0,0 +1,66 @@ | |||
1 | {-# OPTIONS_GHC -fsimpl-tick-factor=230 #-} | ||
2 | |||
3 | -- the above option was not needed with | ||
4 | -- ,blaze-html >= 0.6.0.0 && < 0.7.0.0 | ||
5 | -- ,blaze-builder >= 0.2 | ||
6 | -- ,text < 1.2 | ||
7 | |||
8 | module Text.BlazeT.Renderer.Utf8 | ||
9 | ( | ||
10 | renderMarkupBuilder | ||
11 | , renderMarkup | ||
12 | , renderMarkupToByteStringIO | ||
13 | , renderHtmlBuilder | ||
14 | , renderHtml | ||
15 | , renderHtmlToByteStringIO | ||
16 | |||
17 | -- * new BlazeT stuff | ||
18 | , renderMarkupBuilderT | ||
19 | , renderMarkupT | ||
20 | , renderMarkupToByteStringIOT | ||
21 | , renderHtmlToByteStringIOT | ||
22 | , renderHtmlBuilderT | ||
23 | , renderHtmlT | ||
24 | ) where | ||
25 | |||
26 | import qualified Blaze.ByteString.Builder as B | ||
27 | import Control.Monad | ||
28 | import Control.Monad.Identity | ||
29 | import qualified Data.ByteString as BS | ||
30 | import qualified Data.ByteString.Lazy as BL | ||
31 | import qualified Text.Blaze.Renderer.Utf8 as BU | ||
32 | import Text.BlazeT | ||
33 | |||
34 | renderMarkupBuilder :: MarkupM a -> B.Builder | ||
35 | renderMarkupBuilder = runIdentity . renderMarkupBuilderT | ||
36 | |||
37 | renderMarkupBuilderT :: Monad m => MarkupT m a -> m B.Builder | ||
38 | renderMarkupBuilderT = liftM BU.renderMarkupBuilder . execMarkupT | ||
39 | |||
40 | renderHtmlBuilder :: MarkupM a -> B.Builder | ||
41 | renderHtmlBuilder = renderMarkupBuilder | ||
42 | |||
43 | renderHtmlBuilderT :: Monad m => MarkupT m a -> m B.Builder | ||
44 | renderHtmlBuilderT = renderMarkupBuilderT | ||
45 | |||
46 | renderMarkup :: MarkupM a -> BL.ByteString | ||
47 | renderMarkup = runIdentity . renderMarkupT | ||
48 | renderMarkupT :: Monad m => MarkupT m a -> m BL.ByteString | ||
49 | renderMarkupT = liftM BU.renderMarkup . execMarkupT | ||
50 | |||
51 | renderHtml :: MarkupM a -> BL.ByteString | ||
52 | renderHtml = renderMarkup | ||
53 | renderHtmlT :: Monad m => MarkupT m a -> m BL.ByteString | ||
54 | renderHtmlT = renderMarkupT | ||
55 | |||
56 | renderMarkupToByteStringIO :: (BS.ByteString -> IO ()) -> MarkupM a -> IO () | ||
57 | renderMarkupToByteStringIO g = runIdentity . renderMarkupToByteStringIOT g | ||
58 | renderMarkupToByteStringIOT :: Monad m => (BS.ByteString -> IO ()) -> | ||
59 | MarkupT m a -> m (IO ()) | ||
60 | renderMarkupToByteStringIOT g = liftM (BU.renderMarkupToByteStringIO g) . execMarkupT | ||
61 | |||
62 | renderHtmlToByteStringIO :: (BS.ByteString -> IO ()) -> MarkupM a -> IO () | ||
63 | renderHtmlToByteStringIO g = runIdentity . renderMarkupToByteStringIOT g | ||
64 | renderHtmlToByteStringIOT :: Monad m => (BS.ByteString -> IO ()) -> | ||
65 | MarkupT m a -> m (IO ()) | ||
66 | renderHtmlToByteStringIOT g = liftM (BU.renderMarkupToByteStringIO g) . execMarkupT | ||
diff --git a/src/Text/BlazeT/XHtml1/FrameSet.hs b/src/Text/BlazeT/XHtml1/FrameSet.hs new file mode 100644 index 0000000..57edcd5 --- /dev/null +++ b/src/Text/BlazeT/XHtml1/FrameSet.hs | |||
@@ -0,0 +1,198 @@ | |||
1 | -- !! DO NOT EDIT | ||
2 | {-| | ||
3 | (Automatically generated by @src\/Util\/GenerateHtmlTCombinators.hs:49@) | ||
4 | |||
5 | This module wraps all exports of "Text.Blaze.XHtml1.FrameSet" using 'wrapMarkup' and 'wrapMarkup'. | ||
6 | -} | ||
7 | module Text.BlazeT.XHtml1.FrameSet | ||
8 | (module Text.BlazeT.XHtml1.FrameSet | ||
9 | ,module Text.BlazeT.Html | ||
10 | ) where | ||
11 | import qualified Text.Blaze.XHtml1.FrameSet | ||
12 | import Text.BlazeT | ||
13 | import Text.BlazeT.Html | ||
14 | import Text.BlazeT.Internal | ||
15 | |||
16 | docTypeHtml :: Markup2 | ||
17 | docTypeHtml = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.docTypeHtml | ||
18 | a :: Markup2 | ||
19 | a = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.a | ||
20 | abbr :: Markup2 | ||
21 | abbr = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.abbr | ||
22 | acronym :: Markup2 | ||
23 | acronym = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.acronym | ||
24 | address :: Markup2 | ||
25 | address = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.address | ||
26 | b :: Markup2 | ||
27 | b = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.b | ||
28 | bdo :: Markup2 | ||
29 | bdo = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.bdo | ||
30 | big :: Markup2 | ||
31 | big = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.big | ||
32 | blockquote :: Markup2 | ||
33 | blockquote = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.blockquote | ||
34 | body :: Markup2 | ||
35 | body = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.body | ||
36 | button :: Markup2 | ||
37 | button = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.button | ||
38 | caption :: Markup2 | ||
39 | caption = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.caption | ||
40 | cite :: Markup2 | ||
41 | cite = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.cite | ||
42 | code :: Markup2 | ||
43 | code = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.code | ||
44 | colgroup :: Markup2 | ||
45 | colgroup = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.colgroup | ||
46 | dd :: Markup2 | ||
47 | dd = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.dd | ||
48 | del :: Markup2 | ||
49 | del = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.del | ||
50 | dfn :: Markup2 | ||
51 | dfn = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.dfn | ||
52 | div :: Markup2 | ||
53 | div = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.div | ||
54 | dl :: Markup2 | ||
55 | dl = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.dl | ||
56 | dt :: Markup2 | ||
57 | dt = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.dt | ||
58 | em :: Markup2 | ||
59 | em = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.em | ||
60 | fieldset :: Markup2 | ||
61 | fieldset = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.fieldset | ||
62 | form :: Markup2 | ||
63 | form = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.form | ||
64 | h1 :: Markup2 | ||
65 | h1 = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.h1 | ||
66 | h2 :: Markup2 | ||
67 | h2 = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.h2 | ||
68 | h3 :: Markup2 | ||
69 | h3 = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.h3 | ||
70 | h4 :: Markup2 | ||
71 | h4 = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.h4 | ||
72 | h5 :: Markup2 | ||
73 | h5 = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.h5 | ||
74 | h6 :: Markup2 | ||
75 | h6 = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.h6 | ||
76 | head :: Markup2 | ||
77 | head = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.head | ||
78 | html :: Markup2 | ||
79 | html = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.html | ||
80 | i :: Markup2 | ||
81 | i = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.i | ||
82 | ins :: Markup2 | ||
83 | ins = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.ins | ||
84 | kbd :: Markup2 | ||
85 | kbd = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.kbd | ||
86 | label :: Markup2 | ||
87 | label = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.label | ||
88 | legend :: Markup2 | ||
89 | legend = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.legend | ||
90 | li :: Markup2 | ||
91 | li = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.li | ||
92 | map :: Markup2 | ||
93 | map = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.map | ||
94 | noscript :: Markup2 | ||
95 | noscript = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.noscript | ||
96 | object :: Markup2 | ||
97 | object = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.object | ||
98 | ol :: Markup2 | ||
99 | ol = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.ol | ||
100 | optgroup :: Markup2 | ||
101 | optgroup = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.optgroup | ||
102 | option :: Markup2 | ||
103 | option = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.option | ||
104 | p :: Markup2 | ||
105 | p = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.p | ||
106 | pre :: Markup2 | ||
107 | pre = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.pre | ||
108 | q :: Markup2 | ||
109 | q = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.q | ||
110 | samp :: Markup2 | ||
111 | samp = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.samp | ||
112 | script :: Markup2 | ||
113 | script = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.script | ||
114 | select :: Markup2 | ||
115 | select = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.select | ||
116 | small :: Markup2 | ||
117 | small = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.small | ||
118 | span :: Markup2 | ||
119 | span = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.span | ||
120 | strong :: Markup2 | ||
121 | strong = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.strong | ||
122 | style :: Markup2 | ||
123 | style = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.style | ||
124 | sub :: Markup2 | ||
125 | sub = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.sub | ||
126 | sup :: Markup2 | ||
127 | sup = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.sup | ||
128 | table :: Markup2 | ||
129 | table = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.table | ||
130 | tbody :: Markup2 | ||
131 | tbody = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.tbody | ||
132 | td :: Markup2 | ||
133 | td = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.td | ||
134 | textarea :: Markup2 | ||
135 | textarea = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.textarea | ||
136 | tfoot :: Markup2 | ||
137 | tfoot = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.tfoot | ||
138 | th :: Markup2 | ||
139 | th = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.th | ||
140 | thead :: Markup2 | ||
141 | thead = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.thead | ||
142 | title :: Markup2 | ||
143 | title = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.title | ||
144 | tr :: Markup2 | ||
145 | tr = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.tr | ||
146 | tt :: Markup2 | ||
147 | tt = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.tt | ||
148 | ul :: Markup2 | ||
149 | ul = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.ul | ||
150 | var :: Markup2 | ||
151 | var = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.var | ||
152 | applet :: Markup2 | ||
153 | applet = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.applet | ||
154 | center :: Markup2 | ||
155 | center = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.center | ||
156 | dir :: Markup2 | ||
157 | dir = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.dir | ||
158 | font :: Markup2 | ||
159 | font = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.font | ||
160 | iframe :: Markup2 | ||
161 | iframe = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.iframe | ||
162 | isindex :: Markup2 | ||
163 | isindex = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.isindex | ||
164 | menu :: Markup2 | ||
165 | menu = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.menu | ||
166 | noframes :: Markup2 | ||
167 | noframes = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.noframes | ||
168 | s :: Markup2 | ||
169 | s = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.s | ||
170 | u :: Markup2 | ||
171 | u = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.u | ||
172 | frameset :: Markup2 | ||
173 | frameset = wrapMarkup2 Text.Blaze.XHtml1.FrameSet.frameset | ||
174 | docType :: Markup | ||
175 | docType = wrapMarkup Text.Blaze.XHtml1.FrameSet.docType | ||
176 | area :: Markup | ||
177 | area = wrapMarkup Text.Blaze.XHtml1.FrameSet.area | ||
178 | br :: Markup | ||
179 | br = wrapMarkup Text.Blaze.XHtml1.FrameSet.br | ||
180 | col :: Markup | ||
181 | col = wrapMarkup Text.Blaze.XHtml1.FrameSet.col | ||
182 | hr :: Markup | ||
183 | hr = wrapMarkup Text.Blaze.XHtml1.FrameSet.hr | ||
184 | link :: Markup | ||
185 | link = wrapMarkup Text.Blaze.XHtml1.FrameSet.link | ||
186 | img :: Markup | ||
187 | img = wrapMarkup Text.Blaze.XHtml1.FrameSet.img | ||
188 | input :: Markup | ||
189 | input = wrapMarkup Text.Blaze.XHtml1.FrameSet.input | ||
190 | meta :: Markup | ||
191 | meta = wrapMarkup Text.Blaze.XHtml1.FrameSet.meta | ||
192 | param :: Markup | ||
193 | param = wrapMarkup Text.Blaze.XHtml1.FrameSet.param | ||
194 | basefont :: Markup | ||
195 | basefont = wrapMarkup Text.Blaze.XHtml1.FrameSet.basefont | ||
196 | frame :: Markup | ||
197 | frame = wrapMarkup Text.Blaze.XHtml1.FrameSet.frame | ||
198 | |||
diff --git a/src/Text/BlazeT/XHtml1/FrameSet/Attributes.hs b/src/Text/BlazeT/XHtml1/FrameSet/Attributes.hs new file mode 100644 index 0000000..af4ecbe --- /dev/null +++ b/src/Text/BlazeT/XHtml1/FrameSet/Attributes.hs | |||
@@ -0,0 +1,11 @@ | |||
1 | -- !! DO NOT EDIT | ||
2 | {-| | ||
3 | (Automatically generated by @src\/Util\/GenerateHtmlTCombinators.hs:49@) | ||
4 | |||
5 | This module simply reexports the corresponding @blaze-html@ module. | ||
6 | -} | ||
7 | module Text.BlazeT.XHtml1.FrameSet.Attributes | ||
8 | (module Text.Blaze.XHtml1.FrameSet.Attributes | ||
9 | ) where | ||
10 | import Text.Blaze.XHtml1.FrameSet.Attributes | ||
11 | |||
diff --git a/src/Text/BlazeT/XHtml1/Strict.hs b/src/Text/BlazeT/XHtml1/Strict.hs new file mode 100644 index 0000000..0bca241 --- /dev/null +++ b/src/Text/BlazeT/XHtml1/Strict.hs | |||
@@ -0,0 +1,172 @@ | |||
1 | -- !! DO NOT EDIT | ||
2 | {-| | ||
3 | (Automatically generated by @src\/Util\/GenerateHtmlTCombinators.hs:49@) | ||
4 | |||
5 | This module wraps all exports of "Text.Blaze.XHtml1.Strict" using 'wrapMarkup' and 'wrapMarkup'. | ||
6 | -} | ||
7 | module Text.BlazeT.XHtml1.Strict | ||
8 | (module Text.BlazeT.XHtml1.Strict | ||
9 | ,module Text.BlazeT.Html | ||
10 | ) where | ||
11 | import qualified Text.Blaze.XHtml1.Strict | ||
12 | import Text.BlazeT | ||
13 | import Text.BlazeT.Html | ||
14 | import Text.BlazeT.Internal | ||
15 | |||
16 | docTypeHtml :: Markup2 | ||
17 | docTypeHtml = wrapMarkup2 Text.Blaze.XHtml1.Strict.docTypeHtml | ||
18 | a :: Markup2 | ||
19 | a = wrapMarkup2 Text.Blaze.XHtml1.Strict.a | ||
20 | abbr :: Markup2 | ||
21 | abbr = wrapMarkup2 Text.Blaze.XHtml1.Strict.abbr | ||
22 | acronym :: Markup2 | ||
23 | acronym = wrapMarkup2 Text.Blaze.XHtml1.Strict.acronym | ||
24 | address :: Markup2 | ||
25 | address = wrapMarkup2 Text.Blaze.XHtml1.Strict.address | ||
26 | b :: Markup2 | ||
27 | b = wrapMarkup2 Text.Blaze.XHtml1.Strict.b | ||
28 | bdo :: Markup2 | ||
29 | bdo = wrapMarkup2 Text.Blaze.XHtml1.Strict.bdo | ||
30 | big :: Markup2 | ||
31 | big = wrapMarkup2 Text.Blaze.XHtml1.Strict.big | ||
32 | blockquote :: Markup2 | ||
33 | blockquote = wrapMarkup2 Text.Blaze.XHtml1.Strict.blockquote | ||
34 | body :: Markup2 | ||
35 | body = wrapMarkup2 Text.Blaze.XHtml1.Strict.body | ||
36 | button :: Markup2 | ||
37 | button = wrapMarkup2 Text.Blaze.XHtml1.Strict.button | ||
38 | caption :: Markup2 | ||
39 | caption = wrapMarkup2 Text.Blaze.XHtml1.Strict.caption | ||
40 | cite :: Markup2 | ||
41 | cite = wrapMarkup2 Text.Blaze.XHtml1.Strict.cite | ||
42 | code :: Markup2 | ||
43 | code = wrapMarkup2 Text.Blaze.XHtml1.Strict.code | ||
44 | colgroup :: Markup2 | ||
45 | colgroup = wrapMarkup2 Text.Blaze.XHtml1.Strict.colgroup | ||
46 | dd :: Markup2 | ||
47 | dd = wrapMarkup2 Text.Blaze.XHtml1.Strict.dd | ||
48 | del :: Markup2 | ||
49 | del = wrapMarkup2 Text.Blaze.XHtml1.Strict.del | ||
50 | dfn :: Markup2 | ||
51 | dfn = wrapMarkup2 Text.Blaze.XHtml1.Strict.dfn | ||
52 | div :: Markup2 | ||
53 | div = wrapMarkup2 Text.Blaze.XHtml1.Strict.div | ||
54 | dl :: Markup2 | ||
55 | dl = wrapMarkup2 Text.Blaze.XHtml1.Strict.dl | ||
56 | dt :: Markup2 | ||
57 | dt = wrapMarkup2 Text.Blaze.XHtml1.Strict.dt | ||
58 | em :: Markup2 | ||
59 | em = wrapMarkup2 Text.Blaze.XHtml1.Strict.em | ||
60 | fieldset :: Markup2 | ||
61 | fieldset = wrapMarkup2 Text.Blaze.XHtml1.Strict.fieldset | ||
62 | form :: Markup2 | ||
63 | form = wrapMarkup2 Text.Blaze.XHtml1.Strict.form | ||
64 | h1 :: Markup2 | ||
65 | h1 = wrapMarkup2 Text.Blaze.XHtml1.Strict.h1 | ||
66 | h2 :: Markup2 | ||
67 | h2 = wrapMarkup2 Text.Blaze.XHtml1.Strict.h2 | ||
68 | h3 :: Markup2 | ||
69 | h3 = wrapMarkup2 Text.Blaze.XHtml1.Strict.h3 | ||
70 | h4 :: Markup2 | ||
71 | h4 = wrapMarkup2 Text.Blaze.XHtml1.Strict.h4 | ||
72 | h5 :: Markup2 | ||
73 | h5 = wrapMarkup2 Text.Blaze.XHtml1.Strict.h5 | ||
74 | h6 :: Markup2 | ||
75 | h6 = wrapMarkup2 Text.Blaze.XHtml1.Strict.h6 | ||
76 | head :: Markup2 | ||
77 | head = wrapMarkup2 Text.Blaze.XHtml1.Strict.head | ||
78 | html :: Markup2 | ||
79 | html = wrapMarkup2 Text.Blaze.XHtml1.Strict.html | ||
80 | i :: Markup2 | ||
81 | i = wrapMarkup2 Text.Blaze.XHtml1.Strict.i | ||
82 | ins :: Markup2 | ||
83 | ins = wrapMarkup2 Text.Blaze.XHtml1.Strict.ins | ||
84 | kbd :: Markup2 | ||
85 | kbd = wrapMarkup2 Text.Blaze.XHtml1.Strict.kbd | ||
86 | label :: Markup2 | ||
87 | label = wrapMarkup2 Text.Blaze.XHtml1.Strict.label | ||
88 | legend :: Markup2 | ||
89 | legend = wrapMarkup2 Text.Blaze.XHtml1.Strict.legend | ||
90 | li :: Markup2 | ||
91 | li = wrapMarkup2 Text.Blaze.XHtml1.Strict.li | ||
92 | map :: Markup2 | ||
93 | map = wrapMarkup2 Text.Blaze.XHtml1.Strict.map | ||
94 | noscript :: Markup2 | ||
95 | noscript = wrapMarkup2 Text.Blaze.XHtml1.Strict.noscript | ||
96 | object :: Markup2 | ||
97 | object = wrapMarkup2 Text.Blaze.XHtml1.Strict.object | ||
98 | ol :: Markup2 | ||
99 | ol = wrapMarkup2 Text.Blaze.XHtml1.Strict.ol | ||
100 | optgroup :: Markup2 | ||
101 | optgroup = wrapMarkup2 Text.Blaze.XHtml1.Strict.optgroup | ||
102 | option :: Markup2 | ||
103 | option = wrapMarkup2 Text.Blaze.XHtml1.Strict.option | ||
104 | p :: Markup2 | ||
105 | p = wrapMarkup2 Text.Blaze.XHtml1.Strict.p | ||
106 | pre :: Markup2 | ||
107 | pre = wrapMarkup2 Text.Blaze.XHtml1.Strict.pre | ||
108 | q :: Markup2 | ||
109 | q = wrapMarkup2 Text.Blaze.XHtml1.Strict.q | ||
110 | samp :: Markup2 | ||
111 | samp = wrapMarkup2 Text.Blaze.XHtml1.Strict.samp | ||
112 | script :: Markup2 | ||
113 | script = wrapMarkup2 Text.Blaze.XHtml1.Strict.script | ||
114 | select :: Markup2 | ||
115 | select = wrapMarkup2 Text.Blaze.XHtml1.Strict.select | ||
116 | small :: Markup2 | ||
117 | small = wrapMarkup2 Text.Blaze.XHtml1.Strict.small | ||
118 | span :: Markup2 | ||
119 | span = wrapMarkup2 Text.Blaze.XHtml1.Strict.span | ||
120 | strong :: Markup2 | ||
121 | strong = wrapMarkup2 Text.Blaze.XHtml1.Strict.strong | ||
122 | style :: Markup2 | ||
123 | style = wrapMarkup2 Text.Blaze.XHtml1.Strict.style | ||
124 | sub :: Markup2 | ||
125 | sub = wrapMarkup2 Text.Blaze.XHtml1.Strict.sub | ||
126 | sup :: Markup2 | ||
127 | sup = wrapMarkup2 Text.Blaze.XHtml1.Strict.sup | ||
128 | table :: Markup2 | ||
129 | table = wrapMarkup2 Text.Blaze.XHtml1.Strict.table | ||
130 | tbody :: Markup2 | ||
131 | tbody = wrapMarkup2 Text.Blaze.XHtml1.Strict.tbody | ||
132 | td :: Markup2 | ||
133 | td = wrapMarkup2 Text.Blaze.XHtml1.Strict.td | ||
134 | textarea :: Markup2 | ||
135 | textarea = wrapMarkup2 Text.Blaze.XHtml1.Strict.textarea | ||
136 | tfoot :: Markup2 | ||
137 | tfoot = wrapMarkup2 Text.Blaze.XHtml1.Strict.tfoot | ||
138 | th :: Markup2 | ||
139 | th = wrapMarkup2 Text.Blaze.XHtml1.Strict.th | ||
140 | thead :: Markup2 | ||
141 | thead = wrapMarkup2 Text.Blaze.XHtml1.Strict.thead | ||
142 | title :: Markup2 | ||
143 | title = wrapMarkup2 Text.Blaze.XHtml1.Strict.title | ||
144 | tr :: Markup2 | ||
145 | tr = wrapMarkup2 Text.Blaze.XHtml1.Strict.tr | ||
146 | tt :: Markup2 | ||
147 | tt = wrapMarkup2 Text.Blaze.XHtml1.Strict.tt | ||
148 | ul :: Markup2 | ||
149 | ul = wrapMarkup2 Text.Blaze.XHtml1.Strict.ul | ||
150 | var :: Markup2 | ||
151 | var = wrapMarkup2 Text.Blaze.XHtml1.Strict.var | ||
152 | docType :: Markup | ||
153 | docType = wrapMarkup Text.Blaze.XHtml1.Strict.docType | ||
154 | area :: Markup | ||
155 | area = wrapMarkup Text.Blaze.XHtml1.Strict.area | ||
156 | br :: Markup | ||
157 | br = wrapMarkup Text.Blaze.XHtml1.Strict.br | ||
158 | col :: Markup | ||
159 | col = wrapMarkup Text.Blaze.XHtml1.Strict.col | ||
160 | hr :: Markup | ||
161 | hr = wrapMarkup Text.Blaze.XHtml1.Strict.hr | ||
162 | link :: Markup | ||
163 | link = wrapMarkup Text.Blaze.XHtml1.Strict.link | ||
164 | img :: Markup | ||
165 | img = wrapMarkup Text.Blaze.XHtml1.Strict.img | ||
166 | input :: Markup | ||
167 | input = wrapMarkup Text.Blaze.XHtml1.Strict.input | ||
168 | meta :: Markup | ||
169 | meta = wrapMarkup Text.Blaze.XHtml1.Strict.meta | ||
170 | param :: Markup | ||
171 | param = wrapMarkup Text.Blaze.XHtml1.Strict.param | ||
172 | |||
diff --git a/src/Text/BlazeT/XHtml1/Strict/Attributes.hs b/src/Text/BlazeT/XHtml1/Strict/Attributes.hs new file mode 100644 index 0000000..c7e07d4 --- /dev/null +++ b/src/Text/BlazeT/XHtml1/Strict/Attributes.hs | |||
@@ -0,0 +1,11 @@ | |||
1 | -- !! DO NOT EDIT | ||
2 | {-| | ||
3 | (Automatically generated by @src\/Util\/GenerateHtmlTCombinators.hs:49@) | ||
4 | |||
5 | This module simply reexports the corresponding @blaze-html@ module. | ||
6 | -} | ||
7 | module Text.BlazeT.XHtml1.Strict.Attributes | ||
8 | (module Text.Blaze.XHtml1.Strict.Attributes | ||
9 | ) where | ||
10 | import Text.Blaze.XHtml1.Strict.Attributes | ||
11 | |||
diff --git a/src/Text/BlazeT/XHtml1/Transitional.hs b/src/Text/BlazeT/XHtml1/Transitional.hs new file mode 100644 index 0000000..b1e6aad --- /dev/null +++ b/src/Text/BlazeT/XHtml1/Transitional.hs | |||
@@ -0,0 +1,194 @@ | |||
1 | -- !! DO NOT EDIT | ||
2 | {-| | ||
3 | (Automatically generated by @src\/Util\/GenerateHtmlTCombinators.hs:49@) | ||
4 | |||
5 | This module wraps all exports of "Text.Blaze.XHtml1.Transitional" using 'wrapMarkup' and 'wrapMarkup'. | ||
6 | -} | ||
7 | module Text.BlazeT.XHtml1.Transitional | ||
8 | (module Text.BlazeT.XHtml1.Transitional | ||
9 | ,module Text.BlazeT.Html | ||
10 | ) where | ||
11 | import qualified Text.Blaze.XHtml1.Transitional | ||
12 | import Text.BlazeT | ||
13 | import Text.BlazeT.Html | ||
14 | import Text.BlazeT.Internal | ||
15 | |||
16 | docTypeHtml :: Markup2 | ||
17 | docTypeHtml = wrapMarkup2 Text.Blaze.XHtml1.Transitional.docTypeHtml | ||
18 | a :: Markup2 | ||
19 | a = wrapMarkup2 Text.Blaze.XHtml1.Transitional.a | ||
20 | abbr :: Markup2 | ||
21 | abbr = wrapMarkup2 Text.Blaze.XHtml1.Transitional.abbr | ||
22 | acronym :: Markup2 | ||
23 | acronym = wrapMarkup2 Text.Blaze.XHtml1.Transitional.acronym | ||
24 | address :: Markup2 | ||
25 | address = wrapMarkup2 Text.Blaze.XHtml1.Transitional.address | ||
26 | b :: Markup2 | ||
27 | b = wrapMarkup2 Text.Blaze.XHtml1.Transitional.b | ||
28 | bdo :: Markup2 | ||
29 | bdo = wrapMarkup2 Text.Blaze.XHtml1.Transitional.bdo | ||
30 | big :: Markup2 | ||
31 | big = wrapMarkup2 Text.Blaze.XHtml1.Transitional.big | ||
32 | blockquote :: Markup2 | ||
33 | blockquote = wrapMarkup2 Text.Blaze.XHtml1.Transitional.blockquote | ||
34 | body :: Markup2 | ||
35 | body = wrapMarkup2 Text.Blaze.XHtml1.Transitional.body | ||
36 | button :: Markup2 | ||
37 | button = wrapMarkup2 Text.Blaze.XHtml1.Transitional.button | ||
38 | caption :: Markup2 | ||
39 | caption = wrapMarkup2 Text.Blaze.XHtml1.Transitional.caption | ||
40 | cite :: Markup2 | ||
41 | cite = wrapMarkup2 Text.Blaze.XHtml1.Transitional.cite | ||
42 | code :: Markup2 | ||
43 | code = wrapMarkup2 Text.Blaze.XHtml1.Transitional.code | ||
44 | colgroup :: Markup2 | ||
45 | colgroup = wrapMarkup2 Text.Blaze.XHtml1.Transitional.colgroup | ||
46 | dd :: Markup2 | ||
47 | dd = wrapMarkup2 Text.Blaze.XHtml1.Transitional.dd | ||
48 | del :: Markup2 | ||
49 | del = wrapMarkup2 Text.Blaze.XHtml1.Transitional.del | ||
50 | dfn :: Markup2 | ||
51 | dfn = wrapMarkup2 Text.Blaze.XHtml1.Transitional.dfn | ||
52 | div :: Markup2 | ||
53 | div = wrapMarkup2 Text.Blaze.XHtml1.Transitional.div | ||
54 | dl :: Markup2 | ||
55 | dl = wrapMarkup2 Text.Blaze.XHtml1.Transitional.dl | ||
56 | dt :: Markup2 | ||
57 | dt = wrapMarkup2 Text.Blaze.XHtml1.Transitional.dt | ||
58 | em :: Markup2 | ||
59 | em = wrapMarkup2 Text.Blaze.XHtml1.Transitional.em | ||
60 | fieldset :: Markup2 | ||
61 | fieldset = wrapMarkup2 Text.Blaze.XHtml1.Transitional.fieldset | ||
62 | form :: Markup2 | ||
63 | form = wrapMarkup2 Text.Blaze.XHtml1.Transitional.form | ||
64 | h1 :: Markup2 | ||
65 | h1 = wrapMarkup2 Text.Blaze.XHtml1.Transitional.h1 | ||
66 | h2 :: Markup2 | ||
67 | h2 = wrapMarkup2 Text.Blaze.XHtml1.Transitional.h2 | ||
68 | h3 :: Markup2 | ||
69 | h3 = wrapMarkup2 Text.Blaze.XHtml1.Transitional.h3 | ||
70 | h4 :: Markup2 | ||
71 | h4 = wrapMarkup2 Text.Blaze.XHtml1.Transitional.h4 | ||
72 | h5 :: Markup2 | ||
73 | h5 = wrapMarkup2 Text.Blaze.XHtml1.Transitional.h5 | ||
74 | h6 :: Markup2 | ||
75 | h6 = wrapMarkup2 Text.Blaze.XHtml1.Transitional.h6 | ||
76 | head :: Markup2 | ||
77 | head = wrapMarkup2 Text.Blaze.XHtml1.Transitional.head | ||
78 | html :: Markup2 | ||
79 | html = wrapMarkup2 Text.Blaze.XHtml1.Transitional.html | ||
80 | i :: Markup2 | ||
81 | i = wrapMarkup2 Text.Blaze.XHtml1.Transitional.i | ||
82 | ins :: Markup2 | ||
83 | ins = wrapMarkup2 Text.Blaze.XHtml1.Transitional.ins | ||
84 | kbd :: Markup2 | ||
85 | kbd = wrapMarkup2 Text.Blaze.XHtml1.Transitional.kbd | ||
86 | label :: Markup2 | ||
87 | label = wrapMarkup2 Text.Blaze.XHtml1.Transitional.label | ||
88 | legend :: Markup2 | ||
89 | legend = wrapMarkup2 Text.Blaze.XHtml1.Transitional.legend | ||
90 | li :: Markup2 | ||
91 | li = wrapMarkup2 Text.Blaze.XHtml1.Transitional.li | ||
92 | map :: Markup2 | ||
93 | map = wrapMarkup2 Text.Blaze.XHtml1.Transitional.map | ||
94 | noscript :: Markup2 | ||
95 | noscript = wrapMarkup2 Text.Blaze.XHtml1.Transitional.noscript | ||
96 | object :: Markup2 | ||
97 | object = wrapMarkup2 Text.Blaze.XHtml1.Transitional.object | ||
98 | ol :: Markup2 | ||
99 | ol = wrapMarkup2 Text.Blaze.XHtml1.Transitional.ol | ||
100 | optgroup :: Markup2 | ||
101 | optgroup = wrapMarkup2 Text.Blaze.XHtml1.Transitional.optgroup | ||
102 | option :: Markup2 | ||
103 | option = wrapMarkup2 Text.Blaze.XHtml1.Transitional.option | ||
104 | p :: Markup2 | ||
105 | p = wrapMarkup2 Text.Blaze.XHtml1.Transitional.p | ||
106 | pre :: Markup2 | ||
107 | pre = wrapMarkup2 Text.Blaze.XHtml1.Transitional.pre | ||
108 | q :: Markup2 | ||
109 | q = wrapMarkup2 Text.Blaze.XHtml1.Transitional.q | ||
110 | samp :: Markup2 | ||
111 | samp = wrapMarkup2 Text.Blaze.XHtml1.Transitional.samp | ||
112 | script :: Markup2 | ||
113 | script = wrapMarkup2 Text.Blaze.XHtml1.Transitional.script | ||
114 | select :: Markup2 | ||
115 | select = wrapMarkup2 Text.Blaze.XHtml1.Transitional.select | ||
116 | small :: Markup2 | ||
117 | small = wrapMarkup2 Text.Blaze.XHtml1.Transitional.small | ||
118 | span :: Markup2 | ||
119 | span = wrapMarkup2 Text.Blaze.XHtml1.Transitional.span | ||
120 | strong :: Markup2 | ||
121 | strong = wrapMarkup2 Text.Blaze.XHtml1.Transitional.strong | ||
122 | style :: Markup2 | ||
123 | style = wrapMarkup2 Text.Blaze.XHtml1.Transitional.style | ||
124 | sub :: Markup2 | ||
125 | sub = wrapMarkup2 Text.Blaze.XHtml1.Transitional.sub | ||
126 | sup :: Markup2 | ||
127 | sup = wrapMarkup2 Text.Blaze.XHtml1.Transitional.sup | ||
128 | table :: Markup2 | ||
129 | table = wrapMarkup2 Text.Blaze.XHtml1.Transitional.table | ||
130 | tbody :: Markup2 | ||
131 | tbody = wrapMarkup2 Text.Blaze.XHtml1.Transitional.tbody | ||
132 | td :: Markup2 | ||
133 | td = wrapMarkup2 Text.Blaze.XHtml1.Transitional.td | ||
134 | textarea :: Markup2 | ||
135 | textarea = wrapMarkup2 Text.Blaze.XHtml1.Transitional.textarea | ||
136 | tfoot :: Markup2 | ||
137 | tfoot = wrapMarkup2 Text.Blaze.XHtml1.Transitional.tfoot | ||
138 | th :: Markup2 | ||
139 | th = wrapMarkup2 Text.Blaze.XHtml1.Transitional.th | ||
140 | thead :: Markup2 | ||
141 | thead = wrapMarkup2 Text.Blaze.XHtml1.Transitional.thead | ||
142 | title :: Markup2 | ||
143 | title = wrapMarkup2 Text.Blaze.XHtml1.Transitional.title | ||
144 | tr :: Markup2 | ||
145 | tr = wrapMarkup2 Text.Blaze.XHtml1.Transitional.tr | ||
146 | tt :: Markup2 | ||
147 | tt = wrapMarkup2 Text.Blaze.XHtml1.Transitional.tt | ||
148 | ul :: Markup2 | ||
149 | ul = wrapMarkup2 Text.Blaze.XHtml1.Transitional.ul | ||
150 | var :: Markup2 | ||
151 | var = wrapMarkup2 Text.Blaze.XHtml1.Transitional.var | ||
152 | applet :: Markup2 | ||
153 | applet = wrapMarkup2 Text.Blaze.XHtml1.Transitional.applet | ||
154 | center :: Markup2 | ||
155 | center = wrapMarkup2 Text.Blaze.XHtml1.Transitional.center | ||
156 | dir :: Markup2 | ||
157 | dir = wrapMarkup2 Text.Blaze.XHtml1.Transitional.dir | ||
158 | font :: Markup2 | ||
159 | font = wrapMarkup2 Text.Blaze.XHtml1.Transitional.font | ||
160 | iframe :: Markup2 | ||
161 | iframe = wrapMarkup2 Text.Blaze.XHtml1.Transitional.iframe | ||
162 | isindex :: Markup2 | ||
163 | isindex = wrapMarkup2 Text.Blaze.XHtml1.Transitional.isindex | ||
164 | menu :: Markup2 | ||
165 | menu = wrapMarkup2 Text.Blaze.XHtml1.Transitional.menu | ||
166 | noframes :: Markup2 | ||
167 | noframes = wrapMarkup2 Text.Blaze.XHtml1.Transitional.noframes | ||
168 | s :: Markup2 | ||
169 | s = wrapMarkup2 Text.Blaze.XHtml1.Transitional.s | ||
170 | u :: Markup2 | ||
171 | u = wrapMarkup2 Text.Blaze.XHtml1.Transitional.u | ||
172 | docType :: Markup | ||
173 | docType = wrapMarkup Text.Blaze.XHtml1.Transitional.docType | ||
174 | area :: Markup | ||
175 | area = wrapMarkup Text.Blaze.XHtml1.Transitional.area | ||
176 | br :: Markup | ||
177 | br = wrapMarkup Text.Blaze.XHtml1.Transitional.br | ||
178 | col :: Markup | ||
179 | col = wrapMarkup Text.Blaze.XHtml1.Transitional.col | ||
180 | hr :: Markup | ||
181 | hr = wrapMarkup Text.Blaze.XHtml1.Transitional.hr | ||
182 | link :: Markup | ||
183 | link = wrapMarkup Text.Blaze.XHtml1.Transitional.link | ||
184 | img :: Markup | ||
185 | img = wrapMarkup Text.Blaze.XHtml1.Transitional.img | ||
186 | input :: Markup | ||
187 | input = wrapMarkup Text.Blaze.XHtml1.Transitional.input | ||
188 | meta :: Markup | ||
189 | meta = wrapMarkup Text.Blaze.XHtml1.Transitional.meta | ||
190 | param :: Markup | ||
191 | param = wrapMarkup Text.Blaze.XHtml1.Transitional.param | ||
192 | basefont :: Markup | ||
193 | basefont = wrapMarkup Text.Blaze.XHtml1.Transitional.basefont | ||
194 | |||
diff --git a/src/Text/BlazeT/XHtml1/Transitional/Attributes.hs b/src/Text/BlazeT/XHtml1/Transitional/Attributes.hs new file mode 100644 index 0000000..1881806 --- /dev/null +++ b/src/Text/BlazeT/XHtml1/Transitional/Attributes.hs | |||
@@ -0,0 +1,11 @@ | |||
1 | -- !! DO NOT EDIT | ||
2 | {-| | ||
3 | (Automatically generated by @src\/Util\/GenerateHtmlTCombinators.hs:49@) | ||
4 | |||
5 | This module simply reexports the corresponding @blaze-html@ module. | ||
6 | -} | ||
7 | module Text.BlazeT.XHtml1.Transitional.Attributes | ||
8 | (module Text.Blaze.XHtml1.Transitional.Attributes | ||
9 | ) where | ||
10 | import Text.Blaze.XHtml1.Transitional.Attributes | ||
11 | |||
diff --git a/src/Text/BlazeT/XHtml5.hs b/src/Text/BlazeT/XHtml5.hs new file mode 100644 index 0000000..102a993 --- /dev/null +++ b/src/Text/BlazeT/XHtml5.hs | |||
@@ -0,0 +1,234 @@ | |||
1 | -- !! DO NOT EDIT | ||
2 | {-| | ||
3 | (Automatically generated by @src\/Util\/GenerateHtmlTCombinators.hs:49@) | ||
4 | |||
5 | This module wraps all exports of "Text.Blaze.XHtml5" using 'wrapMarkup' and 'wrapMarkup'. | ||
6 | -} | ||
7 | module Text.BlazeT.XHtml5 | ||
8 | (module Text.BlazeT.XHtml5 | ||
9 | ,module Text.BlazeT.Html | ||
10 | ) where | ||
11 | import qualified Text.Blaze.XHtml5 | ||
12 | import Text.BlazeT | ||
13 | import Text.BlazeT.Html | ||
14 | import Text.BlazeT.Internal | ||
15 | |||
16 | docTypeHtml :: Markup2 | ||
17 | docTypeHtml = wrapMarkup2 Text.Blaze.XHtml5.docTypeHtml | ||
18 | a :: Markup2 | ||
19 | a = wrapMarkup2 Text.Blaze.XHtml5.a | ||
20 | abbr :: Markup2 | ||
21 | abbr = wrapMarkup2 Text.Blaze.XHtml5.abbr | ||
22 | address :: Markup2 | ||
23 | address = wrapMarkup2 Text.Blaze.XHtml5.address | ||
24 | article :: Markup2 | ||
25 | article = wrapMarkup2 Text.Blaze.XHtml5.article | ||
26 | aside :: Markup2 | ||
27 | aside = wrapMarkup2 Text.Blaze.XHtml5.aside | ||
28 | audio :: Markup2 | ||
29 | audio = wrapMarkup2 Text.Blaze.XHtml5.audio | ||
30 | b :: Markup2 | ||
31 | b = wrapMarkup2 Text.Blaze.XHtml5.b | ||
32 | bdo :: Markup2 | ||
33 | bdo = wrapMarkup2 Text.Blaze.XHtml5.bdo | ||
34 | blockquote :: Markup2 | ||
35 | blockquote = wrapMarkup2 Text.Blaze.XHtml5.blockquote | ||
36 | body :: Markup2 | ||
37 | body = wrapMarkup2 Text.Blaze.XHtml5.body | ||
38 | button :: Markup2 | ||
39 | button = wrapMarkup2 Text.Blaze.XHtml5.button | ||
40 | canvas :: Markup2 | ||
41 | canvas = wrapMarkup2 Text.Blaze.XHtml5.canvas | ||
42 | caption :: Markup2 | ||
43 | caption = wrapMarkup2 Text.Blaze.XHtml5.caption | ||
44 | cite :: Markup2 | ||
45 | cite = wrapMarkup2 Text.Blaze.XHtml5.cite | ||
46 | code :: Markup2 | ||
47 | code = wrapMarkup2 Text.Blaze.XHtml5.code | ||
48 | colgroup :: Markup2 | ||
49 | colgroup = wrapMarkup2 Text.Blaze.XHtml5.colgroup | ||
50 | command :: Markup2 | ||
51 | command = wrapMarkup2 Text.Blaze.XHtml5.command | ||
52 | datalist :: Markup2 | ||
53 | datalist = wrapMarkup2 Text.Blaze.XHtml5.datalist | ||
54 | dd :: Markup2 | ||
55 | dd = wrapMarkup2 Text.Blaze.XHtml5.dd | ||
56 | del :: Markup2 | ||
57 | del = wrapMarkup2 Text.Blaze.XHtml5.del | ||
58 | details :: Markup2 | ||
59 | details = wrapMarkup2 Text.Blaze.XHtml5.details | ||
60 | dfn :: Markup2 | ||
61 | dfn = wrapMarkup2 Text.Blaze.XHtml5.dfn | ||
62 | div :: Markup2 | ||
63 | div = wrapMarkup2 Text.Blaze.XHtml5.div | ||
64 | dl :: Markup2 | ||
65 | dl = wrapMarkup2 Text.Blaze.XHtml5.dl | ||
66 | dt :: Markup2 | ||
67 | dt = wrapMarkup2 Text.Blaze.XHtml5.dt | ||
68 | em :: Markup2 | ||
69 | em = wrapMarkup2 Text.Blaze.XHtml5.em | ||
70 | fieldset :: Markup2 | ||
71 | fieldset = wrapMarkup2 Text.Blaze.XHtml5.fieldset | ||
72 | figcaption :: Markup2 | ||
73 | figcaption = wrapMarkup2 Text.Blaze.XHtml5.figcaption | ||
74 | figure :: Markup2 | ||
75 | figure = wrapMarkup2 Text.Blaze.XHtml5.figure | ||
76 | footer :: Markup2 | ||
77 | footer = wrapMarkup2 Text.Blaze.XHtml5.footer | ||
78 | form :: Markup2 | ||
79 | form = wrapMarkup2 Text.Blaze.XHtml5.form | ||
80 | h1 :: Markup2 | ||
81 | h1 = wrapMarkup2 Text.Blaze.XHtml5.h1 | ||
82 | h2 :: Markup2 | ||
83 | h2 = wrapMarkup2 Text.Blaze.XHtml5.h2 | ||
84 | h3 :: Markup2 | ||
85 | h3 = wrapMarkup2 Text.Blaze.XHtml5.h3 | ||
86 | h4 :: Markup2 | ||
87 | h4 = wrapMarkup2 Text.Blaze.XHtml5.h4 | ||
88 | h5 :: Markup2 | ||
89 | h5 = wrapMarkup2 Text.Blaze.XHtml5.h5 | ||
90 | h6 :: Markup2 | ||
91 | h6 = wrapMarkup2 Text.Blaze.XHtml5.h6 | ||
92 | head :: Markup2 | ||
93 | head = wrapMarkup2 Text.Blaze.XHtml5.head | ||
94 | header :: Markup2 | ||
95 | header = wrapMarkup2 Text.Blaze.XHtml5.header | ||
96 | hgroup :: Markup2 | ||
97 | hgroup = wrapMarkup2 Text.Blaze.XHtml5.hgroup | ||
98 | html :: Markup2 | ||
99 | html = wrapMarkup2 Text.Blaze.XHtml5.html | ||
100 | i :: Markup2 | ||
101 | i = wrapMarkup2 Text.Blaze.XHtml5.i | ||
102 | iframe :: Markup2 | ||
103 | iframe = wrapMarkup2 Text.Blaze.XHtml5.iframe | ||
104 | ins :: Markup2 | ||
105 | ins = wrapMarkup2 Text.Blaze.XHtml5.ins | ||
106 | kbd :: Markup2 | ||
107 | kbd = wrapMarkup2 Text.Blaze.XHtml5.kbd | ||
108 | label :: Markup2 | ||
109 | label = wrapMarkup2 Text.Blaze.XHtml5.label | ||
110 | legend :: Markup2 | ||
111 | legend = wrapMarkup2 Text.Blaze.XHtml5.legend | ||
112 | li :: Markup2 | ||
113 | li = wrapMarkup2 Text.Blaze.XHtml5.li | ||
114 | main :: Markup2 | ||
115 | main = wrapMarkup2 Text.Blaze.XHtml5.main | ||
116 | map :: Markup2 | ||
117 | map = wrapMarkup2 Text.Blaze.XHtml5.map | ||
118 | mark :: Markup2 | ||
119 | mark = wrapMarkup2 Text.Blaze.XHtml5.mark | ||
120 | menu :: Markup2 | ||
121 | menu = wrapMarkup2 Text.Blaze.XHtml5.menu | ||
122 | meter :: Markup2 | ||
123 | meter = wrapMarkup2 Text.Blaze.XHtml5.meter | ||
124 | nav :: Markup2 | ||
125 | nav = wrapMarkup2 Text.Blaze.XHtml5.nav | ||
126 | noscript :: Markup2 | ||
127 | noscript = wrapMarkup2 Text.Blaze.XHtml5.noscript | ||
128 | object :: Markup2 | ||
129 | object = wrapMarkup2 Text.Blaze.XHtml5.object | ||
130 | ol :: Markup2 | ||
131 | ol = wrapMarkup2 Text.Blaze.XHtml5.ol | ||
132 | optgroup :: Markup2 | ||
133 | optgroup = wrapMarkup2 Text.Blaze.XHtml5.optgroup | ||
134 | option :: Markup2 | ||
135 | option = wrapMarkup2 Text.Blaze.XHtml5.option | ||
136 | output :: Markup2 | ||
137 | output = wrapMarkup2 Text.Blaze.XHtml5.output | ||
138 | p :: Markup2 | ||
139 | p = wrapMarkup2 Text.Blaze.XHtml5.p | ||
140 | pre :: Markup2 | ||
141 | pre = wrapMarkup2 Text.Blaze.XHtml5.pre | ||
142 | progress :: Markup2 | ||
143 | progress = wrapMarkup2 Text.Blaze.XHtml5.progress | ||
144 | q :: Markup2 | ||
145 | q = wrapMarkup2 Text.Blaze.XHtml5.q | ||
146 | rp :: Markup2 | ||
147 | rp = wrapMarkup2 Text.Blaze.XHtml5.rp | ||
148 | rt :: Markup2 | ||
149 | rt = wrapMarkup2 Text.Blaze.XHtml5.rt | ||
150 | ruby :: Markup2 | ||
151 | ruby = wrapMarkup2 Text.Blaze.XHtml5.ruby | ||
152 | samp :: Markup2 | ||
153 | samp = wrapMarkup2 Text.Blaze.XHtml5.samp | ||
154 | script :: Markup2 | ||
155 | script = wrapMarkup2 Text.Blaze.XHtml5.script | ||
156 | section :: Markup2 | ||
157 | section = wrapMarkup2 Text.Blaze.XHtml5.section | ||
158 | select :: Markup2 | ||
159 | select = wrapMarkup2 Text.Blaze.XHtml5.select | ||
160 | small :: Markup2 | ||
161 | small = wrapMarkup2 Text.Blaze.XHtml5.small | ||
162 | span :: Markup2 | ||
163 | span = wrapMarkup2 Text.Blaze.XHtml5.span | ||
164 | strong :: Markup2 | ||
165 | strong = wrapMarkup2 Text.Blaze.XHtml5.strong | ||
166 | style :: Markup2 | ||
167 | style = wrapMarkup2 Text.Blaze.XHtml5.style | ||
168 | sub :: Markup2 | ||
169 | sub = wrapMarkup2 Text.Blaze.XHtml5.sub | ||
170 | summary :: Markup2 | ||
171 | summary = wrapMarkup2 Text.Blaze.XHtml5.summary | ||
172 | sup :: Markup2 | ||
173 | sup = wrapMarkup2 Text.Blaze.XHtml5.sup | ||
174 | table :: Markup2 | ||
175 | table = wrapMarkup2 Text.Blaze.XHtml5.table | ||
176 | tbody :: Markup2 | ||
177 | tbody = wrapMarkup2 Text.Blaze.XHtml5.tbody | ||
178 | td :: Markup2 | ||
179 | td = wrapMarkup2 Text.Blaze.XHtml5.td | ||
180 | textarea :: Markup2 | ||
181 | textarea = wrapMarkup2 Text.Blaze.XHtml5.textarea | ||
182 | tfoot :: Markup2 | ||
183 | tfoot = wrapMarkup2 Text.Blaze.XHtml5.tfoot | ||
184 | th :: Markup2 | ||
185 | th = wrapMarkup2 Text.Blaze.XHtml5.th | ||
186 | thead :: Markup2 | ||
187 | thead = wrapMarkup2 Text.Blaze.XHtml5.thead | ||
188 | time :: Markup2 | ||
189 | time = wrapMarkup2 Text.Blaze.XHtml5.time | ||
190 | title :: Markup2 | ||
191 | title = wrapMarkup2 Text.Blaze.XHtml5.title | ||
192 | tr :: Markup2 | ||
193 | tr = wrapMarkup2 Text.Blaze.XHtml5.tr | ||
194 | ul :: Markup2 | ||
195 | ul = wrapMarkup2 Text.Blaze.XHtml5.ul | ||
196 | var :: Markup2 | ||
197 | var = wrapMarkup2 Text.Blaze.XHtml5.var | ||
198 | video :: Markup2 | ||
199 | video = wrapMarkup2 Text.Blaze.XHtml5.video | ||
200 | docType :: Markup | ||
201 | docType = wrapMarkup Text.Blaze.XHtml5.docType | ||
202 | area :: Markup | ||
203 | area = wrapMarkup Text.Blaze.XHtml5.area | ||
204 | base :: Markup | ||
205 | base = wrapMarkup Text.Blaze.XHtml5.base | ||
206 | br :: Markup | ||
207 | br = wrapMarkup Text.Blaze.XHtml5.br | ||
208 | col :: Markup | ||
209 | col = wrapMarkup Text.Blaze.XHtml5.col | ||
210 | embed :: Markup | ||
211 | embed = wrapMarkup Text.Blaze.XHtml5.embed | ||
212 | hr :: Markup | ||
213 | hr = wrapMarkup Text.Blaze.XHtml5.hr | ||
214 | img :: Markup | ||
215 | img = wrapMarkup Text.Blaze.XHtml5.img | ||
216 | input :: Markup | ||
217 | input = wrapMarkup Text.Blaze.XHtml5.input | ||
218 | keygen :: Markup | ||
219 | keygen = wrapMarkup Text.Blaze.XHtml5.keygen | ||
220 | link :: Markup | ||
221 | link = wrapMarkup Text.Blaze.XHtml5.link | ||
222 | menuitem :: Markup | ||
223 | menuitem = wrapMarkup Text.Blaze.XHtml5.menuitem | ||
224 | meta :: Markup | ||
225 | meta = wrapMarkup Text.Blaze.XHtml5.meta | ||
226 | param :: Markup | ||
227 | param = wrapMarkup Text.Blaze.XHtml5.param | ||
228 | source :: Markup | ||
229 | source = wrapMarkup Text.Blaze.XHtml5.source | ||
230 | track :: Markup | ||
231 | track = wrapMarkup Text.Blaze.XHtml5.track | ||
232 | wbr :: Markup | ||
233 | wbr = wrapMarkup Text.Blaze.XHtml5.wbr | ||
234 | |||
diff --git a/src/Text/BlazeT/XHtml5/Attributes.hs b/src/Text/BlazeT/XHtml5/Attributes.hs new file mode 100644 index 0000000..e878108 --- /dev/null +++ b/src/Text/BlazeT/XHtml5/Attributes.hs | |||
@@ -0,0 +1,11 @@ | |||
1 | -- !! DO NOT EDIT | ||
2 | {-| | ||
3 | (Automatically generated by @src\/Util\/GenerateHtmlTCombinators.hs:49@) | ||
4 | |||
5 | This module simply reexports the corresponding @blaze-html@ module. | ||
6 | -} | ||
7 | module Text.BlazeT.XHtml5.Attributes | ||
8 | (module Text.Blaze.XHtml5.Attributes | ||
9 | ) where | ||
10 | import Text.Blaze.XHtml5.Attributes | ||
11 | |||
diff --git a/src/Util/GenerateHtmlCombinators.hs b/src/Util/GenerateHtmlCombinators.hs new file mode 100644 index 0000000..83da65b --- /dev/null +++ b/src/Util/GenerateHtmlCombinators.hs | |||
@@ -0,0 +1,519 @@ | |||
1 | -- taken from https://github.com/jaspervdj/blaze-html/blob/2c4513e30ce768517b8d7b7b154d438f55217006/src/Util/GenerateHtmlCombinators.hs | ||
2 | |||
3 | -- Copyright Jasper Van der Jeugt 2010 | ||
4 | |||
5 | -- All rights reserved. | ||
6 | |||
7 | -- Redistribution and use in source and binary forms, with or without | ||
8 | -- modification, are permitted provided that the following conditions are met: | ||
9 | |||
10 | -- * Redistributions of source code must retain the above copyright | ||
11 | -- notice, this list of conditions and the following disclaimer. | ||
12 | |||
13 | -- * Redistributions in binary form must reproduce the above | ||
14 | -- copyright notice, this list of conditions and the following | ||
15 | -- disclaimer in the documentation and/or other materials provided | ||
16 | -- with the distribution. | ||
17 | |||
18 | -- * Neither the name of Jasper Van der Jeugt nor the names of other | ||
19 | -- contributors may be used to endorse or promote products derived | ||
20 | -- from this software without specific prior written permission. | ||
21 | |||
22 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
23 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
24 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
25 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
26 | -- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
27 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
28 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
29 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
30 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
31 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
32 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
33 | |||
34 | {-# LANGUAGE CPP #-} | ||
35 | |||
36 | #define DO_NOT_EDIT (doNotEdit __FILE__ __LINE__) | ||
37 | |||
38 | -- | Generates code for HTML tags. | ||
39 | -- | ||
40 | module Util.GenerateHtmlCombinators where | ||
41 | |||
42 | import Control.Arrow ((&&&)) | ||
43 | import Data.List (sort, sortBy, intersperse, intercalate) | ||
44 | import Data.Ord (comparing) | ||
45 | import System.Directory (createDirectoryIfMissing) | ||
46 | import System.FilePath ((</>), (<.>)) | ||
47 | import Data.Map (Map) | ||
48 | import qualified Data.Map as M | ||
49 | import Data.Char (toLower) | ||
50 | import qualified Data.Set as S | ||
51 | |||
52 | import Util.Sanitize (sanitize, prelude) | ||
53 | |||
54 | -- | Datatype for an HTML variant. | ||
55 | -- | ||
56 | data HtmlVariant = HtmlVariant | ||
57 | { version :: [String] | ||
58 | , docType :: [String] | ||
59 | , parents :: [String] | ||
60 | , leafs :: [String] | ||
61 | , attributes :: [String] | ||
62 | , selfClosing :: Bool | ||
63 | } deriving (Eq) | ||
64 | |||
65 | instance Show HtmlVariant where | ||
66 | show = map toLower . intercalate "-" . version | ||
67 | |||
68 | -- | Get the full module name for an HTML variant. | ||
69 | -- | ||
70 | getModuleName :: HtmlVariant -> String | ||
71 | getModuleName = ("Text.Blaze." ++) . intercalate "." . version | ||
72 | |||
73 | -- | Get the attribute module name for an HTML variant. | ||
74 | -- | ||
75 | getAttributeModuleName :: HtmlVariant -> String | ||
76 | getAttributeModuleName = (++ ".Attributes") . getModuleName | ||
77 | |||
78 | -- | Check if a given name causes a name clash. | ||
79 | -- | ||
80 | isNameClash :: HtmlVariant -> String -> Bool | ||
81 | isNameClash v t | ||
82 | -- Both an element and an attribute | ||
83 | | (t `elem` parents v || t `elem` leafs v) && t `elem` attributes v = True | ||
84 | -- Already a prelude function | ||
85 | | sanitize t `S.member` prelude = True | ||
86 | | otherwise = False | ||
87 | |||
88 | -- | Write an HTML variant. | ||
89 | -- | ||
90 | writeHtmlVariant :: HtmlVariant -> IO () | ||
91 | writeHtmlVariant htmlVariant = do | ||
92 | -- Make a directory. | ||
93 | createDirectoryIfMissing True basePath | ||
94 | |||
95 | let tags = zip parents' (repeat makeParent) | ||
96 | ++ zip leafs' (repeat (makeLeaf $ selfClosing htmlVariant)) | ||
97 | sortedTags = sortBy (comparing fst) tags | ||
98 | appliedTags = map (\(x, f) -> f x) sortedTags | ||
99 | |||
100 | -- Write the main module. | ||
101 | writeFile' (basePath <.> "hs") $ removeTrailingNewlines $ unlines | ||
102 | [ DO_NOT_EDIT | ||
103 | , "{-# LANGUAGE OverloadedStrings #-}" | ||
104 | , "-- | This module exports HTML combinators used to create documents." | ||
105 | , "--" | ||
106 | , exportList modulName $ "module Text.Blaze.Html" | ||
107 | : "docType" | ||
108 | : "docTypeHtml" | ||
109 | : map (sanitize . fst) sortedTags | ||
110 | , DO_NOT_EDIT | ||
111 | , "import Prelude ((>>), (.))" | ||
112 | , "" | ||
113 | , "import Text.Blaze" | ||
114 | , "import Text.Blaze.Internal" | ||
115 | , "import Text.Blaze.Html" | ||
116 | , "" | ||
117 | , makeDocType $ docType htmlVariant | ||
118 | , makeDocTypeHtml $ docType htmlVariant | ||
119 | , unlines appliedTags | ||
120 | ] | ||
121 | |||
122 | let sortedAttributes = sort attributes' | ||
123 | |||
124 | -- Write the attribute module. | ||
125 | writeFile' (basePath </> "Attributes.hs") $ removeTrailingNewlines $ unlines | ||
126 | [ DO_NOT_EDIT | ||
127 | , "-- | This module exports combinators that provide you with the" | ||
128 | , "-- ability to set attributes on HTML elements." | ||
129 | , "--" | ||
130 | , "{-# LANGUAGE OverloadedStrings #-}" | ||
131 | , exportList attributeModuleName $ map sanitize sortedAttributes | ||
132 | , DO_NOT_EDIT | ||
133 | , "import Prelude ()" | ||
134 | , "" | ||
135 | , "import Text.Blaze.Internal (Attribute, AttributeValue, attribute)" | ||
136 | , "" | ||
137 | , unlines (map makeAttribute sortedAttributes) | ||
138 | ] | ||
139 | where | ||
140 | basePath = "src" </> "Text" </> "Blaze" </> foldl1 (</>) version' | ||
141 | modulName = getModuleName htmlVariant | ||
142 | attributeModuleName = getAttributeModuleName htmlVariant | ||
143 | attributes' = attributes htmlVariant | ||
144 | parents' = parents htmlVariant | ||
145 | leafs' = leafs htmlVariant | ||
146 | version' = version htmlVariant | ||
147 | removeTrailingNewlines = reverse . drop 2 . reverse | ||
148 | writeFile' file content = do | ||
149 | putStrLn ("Generating " ++ file) | ||
150 | writeFile file content | ||
151 | |||
152 | -- | Create a string, consisting of @x@ spaces, where @x@ is the length of the | ||
153 | -- argument. | ||
154 | -- | ||
155 | spaces :: String -> String | ||
156 | spaces = flip replicate ' ' . length | ||
157 | |||
158 | -- | Join blocks of code with a newline in between. | ||
159 | -- | ||
160 | unblocks :: [String] -> String | ||
161 | unblocks = unlines . intersperse "\n" | ||
162 | |||
163 | -- | A warning to not edit the generated code. | ||
164 | -- | ||
165 | doNotEdit :: FilePath -> Int -> String | ||
166 | doNotEdit fileName lineNumber = init $ unlines | ||
167 | [ "-- WARNING: The next block of code was automatically generated by" | ||
168 | , "-- " ++ fileName ++ ":" ++ show lineNumber | ||
169 | , "--" | ||
170 | ] | ||
171 | |||
172 | -- | Generate an export list for a Haskell module. | ||
173 | -- | ||
174 | exportList :: String -- ^ Module name. | ||
175 | -> [String] -- ^ List of functions. | ||
176 | -> String -- ^ Resulting string. | ||
177 | exportList _ [] = error "exportList without functions." | ||
178 | exportList name (f:functions) = unlines $ | ||
179 | [ "module " ++ name | ||
180 | , " ( " ++ f | ||
181 | ] ++ | ||
182 | map (" , " ++) functions ++ | ||
183 | [ " ) where"] | ||
184 | |||
185 | -- | Generate a function for a doctype. | ||
186 | -- | ||
187 | makeDocType :: [String] -> String | ||
188 | makeDocType lines' = unlines | ||
189 | [ DO_NOT_EDIT | ||
190 | , "-- | Combinator for the document type. This should be placed at the top" | ||
191 | , "-- of every HTML page." | ||
192 | , "--" | ||
193 | , "-- Example:" | ||
194 | , "--" | ||
195 | , "-- > docType" | ||
196 | , "--" | ||
197 | , "-- Result:" | ||
198 | , "--" | ||
199 | , unlines (map ("-- > " ++) lines') ++ "--" | ||
200 | , "docType :: Html -- ^ The document type HTML." | ||
201 | , "docType = preEscapedText " ++ show (unlines lines') | ||
202 | , "{-# INLINE docType #-}" | ||
203 | ] | ||
204 | |||
205 | -- | Generate a function for the HTML tag (including the doctype). | ||
206 | -- | ||
207 | makeDocTypeHtml :: [String] -- ^ The doctype. | ||
208 | -> String -- ^ Resulting combinator function. | ||
209 | makeDocTypeHtml lines' = unlines | ||
210 | [ DO_NOT_EDIT | ||
211 | , "-- | Combinator for the @\\<html>@ element. This combinator will also" | ||
212 | , "-- insert the correct doctype." | ||
213 | , "--" | ||
214 | , "-- Example:" | ||
215 | , "--" | ||
216 | , "-- > docTypeHtml $ span $ toHtml \"foo\"" | ||
217 | , "--" | ||
218 | , "-- Result:" | ||
219 | , "--" | ||
220 | , unlines (map ("-- > " ++) lines') ++ "-- > <html><span>foo</span></html>" | ||
221 | , "--" | ||
222 | , "docTypeHtml :: Html -- ^ Inner HTML." | ||
223 | , " -> Html -- ^ Resulting HTML." | ||
224 | , "docTypeHtml inner = docType >> html inner" | ||
225 | , "{-# INLINE docTypeHtml #-}" | ||
226 | ] | ||
227 | |||
228 | -- | Generate a function for an HTML tag that can be a parent. | ||
229 | -- | ||
230 | makeParent :: String -> String | ||
231 | makeParent tag = unlines | ||
232 | [ DO_NOT_EDIT | ||
233 | , "-- | Combinator for the @\\<" ++ tag ++ ">@ element." | ||
234 | , "--" | ||
235 | , "-- Example:" | ||
236 | , "--" | ||
237 | , "-- > " ++ function ++ " $ span $ toHtml \"foo\"" | ||
238 | , "--" | ||
239 | , "-- Result:" | ||
240 | , "--" | ||
241 | , "-- > <" ++ tag ++ "><span>foo</span></" ++ tag ++ ">" | ||
242 | , "--" | ||
243 | , function ++ " :: Html -- ^ Inner HTML." | ||
244 | , spaces function ++ " -> Html -- ^ Resulting HTML." | ||
245 | , function ++ " = Parent \"" ++ tag ++ "\" \"<" ++ tag | ||
246 | ++ "\" \"</" ++ tag ++ ">\"" ++ modifier | ||
247 | , "{-# INLINE " ++ function ++ " #-}" | ||
248 | ] | ||
249 | where | ||
250 | function = sanitize tag | ||
251 | modifier = if tag `elem` ["style", "script"] then " . external" else "" | ||
252 | |||
253 | -- | Generate a function for an HTML tag that must be a leaf. | ||
254 | -- | ||
255 | makeLeaf :: Bool -- ^ Make leaf tags self-closing | ||
256 | -> String -- ^ Tag for the combinator | ||
257 | -> String -- ^ Combinator code | ||
258 | makeLeaf closing tag = unlines | ||
259 | [ DO_NOT_EDIT | ||
260 | , "-- | Combinator for the @\\<" ++ tag ++ " />@ element." | ||
261 | , "--" | ||
262 | , "-- Example:" | ||
263 | , "--" | ||
264 | , "-- > " ++ function | ||
265 | , "--" | ||
266 | , "-- Result:" | ||
267 | , "--" | ||
268 | , "-- > <" ++ tag ++ " />" | ||
269 | , "--" | ||
270 | , function ++ " :: Html -- ^ Resulting HTML." | ||
271 | , function ++ " = Leaf \"" ++ tag ++ "\" \"<" ++ tag ++ "\" " ++ "\"" | ||
272 | ++ (if closing then " /" else "") ++ ">\"" | ||
273 | , "{-# INLINE " ++ function ++ " #-}" | ||
274 | ] | ||
275 | where | ||
276 | function = sanitize tag | ||
277 | |||
278 | -- | Generate a function for an HTML attribute. | ||
279 | -- | ||
280 | makeAttribute :: String -> String | ||
281 | makeAttribute name = unlines | ||
282 | [ DO_NOT_EDIT | ||
283 | , "-- | Combinator for the @" ++ name ++ "@ attribute." | ||
284 | , "--" | ||
285 | , "-- Example:" | ||
286 | , "--" | ||
287 | , "-- > div ! " ++ function ++ " \"bar\" $ \"Hello.\"" | ||
288 | , "--" | ||
289 | , "-- Result:" | ||
290 | , "--" | ||
291 | , "-- > <div " ++ name ++ "=\"bar\">Hello.</div>" | ||
292 | , "--" | ||
293 | , function ++ " :: AttributeValue -- ^ Attribute value." | ||
294 | , spaces function ++ " -> Attribute -- ^ Resulting attribute." | ||
295 | , function ++ " = attribute \"" ++ name ++ "\" \" " | ||
296 | ++ name ++ "=\\\"\"" | ||
297 | , "{-# INLINE " ++ function ++ " #-}" | ||
298 | ] | ||
299 | where | ||
300 | function = sanitize name | ||
301 | |||
302 | -- | HTML 4.01 Strict. | ||
303 | -- A good reference can be found here: http://www.w3schools.com/tags/default.asp | ||
304 | -- | ||
305 | html4Strict :: HtmlVariant | ||
306 | html4Strict = HtmlVariant | ||
307 | { version = ["Html4", "Strict"] | ||
308 | , docType = | ||
309 | [ "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"" | ||
310 | , " \"http://www.w3.org/TR/html4/strict.dtd\">" | ||
311 | ] | ||
312 | , parents = | ||
313 | [ "a", "abbr", "acronym", "address", "b", "bdo", "big", "blockquote" | ||
314 | , "body" , "button", "caption", "cite", "code", "colgroup", "dd", "del" | ||
315 | , "dfn", "div" , "dl", "dt", "em", "fieldset", "form", "h1", "h2", "h3" | ||
316 | , "h4", "h5", "h6", "head", "html", "i", "ins" , "kbd", "label" | ||
317 | , "legend", "li", "map", "noscript", "object", "ol", "optgroup" | ||
318 | , "option", "p", "pre", "q", "samp", "script", "select", "small" | ||
319 | , "span", "strong", "style", "sub", "sup", "table", "tbody", "td" | ||
320 | , "textarea", "tfoot", "th", "thead", "title", "tr", "tt", "ul", "var" | ||
321 | ] | ||
322 | , leafs = | ||
323 | [ "area", "br", "col", "hr", "link", "img", "input", "meta", "param" | ||
324 | ] | ||
325 | , attributes = | ||
326 | [ "abbr", "accept", "accesskey", "action", "align", "alt", "archive" | ||
327 | , "axis", "border", "cellpadding", "cellspacing", "char", "charoff" | ||
328 | , "charset", "checked", "cite", "class", "classid", "codebase" | ||
329 | , "codetype", "cols", "colspan", "content", "coords", "data", "datetime" | ||
330 | , "declare", "defer", "dir", "disabled", "enctype", "for", "frame" | ||
331 | , "headers", "height", "href", "hreflang", "http-equiv", "id", "label" | ||
332 | , "lang", "maxlength", "media", "method", "multiple", "name", "nohref" | ||
333 | , "onabort", "onblur", "onchange", "onclick", "ondblclick", "onfocus" | ||
334 | , "onkeydown", "onkeypress", "onkeyup", "onload", "onmousedown" | ||
335 | , "onmousemove", "onmouseout", "onmouseover", "onmouseup", "onreset" | ||
336 | , "onselect", "onsubmit", "onunload", "profile", "readonly", "rel" | ||
337 | , "rev", "rows", "rowspan", "rules", "scheme", "scope", "selected" | ||
338 | , "shape", "size", "span", "src", "standby", "style", "summary" | ||
339 | , "tabindex", "title", "type", "usemap", "valign", "value", "valuetype" | ||
340 | , "width" | ||
341 | ] | ||
342 | , selfClosing = False | ||
343 | } | ||
344 | |||
345 | -- | HTML 4.0 Transitional | ||
346 | -- | ||
347 | html4Transitional :: HtmlVariant | ||
348 | html4Transitional = HtmlVariant | ||
349 | { version = ["Html4", "Transitional"] | ||
350 | , docType = | ||
351 | [ "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"" | ||
352 | , " \"http://www.w3.org/TR/html4/loose.dtd\">" | ||
353 | ] | ||
354 | , parents = parents html4Strict ++ | ||
355 | [ "applet", "center", "dir", "font", "iframe", "isindex", "menu" | ||
356 | , "noframes", "s", "u" | ||
357 | ] | ||
358 | , leafs = leafs html4Strict ++ ["basefont"] | ||
359 | , attributes = attributes html4Strict ++ | ||
360 | [ "background", "bgcolor", "clear", "compact", "hspace", "language" | ||
361 | , "noshade", "nowrap", "start", "target", "vspace" | ||
362 | ] | ||
363 | , selfClosing = False | ||
364 | } | ||
365 | |||
366 | -- | HTML 4.0 FrameSet | ||
367 | -- | ||
368 | html4FrameSet :: HtmlVariant | ||
369 | html4FrameSet = HtmlVariant | ||
370 | { version = ["Html4", "FrameSet"] | ||
371 | , docType = | ||
372 | [ "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 FrameSet//EN\"" | ||
373 | , " \"http://www.w3.org/TR/html4/frameset.dtd\">" | ||
374 | ] | ||
375 | , parents = parents html4Transitional ++ ["frameset"] | ||
376 | , leafs = leafs html4Transitional ++ ["frame"] | ||
377 | , attributes = attributes html4Transitional ++ | ||
378 | [ "frameborder", "scrolling" | ||
379 | ] | ||
380 | , selfClosing = False | ||
381 | } | ||
382 | |||
383 | -- | XHTML 1.0 Strict | ||
384 | -- | ||
385 | xhtml1Strict :: HtmlVariant | ||
386 | xhtml1Strict = HtmlVariant | ||
387 | { version = ["XHtml1", "Strict"] | ||
388 | , docType = | ||
389 | [ "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"" | ||
390 | , " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">" | ||
391 | ] | ||
392 | , parents = parents html4Strict | ||
393 | , leafs = leafs html4Strict | ||
394 | , attributes = attributes html4Strict | ||
395 | , selfClosing = True | ||
396 | } | ||
397 | |||
398 | -- | XHTML 1.0 Transitional | ||
399 | -- | ||
400 | xhtml1Transitional :: HtmlVariant | ||
401 | xhtml1Transitional = HtmlVariant | ||
402 | { version = ["XHtml1", "Transitional"] | ||
403 | , docType = | ||
404 | [ "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"" | ||
405 | , " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">" | ||
406 | ] | ||
407 | , parents = parents html4Transitional | ||
408 | , leafs = leafs html4Transitional | ||
409 | , attributes = attributes html4Transitional | ||
410 | , selfClosing = True | ||
411 | } | ||
412 | |||
413 | -- | XHTML 1.0 FrameSet | ||
414 | -- | ||
415 | xhtml1FrameSet :: HtmlVariant | ||
416 | xhtml1FrameSet = HtmlVariant | ||
417 | { version = ["XHtml1", "FrameSet"] | ||
418 | , docType = | ||
419 | [ "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 FrameSet//EN\"" | ||
420 | , " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">" | ||
421 | ] | ||
422 | , parents = parents html4FrameSet | ||
423 | , leafs = leafs html4FrameSet | ||
424 | , attributes = attributes html4FrameSet | ||
425 | , selfClosing = True | ||
426 | } | ||
427 | |||
428 | -- | HTML 5.0 | ||
429 | -- A good reference can be found here: | ||
430 | -- http://www.w3schools.com/html5/html5_reference.asp | ||
431 | -- | ||
432 | html5 :: HtmlVariant | ||
433 | html5 = HtmlVariant | ||
434 | { version = ["Html5"] | ||
435 | , docType = ["<!DOCTYPE HTML>"] | ||
436 | , parents = | ||
437 | [ "a", "abbr", "address", "article", "aside", "audio", "b" | ||
438 | , "bdo", "blockquote", "body", "button", "canvas", "caption", "cite" | ||
439 | , "code", "colgroup", "command", "datalist", "dd", "del", "details" | ||
440 | , "dfn", "div", "dl", "dt", "em", "fieldset", "figcaption", "figure" | ||
441 | , "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header" | ||
442 | , "hgroup", "html", "i", "iframe", "ins", "kbd", "label" | ||
443 | , "legend", "li", "main", "map", "mark", "menu", "meter", "nav" | ||
444 | , "noscript", "object", "ol", "optgroup", "option", "output", "p" | ||
445 | , "pre", "progress", "q", "rp", "rt", "ruby", "samp", "script" | ||
446 | , "section", "select", "small", "span", "strong", "style", "sub" | ||
447 | , "summary", "sup", "table", "tbody", "td", "textarea", "tfoot", "th" | ||
448 | , "thead", "time", "title", "tr", "ul", "var", "video" | ||
449 | ] | ||
450 | , leafs = | ||
451 | -- http://www.whatwg.org/specs/web-apps/current-work/multipage/syntax.html#void-elements | ||
452 | [ "area", "base", "br", "col", "embed", "hr", "img", "input", "keygen" | ||
453 | , "link", "menuitem", "meta", "param", "source", "track", "wbr" | ||
454 | ] | ||
455 | , attributes = | ||
456 | [ "accept", "accept-charset", "accesskey", "action", "alt", "async" | ||
457 | , "autocomplete", "autofocus", "autoplay", "challenge", "charset" | ||
458 | , "checked", "cite", "class", "cols", "colspan", "content" | ||
459 | , "contenteditable", "contextmenu", "controls", "coords", "data" | ||
460 | , "datetime", "defer", "dir", "disabled", "draggable", "enctype", "for" | ||
461 | , "form", "formaction", "formenctype", "formmethod", "formnovalidate" | ||
462 | , "formtarget", "headers", "height", "hidden", "high", "href" | ||
463 | , "hreflang", "http-equiv", "icon", "id", "ismap", "item", "itemprop" | ||
464 | , "itemscope", "itemtype" | ||
465 | , "keytype", "label", "lang", "list", "loop", "low", "manifest", "max" | ||
466 | , "maxlength", "media", "method", "min", "multiple", "name" | ||
467 | , "novalidate", "onbeforeonload", "onbeforeprint", "onblur", "oncanplay" | ||
468 | , "oncanplaythrough", "onchange", "oncontextmenu", "onclick" | ||
469 | , "ondblclick", "ondrag", "ondragend", "ondragenter", "ondragleave" | ||
470 | , "ondragover", "ondragstart", "ondrop", "ondurationchange", "onemptied" | ||
471 | , "onended", "onerror", "onfocus", "onformchange", "onforminput" | ||
472 | , "onhaschange", "oninput", "oninvalid", "onkeydown", "onkeyup" | ||
473 | , "onload", "onloadeddata", "onloadedmetadata", "onloadstart" | ||
474 | , "onmessage", "onmousedown", "onmousemove", "onmouseout", "onmouseover" | ||
475 | , "onmouseup", "onmousewheel", "ononline", "onpagehide", "onpageshow" | ||
476 | , "onpause", "onplay", "onplaying", "onprogress", "onpropstate" | ||
477 | , "onratechange", "onreadystatechange", "onredo", "onresize", "onscroll" | ||
478 | , "onseeked", "onseeking", "onselect", "onstalled", "onstorage" | ||
479 | , "onsubmit", "onsuspend", "ontimeupdate", "onundo", "onunload" | ||
480 | , "onvolumechange", "onwaiting", "open", "optimum", "pattern", "ping" | ||
481 | , "placeholder", "preload", "pubdate", "radiogroup", "readonly", "rel" | ||
482 | , "required", "reversed", "rows", "rowspan", "sandbox", "scope" | ||
483 | , "scoped", "seamless", "selected", "shape", "size", "sizes", "span" | ||
484 | , "spellcheck", "src", "srcdoc", "start", "step", "style", "subject" | ||
485 | , "summary", "tabindex", "target", "title", "type", "usemap", "value" | ||
486 | , "width", "wrap", "xmlns" | ||
487 | ] | ||
488 | , selfClosing = False | ||
489 | } | ||
490 | |||
491 | -- | XHTML 5.0 | ||
492 | -- | ||
493 | xhtml5 :: HtmlVariant | ||
494 | xhtml5 = HtmlVariant | ||
495 | { version = ["XHtml5"] | ||
496 | , docType = ["<!DOCTYPE HTML>"] | ||
497 | , parents = parents html5 | ||
498 | , leafs = leafs html5 | ||
499 | , attributes = attributes html5 | ||
500 | , selfClosing = True | ||
501 | } | ||
502 | |||
503 | |||
504 | -- | A map of HTML variants, per version, lowercase. | ||
505 | -- | ||
506 | htmlVariants :: Map String HtmlVariant | ||
507 | htmlVariants = M.fromList $ map (show &&& id) | ||
508 | [ html4Strict | ||
509 | , html4Transitional | ||
510 | , html4FrameSet | ||
511 | , xhtml1Strict | ||
512 | , xhtml1Transitional | ||
513 | , xhtml1FrameSet | ||
514 | , html5 | ||
515 | , xhtml5 | ||
516 | ] | ||
517 | |||
518 | main :: IO () | ||
519 | main = mapM_ (writeHtmlVariant . snd) $ M.toList htmlVariants | ||
diff --git a/src/Util/GenerateHtmlTCombinators.hs b/src/Util/GenerateHtmlTCombinators.hs new file mode 100755 index 0000000..0dd5444 --- /dev/null +++ b/src/Util/GenerateHtmlTCombinators.hs | |||
@@ -0,0 +1,62 @@ | |||
1 | {-# LANGUAGE CPP #-} | ||
2 | |||
3 | module Util.GenerateHtmlTCombinators where | ||
4 | |||
5 | import Control.Applicative | ||
6 | import Data.List | ||
7 | import Language.Haskell.TH | ||
8 | import System.Directory | ||
9 | import System.FilePath | ||
10 | import Text.Printf | ||
11 | import Text.Regex | ||
12 | import Text.Regex.TDFA | ||
13 | import Util.GenerateHtmlCombinators hiding (getModuleName, main) | ||
14 | |||
15 | declare :: HtmlVariant -> [Dec] | ||
16 | declare x = concatMap (\(w,ls) -> concatMap (g w) ls) | ||
17 | [(("wrapMarkup2","Markup2"),"docTypeHtml" : parents x) | ||
18 | ,(("wrapMarkup","Markup"), "docType" : leafs x)] | ||
19 | where g (w',t') l' = | ||
20 | [SigD l $ ConT t | ||
21 | ,ValD (VarP l) (NormalB (AppE (VarE w) | ||
22 | $ VarE $ mkName $ getModuleName "Blaze" x ++"."++l')) []] | ||
23 | where [w,t,l] = fmap mkName [w',t',l'] | ||
24 | |||
25 | |||
26 | |||
27 | writeSource :: HtmlVariant -> IO () | ||
28 | writeSource v = mapM_ g [True, False] | ||
29 | where | ||
30 | g attr = do | ||
31 | let path = if attr then "Attributes" else "" | ||
32 | name = (if attr then "." else "") ++ path | ||
33 | [mT,m] = ((++ name) . flip getModuleName v) <$> | ||
34 | ["BlazeT","Blaze"] | ||
35 | exports = if attr then [m] else [mT, "Text.BlazeT.Html"] | ||
36 | f = (joinPath $ ["src","Text","BlazeT"] ++ version v | ||
37 | ++ [path]) <.> "hs" | ||
38 | body = if attr then "" else unlines $ | ||
39 | map (printf "import Text.BlazeT%s") ["", ".Html", ".Internal"] | ||
40 | ++ ["", show ( ppr_list $ declare v)] | ||
41 | quali = if attr then "" else "qualified " | ||
42 | docs True = "This module simply reexports the corresponding @blaze-html@ module." | ||
43 | docs False = printf "This module wraps all exports of \"%s\" using 'wrapMarkup' and 'wrapMarkup'." m | ||
44 | createDirectoryIfMissing True $ takeDirectory $ f | ||
45 | writeFile f $ unlines $ | ||
46 | ["-- !! DO NOT EDIT" | ||
47 | ,"{-|" | ||
48 | ,printf "(Automatically generated by @%s:%d@)\n" | ||
49 | (subRegex (mkRegex "/") __FILE__ "\\\\/") ( __LINE__ :: Int) | ||
50 | ,docs attr | ||
51 | ,"-}" | ||
52 | ,"module "++ mT | ||
53 | ," (" ++ intercalate "\n ," (map ("module "++) exports) | ||
54 | ," ) where" | ||
55 | ,"import "++ quali ++ m | ||
56 | , body] | ||
57 | |||
58 | main = mapM_ writeSource htmlVariants | ||
59 | |||
60 | |||
61 | getModuleName :: String -> HtmlVariant -> String | ||
62 | getModuleName base = (("Text."++base++".")++) . intercalate "." . version | ||
diff --git a/src/Util/Sanitize.hs b/src/Util/Sanitize.hs new file mode 100644 index 0000000..112bae1 --- /dev/null +++ b/src/Util/Sanitize.hs | |||
@@ -0,0 +1,112 @@ | |||
1 | -- taken from https://github.com/jaspervdj/blaze-html/blob/2c4513e30ce768517b8d7b7b154d438f55217006/src/Util/Sanitize.hs | ||
2 | |||
3 | -- Copyright Jasper Van der Jeugt 2010 | ||
4 | |||
5 | -- All rights reserved. | ||
6 | |||
7 | -- Redistribution and use in source and binary forms, with or without | ||
8 | -- modification, are permitted provided that the following conditions are met: | ||
9 | |||
10 | -- * Redistributions of source code must retain the above copyright | ||
11 | -- notice, this list of conditions and the following disclaimer. | ||
12 | |||
13 | -- * Redistributions in binary form must reproduce the above | ||
14 | -- copyright notice, this list of conditions and the following | ||
15 | -- disclaimer in the documentation and/or other materials provided | ||
16 | -- with the distribution. | ||
17 | |||
18 | -- * Neither the name of Jasper Van der Jeugt nor the names of other | ||
19 | -- contributors may be used to endorse or promote products derived | ||
20 | -- from this software without specific prior written permission. | ||
21 | |||
22 | -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
23 | -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
24 | -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
25 | -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
26 | -- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
27 | -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
28 | -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
29 | -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
30 | -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
31 | -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
32 | -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
33 | -- | A program to sanitize an HTML tag to a Haskell function. | ||
34 | -- | ||
35 | module Util.Sanitize | ||
36 | ( sanitize | ||
37 | , keywords | ||
38 | , prelude | ||
39 | ) where | ||
40 | |||
41 | import Data.Char (toLower, toUpper) | ||
42 | import Data.Set (Set) | ||
43 | import qualified Data.Set as S | ||
44 | |||
45 | -- | Sanitize a tag. This function returns a name that can be used as | ||
46 | -- combinator in haskell source code. | ||
47 | -- | ||
48 | -- Examples: | ||
49 | -- | ||
50 | -- > sanitize "class" == "class_" | ||
51 | -- > sanitize "http-equiv" == "httpEquiv" | ||
52 | -- | ||
53 | sanitize :: String -> String | ||
54 | sanitize str | ||
55 | | lower == "doctypehtml" = "docTypeHtml" | ||
56 | | otherwise = appendUnderscore $ removeDash lower | ||
57 | where | ||
58 | lower = map toLower str | ||
59 | |||
60 | -- Remove a dash, replacing it by camelcase notation | ||
61 | -- | ||
62 | -- Example: | ||
63 | -- | ||
64 | -- > removeDash "foo-bar" == "fooBar" | ||
65 | -- | ||
66 | removeDash ('-' : x : xs) = toUpper x : removeDash xs | ||
67 | removeDash (x : xs) = x : removeDash xs | ||
68 | removeDash [] = [] | ||
69 | |||
70 | appendUnderscore t | t `S.member` keywords = t ++ "_" | ||
71 | | otherwise = t | ||
72 | |||
73 | -- | A set of standard Haskell keywords, which cannot be used as combinators. | ||
74 | -- | ||
75 | keywords :: Set String | ||
76 | keywords = S.fromList | ||
77 | [ "case", "class", "data", "default", "deriving", "do", "else", "if" | ||
78 | , "import", "in", "infix", "infixl", "infixr", "instance" , "let", "module" | ||
79 | , "newtype", "of", "then", "type", "where" | ||
80 | ] | ||
81 | |||
82 | -- | Set of functions from the Prelude, which we do not use as combinators. | ||
83 | -- | ||
84 | prelude :: Set String | ||
85 | prelude = S.fromList | ||
86 | [ "abs", "acos", "acosh", "all", "and", "any", "appendFile", "asTypeOf" | ||
87 | , "asin", "asinh", "atan", "atan2", "atanh", "break", "catch", "ceiling" | ||
88 | , "compare", "concat", "concatMap", "const", "cos", "cosh", "curry", "cycle" | ||
89 | , "decodeFloat", "div", "divMod", "drop", "dropWhile", "either", "elem" | ||
90 | , "encodeFloat", "enumFrom", "enumFromThen", "enumFromThenTo", "enumFromTo" | ||
91 | , "error", "even", "exp", "exponent", "fail", "filter", "flip" | ||
92 | , "floatDigits", "floatRadix", "floatRange", "floor", "fmap", "foldl" | ||
93 | , "foldl1", "foldr", "foldr1", "fromEnum", "fromInteger", "fromIntegral" | ||
94 | , "fromRational", "fst", "gcd", "getChar", "getContents", "getLine", "head" | ||
95 | , "id", "init", "interact", "ioError", "isDenormalized", "isIEEE" | ||
96 | , "isInfinite", "isNaN", "isNegativeZero", "iterate", "last", "lcm" | ||
97 | , "length", "lex", "lines", "log", "logBase", "lookup", "map", "mapM" | ||
98 | , "mapM_", "max", "maxBound", "maximum", "maybe", "min", "minBound" | ||
99 | , "minimum", "mod", "negate", "not", "notElem", "null", "odd", "or" | ||
100 | , "otherwise", "pi", "pred", "print", "product", "properFraction", "putChar" | ||
101 | , "putStr", "putStrLn", "quot", "quotRem", "read", "readFile", "readIO" | ||
102 | , "readList", "readLn", "readParen", "reads", "readsPrec", "realToFrac" | ||
103 | , "recip", "rem", "repeat", "replicate", "return", "reverse", "round" | ||
104 | , "scaleFloat", "scanl", "scanl1", "scanr", "scanr1", "seq", "sequence" | ||
105 | , "sequence_", "show", "showChar", "showList", "showParen", "showString" | ||
106 | , "shows", "showsPrec", "significand", "signum", "sin", "sinh", "snd" | ||
107 | , "span", "splitAt", "sqrt", "subtract", "succ", "sum", "tail", "take" | ||
108 | , "takeWhile", "tan", "tanh", "toEnum", "toInteger", "toRational" | ||
109 | , "truncate", "uncurry", "undefined", "unlines", "until", "unwords", "unzip" | ||
110 | , "unzip3", "userError", "words", "writeFile", "zip", "zip3", "zipWith" | ||
111 | , "zipWith3" | ||
112 | ] | ||