on master help sign in
Minor tweaks to docs
8ff5814Evan Czaplicki
libraries/Color.elm+8−8
@@ -21,7 +21,7 @@ which provides aesthetically reasonable defaults for colors. Each color also
21comes with a light and dark version.
21comes with a light and dark version.
22
22
23### Standard
23### Standard
24−@docs red, orange, yellow, green, blue, purple, brown, black, white
24+@docs red, orange, yellow, green, blue, purple, brown
25
25
26### Light
26### Light
27@docs lightRed, lightOrange, lightYellow, lightGreen, lightBlue, lightPurple,
27@docs lightRed, lightOrange, lightYellow, lightGreen, lightBlue, lightPurple,
@@ -31,14 +31,14 @@ comes with a light and dark version.
31@docs darkRed, darkOrange, darkYellow, darkGreen, darkBlue, darkPurple,
31@docs darkRed, darkOrange, darkYellow, darkGreen, darkBlue, darkPurple,
32 darkBrown
32 darkBrown
33
33
34−### Grays
34+### Eight Shades of Grey
35−These six colors are a compatible series of shades of gray. White and black are
35+These colors are a compatible series of shades of grey, fitting nicely
36−listed above.
36+with the Tango palette.
37−@docs lightGray, gray, darkGray, lightCharcoal, charcoal, darkCharcoal
37+@docs white, lightGrey, grey, darkGrey, lightCharcoal, charcoal, darkCharcoal, black
38
38
39−#### Greys
40−These are identical to the *gray* versions.
39+These are identical to the *grey* versions. It seems the spelling is regional, but
41−@docs lightGrey, grey, darkGrey
40+that has never helped me remember which one I should be writing.
41+@docs lightGray, gray, darkGray
42
42
43-}
43-}
44
44
libraries/JavaScript.elm+2−6
@@ -11,8 +11,6 @@ integration.
11# JavaScript from Elm
11# JavaScript from Elm
12@docs fromString, fromInt, fromFloat, fromBool fromList
12@docs fromString, fromInt, fromFloat, fromBool fromList
13
13
14−-}
15−{-
16# DOM Nodes and Elements
14# DOM Nodes and Elements
17@docs toElement, fromElement
15@docs toElement, fromElement
18-}
16-}
@@ -27,7 +25,7 @@ data JSArray a = JSArray a
27data JSDomNode = JSDomNode
25data JSDomNode = JSDomNode
28data JSObject = JSObject
26data JSObject = JSObject
29
27
30−-- Requires that the input array be uniform (all members have the same type)
28+{-| Requires that the input array be uniform (all members have the same type) -}
31toList : JSArray a -> [a]
29toList : JSArray a -> [a]
32toList = Native.JavaScript.toList
30toList = Native.JavaScript.toList
33
31
@@ -44,7 +42,7 @@ toString : JSString -> String
44toString = Native.JavaScript.toString
42toString = Native.JavaScript.toString
45
43
46
44
47−-- Produces a uniform JavaScript array with all members of the same type.
45+{-| Produces a uniform JavaScript array with all members of the same type. -}
48fromList : [a] -> JSArray a
46fromList : [a] -> JSArray a
49fromList = Native.JavaScript.fromList
47fromList = Native.JavaScript.fromList
50
48
@@ -60,7 +58,6 @@ fromBool = Native.JavaScript.fromBool
60fromString : String -> JSString
58fromString : String -> JSString
61fromString = Native.JavaScript.fromString
59fromString = Native.JavaScript.fromString
62
60
63−{--
64{-| Turn an `Element` into a DOM node. -}
61{-| Turn an `Element` into a DOM node. -}
65fromElement : Element -> JSDomNode
62fromElement : Element -> JSDomNode
66fromElement = Native.JavaScript.fromElement
63fromElement = Native.JavaScript.fromElement
@@ -69,4 +66,3 @@ fromElement = Native.JavaScript.fromElement
69using the normal `width` and `height` functions. -}
66using the normal `width` and `height` functions. -}
70toElement : Int -> Int -> JSDomNode -> Element
67toElement : Int -> Int -> JSDomNode -> Element
71toElement = Native.JavaScript.toElement
68toElement = Native.JavaScript.toElement
72−--}
libraries/Keyboard.elm+12−11
@@ -20,30 +20,31 @@ import Signal (Signal)
20import Native.Keyboard
20import Native.Keyboard
21
21
22{-| Type alias to make it clearer what integers are supposed to represent
22{-| Type alias to make it clearer what integers are supposed to represent
23− in this library. Use [`Char.toCode`](docs/Char.elm#toCode) and
23+in this library. Use [`Char.toCode`](docs/Char.elm#toCode) and
24− [`Char.fromCode`](/docs/Char.elm#fromCode) to convert key codes to characters.
24+[`Char.fromCode`](/docs/Char.elm#fromCode) to convert key codes to characters.
25− Use the uppercase character with `toCode`. -}
25+Use the uppercase character with `toCode`.
26+-}
26type KeyCode = Int
27type KeyCode = Int
27
28
28{-| Custom key directions to support different locales. The order is up, down,
29{-| Custom key directions to support different locales. The order is up, down,
29−left, right. -}
30+left, right.
30−-- The plan is to have a locale independent version of this function
31+-}
31−-- that uses the physical location of keys, but I don't know how to do it.
32directions : KeyCode -> KeyCode -> KeyCode -> KeyCode -> Signal { x:Int, y:Int }
32directions : KeyCode -> KeyCode -> KeyCode -> KeyCode -> Signal { x:Int, y:Int }
33directions = Native.Keyboard.directions
33directions = Native.Keyboard.directions
34
34
35{-| A signal of records indicating which arrow keys are pressed.
35{-| A signal of records indicating which arrow keys are pressed.
36
36
37− `{ x = 0, y = 0 }` when pressing no arrows.<br>
37+`{ x = 0, y = 0 }` when pressing no arrows.<br>
38− `{ x =-1, y = 0 }` when pressing the left arrow.<br>
38+`{ x =-1, y = 0 }` when pressing the left arrow.<br>
39− `{ x = 1, y = 1 }` when pressing the up and right arrows.<br>
39+`{ x = 1, y = 1 }` when pressing the up and right arrows.<br>
40− `{ x = 0, y =-1 }` when pressing the down, left, and right arrows.
40+`{ x = 0, y =-1 }` when pressing the down, left, and right arrows.
41-}
41-}
42arrows : Signal { x:Int, y:Int }
42arrows : Signal { x:Int, y:Int }
43arrows = directions 38 40 37 39
43arrows = directions 38 40 37 39
44
44
45{-| Just like the arrows signal, but this uses keys w, a, s, and d,
45{-| Just like the arrows signal, but this uses keys w, a, s, and d,
46−which are common controls for many computer games. -}
46+which are common controls for many computer games.
47+-}
47wasd : Signal { x:Int, y:Int }
48wasd : Signal { x:Int, y:Int }
48wasd = directions 87 83 65 68
49wasd = directions 87 83 65 68
49
50
libraries/Random.elm−1
@@ -1,4 +1,3 @@
1−
2module Random where
1module Random where
3
2
4{-| Since the core of Elm is pure, randomness must be handled via signals.
3{-| Since the core of Elm is pure, randomness must be handled via signals.
libraries/Touch.elm+4−5
@@ -4,7 +4,7 @@ module Touch where
4include gestures that would be useful for both games and web-pages.
4include gestures that would be useful for both games and web-pages.
5
5
6# Touches
6# Touches
7−@docs touches
7+@docs Touch, touches
8
8
9# Gestures
9# Gestures
10@docs taps
10@docs taps
@@ -14,15 +14,14 @@ import Signal (Signal)
14import Native.Touch
14import Native.Touch
15import Time (Time)
15import Time (Time)
16
16
17−{-|
18−Every `Touch` has `xy` coordinates. It also has an identifier `id` to
17+{-| Every `Touch` has `xy` coordinates. It also has an identifier
19−distinguish one touch from another.
18+`id` to distinguish one touch from another.
20
19
21A touch also keeps info about the initial point and time of contact:
20A touch also keeps info about the initial point and time of contact:
22`x0`, `y0`, and `t0`. This helps compute more complicated gestures
21`x0`, `y0`, and `t0`. This helps compute more complicated gestures
23like taps, drags, and swipes which need to know about timing or direction.
22like taps, drags, and swipes which need to know about timing or direction.
24−type Touch = { x:Int, y:Int, id:Int, x0:Int, y0:Int, t0:Time }
25-}
23-}
24+type Touch = { x:Int, y:Int, id:Int, x0:Int, y0:Int, t0:Time }
26
25
27{-| A list of ongoing touches. -}
26{-| A list of ongoing touches. -}
28touches : Signal [Touch]
27touches : Signal [Touch]