lucid-svg (empty) → 0.1.0.0
raw patch · 8 files changed
+1729/−0 lines, 8 filesdep +basedep +luciddep +textsetup-changed
Dependencies added: base, lucid, text, transformers
Files
- LICENSE +30/−0
- README.md +27/−0
- Setup.hs +2/−0
- lucid-svg.cabal +30/−0
- src/Lucid/Svg.hs +118/−0
- src/Lucid/Svg/Attributes.hs +1062/−0
- src/Lucid/Svg/Elements.hs +346/−0
- src/Lucid/Svg/Path.hs +114/−0
+ LICENSE view
@@ -0,0 +1,30 @@+Copyright (c) 2015, Jeffrey Rosenbluth++All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are met:++ * Redistributions of source code must retain the above copyright+ notice, this list of conditions and the following disclaimer.++ * Redistributions in binary form must reproduce the above+ copyright notice, this list of conditions and the following+ disclaimer in the documentation and/or other materials provided+ with the distribution.++ * Neither the name of Jeffrey Rosenbluth nor the names of other+ contributors may be used to endorse or promote products derived+ from this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ README.md view
@@ -0,0 +1,27 @@+# lucid-svg++Simple DSL for writing SVG, base on lucid++## Example++``` haskell+import Lucid.Svg+ +svg :: Svg () -> Svg ()+svg content = do+ doctype_+ with (svg11_ content) [version_ "1.1", width_ "300" , height_ "200"]++contents :: Svg ()+contents = do+ rect_ [width_ "100%", height_ "100%", fill_ "red"]+ circle_ [cx_ "150", cy_ "100", r_ "80", fill_ "green"]+ text_ [x_ "150", y_ "125", fontSize_ "60", textAnchor_ "middle", fill_ "white"] "SVG"+++main :: IO ()+main = do+ print $ svg contents+```++
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ lucid-svg.cabal view
@@ -0,0 +1,30 @@+-- Initial lucid-svg.cabal generated by cabal init. For further +-- documentation, see http://haskell.org/cabal/users-guide/++name: lucid-svg+version: 0.1.0.0+synopsis: DSL for SVG using lucid for HTML+-- description: +homepage: http://github.com/jeffreyrosenbluth/lucid-svg.git+license: BSD3+license-file: LICENSE+author: Jeffrey Rosenbluth+maintainer: jeffrey.rosenbluth@gmail.com+copyright: 2015 Jeffrey Rosenbluth+category: Graphics+build-type: Simple+extra-source-files: README.md+cabal-version: >=1.10++library+ ghc-options: -Wall -rtsopts -O2+ exposed-modules: Lucid.Svg,+ Lucid.Svg.Path,+ Lucid.Svg.Elements,+ Lucid.Svg.Attributes+ build-depends: base >=4.7 && <4.8,+ transformers,+ text,+ lucid >=2.6 && <2.7+ hs-source-dirs: src+ default-language: Haskell2010
+ src/Lucid/Svg.hs view
@@ -0,0 +1,118 @@+{-# OPTIONS -fno-warn-unused-imports #-}++module Lucid.Svg+ ( -- * Intro+ -- $intro+ -- * Types+ Svg+ -- * Re-exports+ , module Lucid.Svg.Path+ , module Lucid.Svg.Elements+ , module Lucid.Svg.Attributes+ -- * From Lucid.Base+ , renderText+ , renderBS+ , renderTextT+ , renderBST+ , renderToFile+ -- ** Running+ -- $running+ , execHtmlT+ , evalHtmlT+ , runHtmlT+ -- ** Types+ , Attribute+ -- ** Classes+ -- $overloaded+ , Term(..)+ , ToHtml(..)+ , With(..)+ ) where++import Data.Functor.Identity+import Lucid.Base+import qualified Lucid.Svg.Attributes as A+import Lucid.Svg.Attributes hiding (colorProfile_, cursor_, filter_, path_, style_)+import Lucid.Svg.Elements+import Lucid.Svg.Path++type Svg = SvgT Identity++-- $intro+--+-- SVG elements and attributes in Lucid-Svg are written with a postfix ‘@_@’. +-- Some examples:+--+-- 'path_', 'circle_', 'color_', 'scale_'+--+-- Note: If you're testing in the REPL you need to add a type annotation to+-- indicate that you want SVG. In normal code your top-level+-- declaration signatures handle that.+--+-- Plain text is written using the @OverloadedStrings@ and+-- @ExtendedDefaultRules@ extensions, and is automatically escaped: +--+-- As in Lucid, elements nest by function application:+--+-- >>> g_ (text_ "Hello SVG") :: Svg ()+-- <g><text>Hello SVG</text></g>+--+-- and elements are juxtaposed via monoidal append or monadic sequencing:+--+-- >>> text_ "Hello" <> text_ "SVG" :: Svg ()+-- <text>Hello</text><text>SVG</text>+--+-- >>> do text_ "Hello"; text_ "SVG" :: Svg ()+-- <text>Hello</text><text>SVG</text>+--+-- Attributes are set by providing an argument list. In contrast to HTML+-- many SVG elements have no content, only attributes.+--+-- >>> rect_ [width_ "100%", height_ "100%", fill_ "red"] :: Svg ()+-- <rect height="100%" width="100%" fill="red"></rect>+--+-- Attributes and elements that share the same name are not conflicting+-- unless they appear on the list in the note below:+--+-- >>> mask_ [mask_ "attribute"] "element" :: Svg ()+-- <mask mask="attribute">element</mask>+--+-- Note: The following element and attribute names overlap and cannot be+-- handled polymorphically since doing so would create conflicting functional+-- dependencies. The unqualifed name refers to the element.+-- We qualify the attribute name as @A@. For example, 'path_' and 'A.path_'.+-- +-- 'colorProfile_', 'cursor_', 'filter_', 'path_', and 'style_'+--+-- Path data can be constructed using the functions in 'Lucid.Svg.Path'+-- and combined monoidally:+--+-- @+-- path_ (+-- [ d_ (mA "10" "80" <> qA "52.5" "10" "95" "80" <> tA "180" "80" <> z)+-- , stroke_ "blue"+-- , fill_ "orange"+-- ])+-- @+-- > <path d="M 10,80 Q 52.5,10 95,80 T 180,80 Z" stroke="blue" fill="orange"></path>+--+-- __A slightly longer example__:+-- +-- > import Lucid.Svg+-- > +-- > svg :: Svg () -> Svg ()+-- > svg content = do+-- > doctype_+-- > with (svg11_ content) [version_ "1.1", width_ "300" , height_ "200"]+-- > +-- > contents :: Svg ()+-- > contents = do+-- > rect_ [width_ "100%", height_ "100%", fill_ "red"]+-- > circle_ [cx_ "150", cy_ "100", r_ "80", fill_ "green"]+-- > text_ [x_ "150", y_ "125", fontSize_ "60", textAnchor_ "middle", fill_ "white"] "SVG"+-- > +-- > +-- > main :: IO ()+-- > main = do+-- > print $ svg contents+-- <<http://i.imgur.com/dXu84xR.png>>
+ src/Lucid/Svg/Attributes.hs view
@@ -0,0 +1,1062 @@+{-# LANGUAGE OverloadedStrings #-}++module Lucid.Svg.Attributes where ++import Lucid.Base+import Data.Text (Text)++-- | The @accentHeight@ attribute.+accentHeight_ :: Text -> Attribute+accentHeight_ = makeAttribute "accent-height"++-- | The @accumulate@ attribute.+accumulate_ :: Text -> Attribute+accumulate_ = makeAttribute "accumulate"++-- | The @additive@ attribute.+additive_ :: Text -> Attribute+additive_ = makeAttribute "additive"++-- | The @alignmentBaseline@ attribute.+alignmentBaseline_ :: Text -> Attribute+alignmentBaseline_ = makeAttribute "alignment-baseline"++-- | The @alphabetic@ attribute.+alphabetic_ :: Text -> Attribute+alphabetic_ = makeAttribute "alphabetic"++-- | The @amplitude@ attribute.+amplitude_ :: Text -> Attribute+amplitude_ = makeAttribute "amplitude"++-- | The @arabicForm@ attribute.+arabicForm_ :: Text -> Attribute+arabicForm_ = makeAttribute "arabic-form"++-- | The @ascent@ attribute.+ascent_ :: Text -> Attribute+ascent_ = makeAttribute "ascent"++-- | The @attributename@ attribute.+attributeName_ :: Text -> Attribute+attributeName_ = makeAttribute "attributeName"++-- | The @attributetype@ attribute.+attributeType_ :: Text -> Attribute+attributeType_ = makeAttribute "attributeType"++-- | The @azimuth@ attribute.+azimuth_ :: Text -> Attribute+azimuth_ = makeAttribute "azimuth"++-- | The @basefrequency@ attribute.+baseFrequency_ :: Text -> Attribute+baseFrequency_ = makeAttribute "baseFrequency"++-- | The @baseprofile@ attribute.+baseprofile_ :: Text -> Attribute+baseprofile_ = makeAttribute "baseprofile"++-- | The @baselineShift@ attribute.+baselineShift_ :: Text -> Attribute+baselineShift_ = makeAttribute "baseline-shift"++-- | The @bbox@ attribute.+bbox_ :: Text -> Attribute+bbox_ = makeAttribute "bbox"++-- | The @begin@ attribute.+begin_ :: Text -> Attribute+begin_ = makeAttribute "begin"++-- | The @bias@ attribute.+bias_ :: Text -> Attribute+bias_ = makeAttribute "bias"++-- | The @by@ attribute.+by_ :: Text -> Attribute+by_ = makeAttribute "by"++-- | The @calcmode@ attribute.+calcMode_ :: Text -> Attribute+calcMode_ = makeAttribute "calcMode"++-- | The @capHeight@ attribute.+capHeight_ :: Text -> Attribute+capHeight_ = makeAttribute "cap-height"++-- | The @class@ attribute.+class_ :: Text -> Attribute+class_ = makeAttribute "class"++-- | The @clip@ attribute.+clip_ :: Text -> Attribute+clip_ = makeAttribute "clip"++-- | The @clipPath@ attribute.+clipPath_ :: Text -> Attribute+clipPath_ = makeAttribute "clip-path"++-- | The @clipRule@ attribute.+clipRule_ :: Text -> Attribute+clipRule_ = makeAttribute "clip-rule"++-- | The @clippathunits@ attribute.+clipPathUnits_ :: Text -> Attribute+clipPathUnits_ = makeAttribute "clipPathUnits"++-- | The @color@ attribute.+color_ :: Text -> Attribute+color_ = makeAttribute "color"++-- | The @colorInterpolation@ attribute.+colorInterpolation_ :: Text -> Attribute+colorInterpolation_ = makeAttribute "color-interpolation"++-- | The @colorInterpolationFilters@ attribute.+colorInterpolationFilters_ :: Text -> Attribute+colorInterpolationFilters_ = makeAttribute "color-interpolation-filters"++-- | The @colorProfile@ attribute.+colorProfile_ :: Text -> Attribute+colorProfile_ = makeAttribute "color-profile"++-- | The @colorRendering@ attribute.+colorRendering_ :: Text -> Attribute+colorRendering_ = makeAttribute "color-rendering"++-- | The @contentscripttype@ attribute.+contentScriptType_ :: Text -> Attribute+contentScriptType_ = makeAttribute "contentScriptType"++-- | The @contentstyletype@ attribute.+contentStyleType_ :: Text -> Attribute+contentStyleType_ = makeAttribute "contentStyleType"++-- | The @cursor@ attribute.+cursor_ :: Text -> Attribute+cursor_ = makeAttribute "cursor"++-- | The @cx@ attribute.+cx_ :: Text -> Attribute+cx_ = makeAttribute "cx"++-- | The @cy@ attribute.+cy_ :: Text -> Attribute+cy_ = makeAttribute "cy"++-- | The @d@ attribute.+d_ :: Text -> Attribute+d_ = makeAttribute "d"++-- | The @descent@ attribute.+descent_ :: Text -> Attribute+descent_ = makeAttribute "descent"++-- | The @diffuseconstant@ attribute.+diffuseConstant_ :: Text -> Attribute+diffuseConstant_ = makeAttribute "diffuseConstant"++-- | The @direction@ attribute.+direction_ :: Text -> Attribute+direction_ = makeAttribute "direction"++-- | The @display@ attribute.+display_ :: Text -> Attribute+display_ = makeAttribute "display"++-- | The @divisor@ attribute.+divisor_ :: Text -> Attribute+divisor_ = makeAttribute "divisor"++-- | The @dominantBaseline@ attribute.+dominantBaseline_ :: Text -> Attribute+dominantBaseline_ = makeAttribute "dominant-baseline"++-- | The @dur@ attribute.+dur_ :: Text -> Attribute+dur_ = makeAttribute "dur"++-- | The @dx@ attribute.+dx_ :: Text -> Attribute+dx_ = makeAttribute "dx"++-- | The @dy@ attribute.+dy_ :: Text -> Attribute+dy_ = makeAttribute "dy"++-- | The @edgemode@ attribute.+edgeMode_ :: Text -> Attribute+edgeMode_ = makeAttribute "edgeMode"++-- | The @elevation@ attribute.+elevation_ :: Text -> Attribute+elevation_ = makeAttribute "elevation"++-- | The @enableBackground@ attribute.+enableBackground_ :: Text -> Attribute+enableBackground_ = makeAttribute "enable-background"++-- | The @end@ attribute.+end_ :: Text -> Attribute+end_ = makeAttribute "end"++-- | The @exponent@ attribute.+exponent_ :: Text -> Attribute+exponent_ = makeAttribute "exponent"++-- | The @externalresourcesrequired@ attribute.+externalResourcesRequired_ :: Text -> Attribute+externalResourcesRequired_ = makeAttribute "externalResourcesRequired"++-- | The @fill@ attribute.+fill_ :: Text -> Attribute+fill_ = makeAttribute "fill"++-- | The @fillOpacity@ attribute.+fillOpacity_ :: Text -> Attribute+fillOpacity_ = makeAttribute "fill-opacity"++-- | The @fillRule@ attribute.+fillRule_ :: Text -> Attribute+fillRule_ = makeAttribute "fill-rule"++-- | The @filter@ attribute.+filter_ :: Text -> Attribute+filter_ = makeAttribute "filter"++-- | The @filterres@ attribute.+filterRes_ :: Text -> Attribute+filterRes_ = makeAttribute "filterRes"++-- | The @filterunits@ attribute.+filterUnits_ :: Text -> Attribute+filterUnits_ = makeAttribute "filterUnits"++-- | The @floodColor@ attribute.+floodColor_ :: Text -> Attribute+floodColor_ = makeAttribute "flood-color"++-- | The @floodOpacity@ attribute.+floodOpacity_ :: Text -> Attribute+floodOpacity_ = makeAttribute "flood-opacity"++-- | The @fontFamily@ attribute.+fontFamily_ :: Text -> Attribute+fontFamily_ = makeAttribute "font-family"++-- | The @fontSize@ attribute.+fontSize_ :: Text -> Attribute+fontSize_ = makeAttribute "font-size"++-- | The @fontSizeAdjust@ attribute.+fontSizeAdjust_ :: Text -> Attribute+fontSizeAdjust_ = makeAttribute "font-size-adjust"++-- | The @fontStretch@ attribute.+fontStretch_ :: Text -> Attribute+fontStretch_ = makeAttribute "font-stretch"++-- | The @fontStyle@ attribute.+fontStyle_ :: Text -> Attribute+fontStyle_ = makeAttribute "font-style"++-- | The @fontVariant@ attribute.+fontVariant_ :: Text -> Attribute+fontVariant_ = makeAttribute "font-variant"++-- | The @fontWeight@ attribute.+fontWeight_ :: Text -> Attribute+fontWeight_ = makeAttribute "font-weight"++-- | The @format@ attribute.+format_ :: Text -> Attribute+format_ = makeAttribute "format"++-- | The @from@ attribute.+from_ :: Text -> Attribute+from_ = makeAttribute "from"++-- | The @fx@ attribute.+fx_ :: Text -> Attribute+fx_ = makeAttribute "fx"++-- | The @fy@ attribute.+fy_ :: Text -> Attribute+fy_ = makeAttribute "fy"++-- | The @g1@ attribute.+g1_ :: Text -> Attribute+g1_ = makeAttribute "g1"++-- | The @g2@ attribute.+g2_ :: Text -> Attribute+g2_ = makeAttribute "g2"++-- | The @glyphName@ attribute.+glyphName_ :: Text -> Attribute+glyphName_ = makeAttribute "glyph-name"++-- | The @glyphOrientationHorizontal@ attribute.+glyphOrientationHorizontal_ :: Text -> Attribute+glyphOrientationHorizontal_ = makeAttribute "glyph-orientation-horizontal"++-- | The @glyphOrientationVertical@ attribute.+glyphOrientationVertical_ :: Text -> Attribute+glyphOrientationVertical_ = makeAttribute "glyph-orientation-vertical"++-- | The @-- | The @gradienttransform@ attribute.+gradientTransform_ :: Text -> Attribute+gradientTransform_ = makeAttribute "gradientTransform"++-- | The @gradientunits@ attribute.+gradientUnits_ :: Text -> Attribute+gradientUnits_ = makeAttribute "gradientUnits"++-- | The @hanging@ attribute.+hanging_ :: Text -> Attribute+hanging_ = makeAttribute "hanging"++-- | The @height@ attribute.+height_ :: Text -> Attribute+height_ = makeAttribute "height"++-- | The @horizAdvX@ attribute.+horizAdvX_ :: Text -> Attribute+horizAdvX_ = makeAttribute "horiz-adv-x"++-- | The @horizOriginX@ attribute.+horizOriginX_ :: Text -> Attribute+horizOriginX_ = makeAttribute "horiz-origin-x"++-- | The @horizOriginY@ attribute.+horizOriginY_ :: Text -> Attribute+horizOriginY_ = makeAttribute "horiz-origin-y"++-- | The @id@ attribute.+id_ :: Text -> Attribute+id_ = makeAttribute "id"++-- | The @ideographic@ attribute.+ideographic_ :: Text -> Attribute+ideographic_ = makeAttribute "ideographic"++-- | The @imageRendering@ attribute.+imageRendering_ :: Text -> Attribute+imageRendering_ = makeAttribute "image-rendering"++-- | The @in@ attribute.+in_ :: Text -> Attribute+in_ = makeAttribute "in"++-- | The @in2@ attribute.+in2_ :: Text -> Attribute+in2_ = makeAttribute "in2"++-- | The @intercept@ attribute.+intercept_ :: Text -> Attribute+intercept_ = makeAttribute "intercept"++-- | The @k@ attribute.+k_ :: Text -> Attribute+k_ = makeAttribute "k"++-- | The @k1@ attribute.+k1_ :: Text -> Attribute+k1_ = makeAttribute "k1"++-- | The @k2@ attribute.+k2_ :: Text -> Attribute+k2_ = makeAttribute "k2"++-- | The @k3@ attribute.+k3_ :: Text -> Attribute+k3_ = makeAttribute "k3"++-- | The @k4@ attribute.+k4_ :: Text -> Attribute+k4_ = makeAttribute "k4"++-- | The @kernelmatrix@ attribute.+kernelMatrix_ :: Text -> Attribute+kernelMatrix_ = makeAttribute "kernelMatrix"++-- | The @kernelunitlength@ attribute.+kernelUnitLength_ :: Text -> Attribute+kernelUnitLength_ = makeAttribute "kernelUnitLength"++-- | The @kerning@ attribute.+kerning_ :: Text -> Attribute+kerning_ = makeAttribute "kerning"++-- | The @keypoints@ attribute.+keyPoints_ :: Text -> Attribute+keyPoints_ = makeAttribute "keyPoints"++-- | The @keysplines@ attribute.+keySplines_ :: Text -> Attribute+keySplines_ = makeAttribute "keySplines"++-- | The @keytimes@ attribute.+keyTimes_ :: Text -> Attribute+keyTimes_ = makeAttribute "keyTimes"++-- | The @lang@ attribute.+lang_ :: Text -> Attribute+lang_ = makeAttribute "lang"++-- | The @lengthadjust@ attribute.+lengthAdjust_ :: Text -> Attribute+lengthAdjust_ = makeAttribute "lengthAdjust"++-- | The @letterSpacing@ attribute.+letterSpacing_ :: Text -> Attribute+letterSpacing_ = makeAttribute "letter-spacing"++-- | The @lightingColor@ attribute.+lightingColor_ :: Text -> Attribute+lightingColor_ = makeAttribute "lighting-color"++-- | The @limitingconeangle@ attribute.+limitingConeAngle_ :: Text -> Attribute+limitingConeAngle_ = makeAttribute "limitingConeAngle"++-- | The @local@ attribute.+local_ :: Text -> Attribute+local_ = makeAttribute "local"++-- | The @markerEnd@ attribute.+markerEnd_ :: Text -> Attribute+markerEnd_ = makeAttribute "marker-end"++-- | The @markerMid@ attribute.+markerMid_ :: Text -> Attribute+markerMid_ = makeAttribute "marker-mid"++-- | The @markerStart@ attribute.+markerStart_ :: Text -> Attribute+markerStart_ = makeAttribute "marker-start"++-- | The @markerheight@ attribute.+markerHeight_ :: Text -> Attribute+markerHeight_ = makeAttribute "markerHeight"++-- | The @markerunits@ attribute.+markerUnits_ :: Text -> Attribute+markerUnits_ = makeAttribute "markerUnits"++-- | The @markerwidth@ attribute.+markerWidth_ :: Text -> Attribute+markerWidth_ = makeAttribute "markerWidth"++-- | The @maskcontentunits@ attribute.+maskContentUnits_ :: Text -> Attribute+maskContentUnits_ = makeAttribute "maskContentUnits"++-- | The @maskunits@ attribute.+maskUnits_ :: Text -> Attribute+maskUnits_ = makeAttribute "maskUnits"++-- | The @mathematical@ attribute.+mathematical_ :: Text -> Attribute+mathematical_ = makeAttribute "mathematical"++-- | The @max@ attribute.+max_ :: Text -> Attribute+max_ = makeAttribute "max"++-- | The @media@ attribute.+media_ :: Text -> Attribute+media_ = makeAttribute "media"++-- | The @method@ attribute.+method_ :: Text -> Attribute+method_ = makeAttribute "method"++-- | The @min@ attribute.+min_ :: Text -> Attribute+min_ = makeAttribute "min"++-- | The @mode@ attribute.+mode_ :: Text -> Attribute+mode_ = makeAttribute "mode"++-- | The @name@ attribute.+name_ :: Text -> Attribute+name_ = makeAttribute "name"++-- | The @numoctaves@ attribute.+numOctaves_ :: Text -> Attribute+numOctaves_ = makeAttribute "numOctaves"++-- | The @offset@ attribute.+offset_ :: Text -> Attribute+offset_ = makeAttribute "offset"++-- | The @onabort@ attribute.+onabort_ :: Text -> Attribute+onabort_ = makeAttribute "onabort"++-- | The @onactivate@ attribute.+onactivate_ :: Text -> Attribute+onactivate_ = makeAttribute "onactivate"++-- | The @onbegin@ attribute.+onbegin_ :: Text -> Attribute+onbegin_ = makeAttribute "onbegin"++-- | The @onclick@ attribute.+onclick_ :: Text -> Attribute+onclick_ = makeAttribute "onclick"++-- | The @onend@ attribute.+onend_ :: Text -> Attribute+onend_ = makeAttribute "onend"++-- | The @onerror@ attribute.+onerror_ :: Text -> Attribute+onerror_ = makeAttribute "onerror"++-- | The @onfocusin@ attribute.+onfocusin_ :: Text -> Attribute+onfocusin_ = makeAttribute "onfocusin"++-- | The @onfocusout@ attribute.+onfocusout_ :: Text -> Attribute+onfocusout_ = makeAttribute "onfocusout"++-- | The @onload@ attribute.+onload_ :: Text -> Attribute+onload_ = makeAttribute "onload"++-- | The @onmousedown@ attribute.+onmousedown_ :: Text -> Attribute+onmousedown_ = makeAttribute "onmousedown"++-- | The @onmousemove@ attribute.+onmousemove_ :: Text -> Attribute+onmousemove_ = makeAttribute "onmousemove"++-- | The @onmouseout@ attribute.+onmouseout_ :: Text -> Attribute+onmouseout_ = makeAttribute "onmouseout"++-- | The @onmouseover@ attribute.+onmouseover_ :: Text -> Attribute+onmouseover_ = makeAttribute "onmouseover"++-- | The @onmouseup@ attribute.+onmouseup_ :: Text -> Attribute+onmouseup_ = makeAttribute "onmouseup"++-- | The @onrepeat@ attribute.+onrepeat_ :: Text -> Attribute+onrepeat_ = makeAttribute "onrepeat"++-- | The @onresize@ attribute.+onresize_ :: Text -> Attribute+onresize_ = makeAttribute "onresize"++-- | The @onscroll@ attribute.+onscroll_ :: Text -> Attribute+onscroll_ = makeAttribute "onscroll"++-- | The @onunload@ attribute.+onunload_ :: Text -> Attribute+onunload_ = makeAttribute "onunload"++-- | The @onzoom@ attribute.+onzoom_ :: Text -> Attribute+onzoom_ = makeAttribute "onzoom"++-- | The @opacity@ attribute.+opacity_ :: Text -> Attribute+opacity_ = makeAttribute "opacity"++-- | The @operator@ attribute.+operator_ :: Text -> Attribute+operator_ = makeAttribute "operator"++-- | The @order@ attribute.+order_ :: Text -> Attribute+order_ = makeAttribute "order"++-- | The @orient@ attribute.+orient_ :: Text -> Attribute+orient_ = makeAttribute "orient"++-- | The @orientation@ attribute.+orientation_ :: Text -> Attribute+orientation_ = makeAttribute "orientation"++-- | The @origin@ attribute.+origin_ :: Text -> Attribute+origin_ = makeAttribute "origin"++-- | The @overflow@ attribute.+overflow_ :: Text -> Attribute+overflow_ = makeAttribute "overflow"++-- | The @overlinePosition@ attribute.+overlinePosition_ :: Text -> Attribute+overlinePosition_ = makeAttribute "overline-position"++-- | The @overlineThickness@ attribute.+overlineThickness_ :: Text -> Attribute+overlineThickness_ = makeAttribute "overline-thickness"++-- | The @panose1@ attribute.+panose1_ :: Text -> Attribute+panose1_ = makeAttribute "panose-1"++-- | The @paint-order@ attribute.+paintOrder_ :: Text -> Attribute+paintOrder_ = makeAttribute "paint-order"++-- | The @path@ attribute.+path_ :: Text -> Attribute+path_ = makeAttribute "path"++-- | The @pathlength@ attribute.+pathLength_ :: Text -> Attribute+pathLength_ = makeAttribute "pathLength"++-- | The @patterncontentunits@ attribute.+patternContentUnits_ :: Text -> Attribute+patternContentUnits_ = makeAttribute "patternContentUnits"++-- | The @patterntransform@ attribute.+patternTransform_ :: Text -> Attribute+patternTransform_ = makeAttribute "patternTransform"++-- | The @patternunits@ attribute.+patternUnits_ :: Text -> Attribute+patternUnits_ = makeAttribute "patternUnits"++-- | The @pointerEvents@ attribute.+pointerEvents_ :: Text -> Attribute+pointerEvents_ = makeAttribute "pointer-events"++-- | The @points@ attribute.+points_ :: Text -> Attribute+points_ = makeAttribute "points"++-- | The @pointsatx@ attribute.+pointsAtX_ :: Text -> Attribute+pointsAtX_ = makeAttribute "pointsAtX"++-- | The @pointsaty@ attribute.+pointsAtY_ :: Text -> Attribute+pointsAtY_ = makeAttribute "pointsAtY"++-- | The @pointsatz@ attribute.+pointsAtZ_ :: Text -> Attribute+pointsAtZ_ = makeAttribute "pointsAtZ"++-- | The @preservealpha@ attribute.+preserveAlpha_ :: Text -> Attribute+preserveAlpha_ = makeAttribute "preserveAlpha"++-- | The @preserveaspectratio@ attribute.+preserveAspectRatio_ :: Text -> Attribute+preserveAspectRatio_ = makeAttribute "preserveAspectRatio"++-- | The @primitiveunits@ attribute.+primitiveUnits_ :: Text -> Attribute+primitiveUnits_ = makeAttribute "primitiveUnits"++-- | The @r@ attribute.+r_ :: Text -> Attribute+r_ = makeAttribute "r"++-- | The @radius@ attribute.+radius_ :: Text -> Attribute+radius_ = makeAttribute "radius"++-- | The @refx@ attribute.+refX_ :: Text -> Attribute+refX_ = makeAttribute "refX"++-- | The @refy@ attribute.+refY_ :: Text -> Attribute+refY_ = makeAttribute "refY"++-- | The @renderingIntent@ attribute.+renderingIntent_ :: Text -> Attribute+renderingIntent_ = makeAttribute "rendering-intent"++-- | The @repeatcount@ attribute.+repeatCount_ :: Text -> Attribute+repeatCount_ = makeAttribute "repeatCount"++-- | The @repeatdur@ attribute.+repeatDur_ :: Text -> Attribute+repeatDur_ = makeAttribute "repeatDur"++-- | The @requiredextensions@ attribute.+requiredExtensions_ :: Text -> Attribute+requiredExtensions_ = makeAttribute "requiredExtensions"++-- | The @requiredfeatures@ attribute.+requiredFeatures_ :: Text -> Attribute+requiredFeatures_ = makeAttribute "requiredFeatures"++-- | The @restart@ attribute.+restart_ :: Text -> Attribute+restart_ = makeAttribute "restart"++-- | The @result@ attribute.+result_ :: Text -> Attribute+result_ = makeAttribute "result"++-- | The @rotate@ attribute.+rotate_ :: Text -> Attribute+rotate_ = makeAttribute "rotate"++-- | The @rx@ attribute.+rx_ :: Text -> Attribute+rx_ = makeAttribute "rx"++-- | The @ry@ attribute.+ry_ :: Text -> Attribute+ry_ = makeAttribute "ry"++-- | The @scale@ attribute.+scale_ :: Text -> Attribute+scale_ = makeAttribute "scale"++-- | The @seed@ attribute.+seed_ :: Text -> Attribute+seed_ = makeAttribute "seed"++-- | The @shapeRendering@ attribute.+shapeRendering_ :: Text -> Attribute+shapeRendering_ = makeAttribute "shape-rendering"++-- | The @slope@ attribute.+slope_ :: Text -> Attribute+slope_ = makeAttribute "slope"++-- | The @spacing@ attribute.+spacing_ :: Text -> Attribute+spacing_ = makeAttribute "spacing"++-- | The @specularconstant@ attribute.+specularConstant_ :: Text -> Attribute+specularConstant_ = makeAttribute "specularConstant"++-- | The @specularexponent@ attribute.+specularExponent_ :: Text -> Attribute+specularExponent_ = makeAttribute "specularExponent"++-- | The @spreadmethod@ attribute.+spreadMethod_ :: Text -> Attribute+spreadMethod_ = makeAttribute "spreadMethod"++-- | The @startoffset@ attribute.+startOffset_ :: Text -> Attribute+startOffset_ = makeAttribute "startOffset"++-- | The @stddeviation@ attribute.+stdDeviation_ :: Text -> Attribute+stdDeviation_ = makeAttribute "stdDeviation"++-- | The @stemh@ attribute.+stemh_ :: Text -> Attribute+stemh_ = makeAttribute "stemh"++-- | The @stemv@ attribute.+stemv_ :: Text -> Attribute+stemv_ = makeAttribute "stemv"++-- | The @stitchtiles@ attribute.+stitchTiles_ :: Text -> Attribute+stitchTiles_ = makeAttribute "stitchTiles"++-- | The @stopColor@ attribute.+stopColor_ :: Text -> Attribute+stopColor_ = makeAttribute "stop-color"++-- | The @stopOpacity@ attribute.+stopOpacity_ :: Text -> Attribute+stopOpacity_ = makeAttribute "stop-opacity"++-- | The @strikethroughPosition@ attribute.+strikethroughPosition_ :: Text -> Attribute+strikethroughPosition_ = makeAttribute "strikethrough-position"++-- | The @strikethroughThickness@ attribute.+strikethroughThickness_ :: Text -> Attribute+strikethroughThickness_ = makeAttribute "strikethrough-thickness"++-- | The @string@ attribute.+string_ :: Text -> Attribute+string_ = makeAttribute "string"++-- | The @stroke@ attribute.+stroke_ :: Text -> Attribute+stroke_ = makeAttribute "stroke"++-- | The @strokeDasharray@ attribute.+strokeDasharray_ :: Text -> Attribute+strokeDasharray_ = makeAttribute "stroke-dasharray"++-- | The @strokeDashoffset@ attribute.+strokeDashoffset_ :: Text -> Attribute+strokeDashoffset_ = makeAttribute "stroke-dashoffset"++-- | The @strokeLinecap@ attribute.+strokeLinecap_ :: Text -> Attribute+strokeLinecap_ = makeAttribute "stroke-linecap"++-- | The @strokeLinejoin@ attribute.+strokeLinejoin_ :: Text -> Attribute+strokeLinejoin_ = makeAttribute "stroke-linejoin"++-- | The @strokeMiterlimit@ attribute.+strokeMiterlimit_ :: Text -> Attribute+strokeMiterlimit_ = makeAttribute "stroke-miterlimit"++-- | The @strokeOpacity@ attribute.+strokeOpacity_ :: Text -> Attribute+strokeOpacity_ = makeAttribute "stroke-opacity"++-- | The @strokeWidth@ attribute.+strokeWidth_ :: Text -> Attribute+strokeWidth_ = makeAttribute "stroke-width"++-- | The @style@ attribute.+style_ :: Text -> Attribute+style_ = makeAttribute "style"++-- | The @surfacescale@ attribute.+surfaceScale_ :: Text -> Attribute+surfaceScale_ = makeAttribute "surfaceScale"++-- | The @systemlanguage@ attribute.+systemLanguage_ :: Text -> Attribute+systemLanguage_ = makeAttribute "systemLanguage"++-- | The @tablevalues@ attribute.+tableValues_ :: Text -> Attribute+tableValues_ = makeAttribute "tableValues"++-- | The @target@ attribute.+target_ :: Text -> Attribute+target_ = makeAttribute "target"++-- | The @targetx@ attribute.+targetX_ :: Text -> Attribute+targetX_ = makeAttribute "targetX"++-- | The @targety@ attribute.+targetY_ :: Text -> Attribute+targetY_ = makeAttribute "targetY"++-- | The @textAnchor@ attribute.+textAnchor_ :: Text -> Attribute+textAnchor_ = makeAttribute "text-anchor"++-- | The @textDecoration@ attribute.+textDecoration_ :: Text -> Attribute+textDecoration_ = makeAttribute "text-decoration"++-- | The @textRendering@ attribute.+textRendering_ :: Text -> Attribute+textRendering_ = makeAttribute "text-rendering"++-- | The @textlength@ attribute.+textLength_ :: Text -> Attribute+textLength_ = makeAttribute "textLength"++-- | The @to@ attribute.+to_ :: Text -> Attribute+to_ = makeAttribute "to"++-- | The @transform@ attribute.+transform_ :: Text -> Attribute+transform_ = makeAttribute "transform"++-- | The @type@ attribute.+type_ :: Text -> Attribute+type_ = makeAttribute "type"++-- | The @u1@ attribute.+u1_ :: Text -> Attribute+u1_ = makeAttribute "u1"++-- | The @u2@ attribute.+u2_ :: Text -> Attribute+u2_ = makeAttribute "u2"++-- | The @underlinePosition@ attribute.+underlinePosition_ :: Text -> Attribute+underlinePosition_ = makeAttribute "underline-position"++-- | The @underlineThickness@ attribute.+underlineThickness_ :: Text -> Attribute+underlineThickness_ = makeAttribute "underline-thickness"++-- | The @unicode@ attribute.+unicode_ :: Text -> Attribute+unicode_ = makeAttribute "unicode"++-- | The @unicodeBidi@ attribute.+unicodeBidi_ :: Text -> Attribute+unicodeBidi_ = makeAttribute "unicode-bidi"++-- | The @unicodeRange@ attribute.+unicodeRange_ :: Text -> Attribute+unicodeRange_ = makeAttribute "unicode-range"++-- | The @unitsPerEm@ attribute.+unitsPerEm_ :: Text -> Attribute+unitsPerEm_ = makeAttribute "units-per-em"++-- | The @vAlphabetic@ attribute.+vAlphabetic_ :: Text -> Attribute+vAlphabetic_ = makeAttribute "v-alphabetic"++-- | The @vHanging@ attribute.+vHanging_ :: Text -> Attribute+vHanging_ = makeAttribute "v-hanging"++-- | The @vIdeographic@ attribute.+vIdeographic_ :: Text -> Attribute+vIdeographic_ = makeAttribute "v-ideographic"++-- | The @vMathematical@ attribute.+vMathematical_ :: Text -> Attribute+vMathematical_ = makeAttribute "v-mathematical"++-- | The @values@ attribute.+values_ :: Text -> Attribute+values_ = makeAttribute "values"++-- | The @version@ attribute.+version_ :: Text -> Attribute+version_ = makeAttribute "version"++-- | The @vertAdvY@ attribute.+vertAdvY_ :: Text -> Attribute+vertAdvY_ = makeAttribute "vert-adv-y"++-- | The @vertOriginX@ attribute.+vertOriginX_ :: Text -> Attribute+vertOriginX_ = makeAttribute "vert-origin-x"++-- | The @vertOriginY@ attribute.+vertOriginY_ :: Text -> Attribute+vertOriginY_ = makeAttribute "vert-origin-y"++-- | The @viewbox@ attribute.+viewBox_ :: Text -> Attribute+viewBox_ = makeAttribute "viewBox"++-- | The @viewtarget@ attribute.+viewTarget_ :: Text -> Attribute+viewTarget_ = makeAttribute "viewTarget"++-- | The @visibility@ attribute.+visibility_ :: Text -> Attribute+visibility_ = makeAttribute "visibility"++-- | The @width@ attribute.+width_ :: Text -> Attribute+width_ = makeAttribute "width"++-- | The @widths@ attribute.+widths_ :: Text -> Attribute+widths_ = makeAttribute "widths"++-- | The @wordSpacing@ attribute.+wordSpacing_ :: Text -> Attribute+wordSpacing_ = makeAttribute "word-spacing"++-- | The @writingMode@ attribute.+writingMode_ :: Text -> Attribute+writingMode_ = makeAttribute "writing-mode"++-- | The @x@ attribute.+x_ :: Text -> Attribute+x_ = makeAttribute "x"++-- | The @xHeight@ attribute.+xHeight_ :: Text -> Attribute+xHeight_ = makeAttribute "x-height"++-- | The @x1@ attribute.+x1_ :: Text -> Attribute+x1_ = makeAttribute "x1"++-- | The @x2@ attribute.+x2_ :: Text -> Attribute+x2_ = makeAttribute "x2"++-- | The @xchannelselector@ attribute.+xChannelSelector_ :: Text -> Attribute+xChannelSelector_ = makeAttribute "xChannelSelector"++-- | The @xlinkActuate@ attribute.+xlinkActuate_ :: Text -> Attribute+xlinkActuate_ = makeAttribute "xlink:actuate"++-- | The @xlinkArcrole@ attribute.+xlinkArcrole_ :: Text -> Attribute+xlinkArcrole_ = makeAttribute "xlink:arcrole"++-- | The @xlinkHref@ attribute.+xlinkHref_ :: Text -> Attribute+xlinkHref_ = makeAttribute "xlink:href"++-- | The @xlinkRole@ attribute.+xlinkRole_ :: Text -> Attribute+xlinkRole_ = makeAttribute "xlink:role"++-- | The @xlinkShow@ attribute.+xlinkShow_ :: Text -> Attribute+xlinkShow_ = makeAttribute "xlink:show"++-- | The @xlinkTitle@ attribute.+xlinkTitle_ :: Text -> Attribute+xlinkTitle_ = makeAttribute "xlink:title"++-- | The @xlinkType@ attribute.+xlinkType_ :: Text -> Attribute+xlinkType_ = makeAttribute "xlink:type"++-- | The @xmlBase@ attribute.+xmlBase_ :: Text -> Attribute+xmlBase_ = makeAttribute "xml:base"++-- | The @xmlLang@ attribute.+xmlLang_ :: Text -> Attribute+xmlLang_ = makeAttribute "xml:lang"++-- | The @xmlSpace@ attribute.+xmlSpace_ :: Text -> Attribute+xmlSpace_ = makeAttribute "xml:space"++-- | The @y@ attribute.+y_ :: Text -> Attribute+y_ = makeAttribute "y"++-- | The @y1@ attribute.+y1_ :: Text -> Attribute+y1_ = makeAttribute "y1"++-- | The @y2@ attribute.+y2_ :: Text -> Attribute+y2_ = makeAttribute "y2"++-- | The @ychannelselector@ attribute.+yChannelselector_ :: Text -> Attribute+yChannelselector_ = makeAttribute "yChannelSelector"++-- | The @z@ attribute.+z_ :: Text -> Attribute+z_ = makeAttribute "z"++-- | The @zoomandpan@ attribute.+zoomAndPan_ :: Text -> Attribute+zoomAndPan_ = makeAttribute "zoomAndPan"
+ src/Lucid/Svg/Elements.hs view
@@ -0,0 +1,346 @@+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE FlexibleContexts #-}++module Lucid.Svg.Elements where ++import Data.Text (Text)+import Lucid.Base++-- | A type alias for the 'SvgT m a' monad transformer.+type SvgT = HtmlT++-- | Make an HTML builder for elements with no content, only attributes.+-- SVG circle for example.+makeElementNoContent :: Monad m => Text -> SvgT m ()+makeElementNoContent name = makeElement name ""++-- | @DOCTYPE@ element+doctype_ :: Monad m => SvgT m ()+doctype_ = makeElementNoEnd "?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\"" ++-- | @svg@ element + svg 1.1 attributes+svg11_:: Term [Attribute] (s -> t) => s -> t+svg11_ m = svg_ [ makeAttribute "xmlns" "http://www.w3.org/2000/svg"+ , makeAttribute "xmlns:xlink" "http://www.w3.org/1999/xlink"+ , makeAttribute "version" "1.1" ]+ m++-- | @a@ element+a_ :: Term arg result => arg -> result+a_ = term "a"++-- | @altglyph@ element+altGlyph_ :: Monad m => [Attribute] -> SvgT m ()+altGlyph_ = with $ makeElementNoContent "altGlyph"++-- | @altglyphdef@ element+altGlyphDef_ :: Monad m => [Attribute] -> SvgT m ()+altGlyphDef_ = with $ makeElementNoContent "altGlyphDef" ++-- | @altglyphitem@ element+altGlyphItem_ :: Monad m => [Attribute] -> SvgT m ()+altGlyphItem_ = with $ makeElementNoContent "altGlyphItem" ++-- | @animate@ element+animate_ :: Monad m => [Attribute] -> SvgT m ()+animate_ = with $ makeElementNoContent "animate" ++-- | @animatecolor@ element+animateColor_ :: Monad m => [Attribute] -> SvgT m ()+animateColor_ = with $ makeElementNoContent "animateColor" ++-- | @animatemotion@ element+animateMotion_ :: Monad m => [Attribute] -> SvgT m ()+animateMotion_ = with $ makeElementNoContent "animateMotion" ++-- | @animatetransform@ element+animateTransform_ :: Monad m => [Attribute] -> SvgT m ()+animateTransform_ = with $ makeElementNoContent "animateTransform" ++-- | @circle@ element+circle_ :: Monad m => [Attribute] -> SvgT m ()+circle_ = with $ makeElementNoContent "circle" ++-- | @clippath@ element+clippath_ :: Term arg result => arg -> result+clippath_ = term "clippath"++-- | @colorProfile@ element +colorProfile_ :: Monad m => [Attribute] -> SvgT m ()+colorProfile_ = with $ makeElementNoContent "color-profile" ++-- | @cursor@ element+cursor_ :: Monad m => [Attribute] -> SvgT m ()+cursor_ = with $ makeElementNoContent "cursor" ++-- | @defs@ element+defs_ :: Term arg result => arg -> result+defs_ = term "defs"++-- | @desc@ element+desc_ :: Monad m => [Attribute] -> SvgT m ()+desc_ = with $ makeElementNoContent "desc" ++-- | @ellipse@ element+ellipse_ :: Monad m => [Attribute] -> SvgT m ()+ellipse_ = with $ makeElementNoContent "ellipse" ++-- | @feblend@ element+feBlend_ :: Monad m => [Attribute] -> SvgT m ()+feBlend_ = with $ makeElementNoContent "feBlend" ++-- | @fecolormatrix@ element+feColorMatrix_ :: Monad m => [Attribute] -> SvgT m ()+feColorMatrix_ = with $ makeElementNoContent "feColorMatrix" ++-- | @fecomponenttransfer@ element+feComponentTransfer_ :: Monad m => [Attribute] -> SvgT m ()+feComponentTransfer_ = with $ makeElementNoContent "feComponentTransfer" ++-- | @fecomposite@ element+feComposite_ :: Monad m => [Attribute] -> SvgT m ()+feComposite_ = with $ makeElementNoContent "feComposite" ++-- | @feconvolvematrix@ element+feConvolveMatrix_ :: Monad m => [Attribute] -> SvgT m ()+feConvolveMatrix_ = with $ makeElementNoContent "feConvolveMatrix" ++-- | @fediffuselighting@ element+feDiffuseLighting_ :: Monad m => [Attribute] -> SvgT m ()+feDiffuseLighting_ = with $ makeElementNoContent "feDiffuseLighting" ++-- | @fedisplacementmap@ element+feDisplacementMap_ :: Monad m => [Attribute] -> SvgT m ()+feDisplacementMap_ = with $ makeElementNoContent "feDisplacementMap" ++-- | @fedistantlight@ element+feDistantLight_ :: Monad m => [Attribute] -> SvgT m ()+feDistantLight_ = with $ makeElementNoContent "feDistantLight" ++-- | @feflood@ element+feFlood_ :: Monad m => [Attribute] -> SvgT m ()+feFlood_ = with $ makeElementNoContent "feFlood" ++-- | @fefunca@ element+feFuncA_ :: Monad m => [Attribute] -> SvgT m ()+feFuncA_ = with $ makeElementNoContent "feFuncA" ++-- | @fefuncb@ element+feFuncB_ :: Monad m => [Attribute] -> SvgT m ()+feFuncB_ = with $ makeElementNoContent "feFuncB" ++-- | @fefuncg@ element+feFuncG_ :: Monad m => [Attribute] -> SvgT m ()+feFuncG_ = with $ makeElementNoContent "feFuncG" ++-- | @fefuncr@ element+feFuncR_ :: Monad m => [Attribute] -> SvgT m ()+feFuncR_ = with $ makeElementNoContent "feFuncR" ++-- | @fegaussianblur@ element+feGaussianBlur_ :: Monad m => [Attribute] -> SvgT m ()+feGaussianBlur_ = with $ makeElementNoContent "feGaussianBlur" ++-- | @feimage@ element+feImage_ :: Monad m => [Attribute] -> SvgT m ()+feImage_ = with $ makeElementNoContent "feImage" ++-- | @femerge@ element+feMerge_ :: Monad m => [Attribute] -> SvgT m ()+feMerge_ = with $ makeElementNoContent "feMerge" ++-- | @femergenode@ element+feMergeNode_ :: Monad m => [Attribute] -> SvgT m ()+feMergeNode_ = with $ makeElementNoContent "feMergeNode" ++-- | @femorphology@ element+feMorphology_ :: Monad m => [Attribute] -> SvgT m ()+feMorphology_ = with $ makeElementNoContent "feMorphology" ++-- | @feoffset@ element+feOffset_ :: Monad m => [Attribute] -> SvgT m ()+feOffset_ = with $ makeElementNoContent "feOffset" ++-- | @fepointlight@ element+fePointLight_ :: Monad m => [Attribute] -> SvgT m ()+fePointLight_ = with $ makeElementNoContent "fePointLight" ++-- | @fespecularlighting@ element+feSpecularLighting_ :: Monad m => [Attribute] -> SvgT m ()+feSpecularLighting_ = with $ makeElementNoContent "feSpecularLighting" ++-- | @fespotlight@ element+feSpotLight_ :: Monad m => [Attribute] -> SvgT m ()+feSpotLight_ = with $ makeElementNoContent "feSpotLight" ++-- | @fetile@ element+feTile_ :: Monad m => [Attribute] -> SvgT m ()+feTile_ = with $ makeElementNoContent "feTile" ++-- | @feturbulence@ element+feTurbulence_ :: Monad m => [Attribute] -> SvgT m ()+feTurbulence_ = with $ makeElementNoContent "feTurbulence" ++-- | @filter_@ element+filter_ :: Monad m => [Attribute] -> SvgT m ()+filter_ = with $ makeElementNoContent "filter" ++-- | @font@ element+font_ :: Monad m => [Attribute] -> SvgT m ()+font_ = with $ makeElementNoContent "font" ++-- | @fontFace@ element+fontFace_ :: Monad m => [Attribute] -> SvgT m ()+fontFace_ = with $ makeElementNoContent "font-face" ++-- | @fontFaceFormat@ element+fontFaceFormat_ :: Monad m => [Attribute] -> SvgT m ()+fontFaceFormat_ = with $ makeElementNoContent "font-face-format" ++-- | @fontFaceName@ element+fontFaceName_ :: Monad m => [Attribute] -> SvgT m ()+fontFaceName_ = with $ makeElementNoContent "font-face-name" ++-- | @fontFaceSrc@ element+fontFaceSrc_ :: Monad m => [Attribute] -> SvgT m ()+fontFaceSrc_ = with $ makeElementNoContent "font-face-src" ++-- | @fontFaceUri@ element+fontFaceUri_ :: Monad m => [Attribute] -> SvgT m ()+fontFaceUri_ = with $ makeElementNoContent "font-face-uri" ++-- | @foreignobject@ element+foreignObject_ :: Monad m => [Attribute] -> SvgT m ()+foreignObject_ = with $ makeElementNoContent "foreignObject" ++-- | @g@ element+g_ :: Term arg result => arg -> result+g_ = term "g"++-- | @glyph@ element or attribute+glyph_ :: Term arg result => arg -> result+glyph_ = term "glyph"++-- | @glyphref@ element+glyphRef_ :: Monad m => [Attribute] -> SvgT m ()+glyphRef_ = with $ makeElementNoContent "glyphRef" ++-- | @hkern@ element+hkern_ :: Monad m => [Attribute] -> SvgT m ()+hkern_ = with $ makeElementNoContent "hkern" ++-- | @image@ element+image_ :: Monad m => [Attribute] -> SvgT m ()+image_ = with $ makeElementNoContent "image" ++-- | @line@ element+line_ :: Monad m => [Attribute] -> SvgT m ()+line_ = with $ makeElementNoContent "line" ++-- | @lineargradient@ element+linearGradient_ :: Term arg result => arg -> result+linearGradient_ = term "linearGradient"++-- | @marker@ element+marker_ :: Term arg result => arg -> result+marker_ = term "marker"++-- | @mask@ element or attribute+mask_ :: Term arg result => arg -> result+mask_ = term "mask"++-- | @metadata@ element+metadata_ :: Monad m => [Attribute] -> SvgT m ()+metadata_ = with $ makeElementNoContent "metadata" ++-- | @missingGlyph@ element+missingGlyph_ :: Term arg result => arg -> result+missingGlyph_ = term "missing-glyph"++-- | @mpath@ element+mpath_ :: Monad m => [Attribute] -> SvgT m ()+mpath_ = with $ makeElementNoContent "mpath" ++-- | @path@ element+path_ :: Monad m => [Attribute] -> SvgT m ()+path_ = with $ makeElementNoContent "path" ++-- | @pattern@ element+pattern_ :: Term arg result => arg -> result+pattern_ = term "pattern"++-- | @polygon@ element+polygon_ :: Monad m => [Attribute] -> SvgT m ()+polygon_ = with $ makeElementNoContent "polygon" ++-- | @polyline@ element+polyline_ :: Monad m => [Attribute] -> SvgT m ()+polyline_ = with $ makeElementNoContent "polyline" ++-- | @radialgradient@ element+radialGradient_ :: Term arg result => arg -> result+radialGradient_ = term "radialGradient"++-- | @rect@ element+rect_ :: Monad m => [Attribute] -> SvgT m ()+rect_ = with $ makeElementNoContent "rect"++-- | @script@ element+script_ :: Monad m => [Attribute] -> SvgT m ()+script_ = with $ makeElementNoContent "script" ++-- | @set@ element+set_ :: Monad m => [Attribute] -> SvgT m ()+set_ = with $ makeElementNoContent "set" ++-- | @stop@ element+stop_ :: Monad m => [Attribute] -> SvgT m ()+stop_ = with $ makeElementNoContent "stop" ++-- | @style@ element+style_ :: Monad m => [Attribute] -> SvgT m ()+style_ = with $ makeElementNoContent "style" ++-- | @svg@ element+svg_ :: Term arg result => arg -> result+svg_ = term "svg"++-- | @switch@ element+switch_ :: Term arg result => arg -> result+switch_ = term "switch"++-- | @symbol@ element+symbol_ :: Term arg result => arg -> result+symbol_ = term "symbol"++-- | @text_@ element+text_ :: Term arg result => arg -> result+text_ = term "text"++-- | @textpath@ element+textPath_ :: Monad m => [Attribute] -> SvgT m ()+textPath_ = with $ makeElementNoContent "textPath" ++-- | @title@ element+title_ :: Monad m => [Attribute] -> SvgT m ()+title_ = with $ makeElementNoContent "title" ++-- | @tref@ element+tref_ :: Monad m => [Attribute] -> SvgT m ()+tref_ = with $ makeElementNoContent "tref" ++-- | @tspan@ element+tspan_ :: Monad m => [Attribute] -> SvgT m ()+tspan_ = with $ makeElementNoContent "tspan" ++-- | @use@ element+use_ :: Monad m => [Attribute] -> SvgT m ()+use_ = with $ makeElementNoContent "use" ++-- | @view@ element+view_ :: Monad m => [Attribute] -> SvgT m ()+view_ = with $ makeElementNoContent "view" ++-- | @vkern@ element+vkern_ :: Monad m => [Attribute] -> SvgT m ()+vkern_ = with $ makeElementNoContent "vkern"
+ src/Lucid/Svg/Path.hs view
@@ -0,0 +1,114 @@+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE OverloadedStrings #-}++module Lucid.Svg.Path where++import Data.Text (Text)+import qualified Data.Text as T++-- moveto (absolute)+mA :: Text -> Text -> Text+mA x y = T.concat ["M " ,x, ",", y, " "]++-- | moveto (relative)+mR :: Text -> Text -> Text+mR dx dy = T.concat ["m ", dx, ",", dy, " "]++-- | lineto (absolute)+lA :: Text -> Text -> Text+lA x y = T.concat ["L ", x, ",", y, " "]++-- | lineto (relative)+lR :: Text -> Text -> Text+lR dx dy = T.concat ["l ", dx, ",", dy, " "]++-- | horizontal lineto (absolute)+hA :: Text -> Text+hA x = T.concat ["H ", x, " "]++-- | horizontal lineto (relative)+hR :: Text -> Text+hR dx = T.concat ["h ", dx, " "]++-- | vertical lineto (absolute)+vA :: Text -> Text+vA y = T.concat ["V ", y, " "]++-- | vertical lineto (relative)+vR :: Text -> Text+vR dy = T.concat ["v ", dy, " "]++-- | Cubic Bezier curve (absolute)+cA :: Text -> Text -> Text -> Text -> Text -> Text -> Text+cA c1x c1y c2x c2y x y = T.concat ["C ", c1x, ",", c1y, " ", c2x, ",", c2y, " ", x, " ", y]++-- | Cubic Bezier curve (relative)+cR :: Text -> Text -> Text -> Text -> Text -> Text -> Text+cR dc1x dc1y dc2x dc2y dx dy = T.concat ["c ", dc1x, ",", dc1y, " ", dc2x, ",", dc2y, " ", dx, " ", dy]++-- | Smooth Cubic Bezier curve (absolute)+sA :: Text -> Text -> Text -> Text -> Text+sA c2x c2y x y = T.concat ["S ", c2x, ",", c2y, " ", x, ",", y, " "]++-- | Smooth Cubic Bezier curve (relative)+sR :: Text -> Text -> Text -> Text -> Text+sR dc2x dc2y dx dy = T.concat ["s ", dc2x, ",", dc2y, " ", dx, ",", dy, " "]++-- | Quadratic Bezier curve (absolute)+qA :: Text -> Text -> Text -> Text -> Text+qA cx cy x y = T.concat ["Q ", cx, ",", cy, " ", x, ",", y, " "]++-- | Quadratic Bezier curve (relative)+qR :: Text -> Text -> Text -> Text -> Text+qR dcx dcy dx dy = T.concat ["q ", dcx, ",", dcy, " ", dx, ",", dy, " " ]++-- | Smooth Quadratic Bezier curve (absolute)+tA :: Text -> Text -> Text+tA x y = T.concat ["T ", " ", x, ",", y, " "]++-- | Smooth Quadratic Bezier curve (relative)+tR :: Text -> Text -> Text+tR x y = T.concat [ "t ", x, ",", y, " "]++-- | Arc (absolute)+aA :: Text -> Text -> Text -> Text -> Text -> Text -> Text -> Text+aA rx ry xrot largeFlag sweepFlag x y =+ T.concat ["A ", rx, ",", ry, " ", xrot, " ", largeFlag, " ", sweepFlag, " ", x, " ", y, " "]++-- | Arc (relative)+aR :: Text -> Text -> Text -> Text -> Text -> Text -> Text -> Text+aR rx ry xrot largeFlag sweepFlag x y =+ T.concat ["a ", rx, ",", ry, " ", xrot, " ", largeFlag, " ", sweepFlag, " ", x, " ", y, " "]++-- | closepath+z :: Text+z = "Z"++-- | SVG Transform components+-- | Specifies a translation by @x@ and @y@+translate :: Text -> Text -> Text+translate x y = T.concat ["translate(", x, " ", y, ")"]++-- | Specifies a scale operation by @x@ and @y@+scale :: Text -> Text -> Text+scale x y = T.concat ["scale(", x, " ", y, ")"]++-- | Specifies a rotation by @rotate-angle@ degrees+rotate :: Text -> Text+rotate angle = T.concat ["rotate(", angle, ")"]++-- | Specifies a rotation by @rotate-angle@ degrees about the given time @rx,ry@+rotateAround :: Text -> Text -> Text -> Text+rotateAround angle rx ry = T.concat ["rotate(", angle, ",", rx, ",", ry, ")"]++-- | Skew tansformation along x-axis+skewX :: Text -> Text+skewX angle = T.concat ["skewX(", angle, ")"]++-- | Skew tansformation along y-axis+skewY :: Text -> Text+skewY angle = T.concat ["skewY(", angle, ")"]++-- | Specifies a transform in the form of a transformation matrix+matrix :: Text -> Text -> Text -> Text -> Text -> Text -> Text+matrix a b c_ d e f = T.concat ["matrix(", a, ",", b, ",", c_, ",", d, ",", e, ",", f, ")"]