added some basic examples

This commit is contained in:
Yann Esposito (Yogsototh) 2014-12-20 14:51:35 +01:00
parent 6c739bc98d
commit 2326eae883
6 changed files with 37 additions and 2 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
elm-stuff elm-stuff
elm.js
.cabal-sandbox .cabal-sandbox
cabal.sandbox.config cabal.sandbox.config

9
display/Cropped.elm Normal file
View file

@ -0,0 +1,9 @@
import Graphics.Element (..)
main : Element
main = let w = 800
h = 420
url = "http://placekitten.com/" ++ toString w ++ "/" ++ toString h
imgw = w // 2
imgh = h // 2
in croppedImage (30,0) imgw imgh url

5
display/HelloWorld.elm Normal file
View file

@ -0,0 +1,5 @@
import Graphics.Element (..)
import Text (..)
main : Element
main = plainText "Hello, World!"

6
display/Image.elm Normal file
View file

@ -0,0 +1,6 @@
import Graphics.Element (..)
main : Element
main = let w = 800
h = 420
in image w h ("http://placekitten.com/" ++ toString w ++ "/" ++ toString h)

13
display/Markdown.elm Normal file
View file

@ -0,0 +1,13 @@
import Markdown
main = Markdown.toElement """
# Welcome to Elm
This [markdown](http://daringfireball.net/projects/markdown/)
parser lives in the [elm-markdown][] package, allowing you to
generate `Element` and `Html` blocks.
[elm-markdown]: http://package.elm-lang.org/packages/evancz/elm-markdown/latest
"""

View file

@ -8,6 +8,7 @@
], ],
"exposed-modules": [], "exposed-modules": [],
"dependencies": { "dependencies": {
"elm-lang/core": "1.0.0 <= v < 2.0.0" "elm-lang/core": "1.0.0 <= v < 2.0.0",
"evancz/elm-markdown": "1.1.0 <= v < 2.0.0"
} }
} }