Skip to content

Clear to write, read and edit DSL for writing SVG, based on lucid2

License

Notifications You must be signed in to change notification settings

flora-pm/lucid2-svg

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lucid-svg Hackage

Simple DSL for writing SVG, based on lucid

Example

{-# LANGUAGE OverloadedStrings #-}

import Lucid.Svg
 
svg :: Svg () -> Svg ()
svg content = do
  doctype_
  with (svg11_ content) [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", font_size_ "60", text_anchor_ "middle", fill_ "white"] "SVG"


main :: IO ()
main = do
  print $ svg contents

SVG

About

Clear to write, read and edit DSL for writing SVG, based on lucid2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Haskell 99.1%
  • Python 0.9%