on master help sign in
Minor tweaks to docs
commit8ff581471e0449b7d800b6c2c87676852063bc6a authorEvan Czaplicki <info@elm-lang.org> dateTue 10 Sep 2013, 18:21 (13 years ago) parentc18bebe
5 files changed+26−31
libraries/Color.elm+8−8 libraries/JavaScript.elm+2−6 libraries/Keyboard.elm+12−11 libraries/Random.elm−1 libraries/Touch.elm+4−5
libraries/Color.elm+8−8
@@ -21,7 +21,7 @@ which provides aesthetically reasonable defaults for colors. Each color also
2121comes with a light and dark version.
2222
2323### Standard
24−@docs red, orange, yellow, green, blue, purple, brown, black, white
24+@docs red, orange, yellow, green, blue, purple, brown
2525
2626### Light
2727@docs lightRed, lightOrange, lightYellow, lightGreen, lightBlue, lightPurple,
@@ -31,14 +31,14 @@ comes with a light and dark version.
3131@docs darkRed, darkOrange, darkYellow, darkGreen, darkBlue, darkPurple,
3232 darkBrown
3333
34−### Grays
35−These six colors are a compatible series of shades of gray. White and black are
36−listed above.
37−@docs lightGray, gray, darkGray, lightCharcoal, charcoal, darkCharcoal
34+### Eight Shades of Grey
35+These colors are a compatible series of shades of grey, fitting nicely
36+with the Tango palette.
37+@docs white, lightGrey, grey, darkGrey, lightCharcoal, charcoal, darkCharcoal, black
3838
39−#### Greys
40−These are identical to the *gray* versions.
41−@docs lightGrey, grey, darkGrey
39+These are identical to the *grey* versions. It seems the spelling is regional, but
40+that has never helped me remember which one I should be writing.
41+@docs lightGray, gray, darkGray
4242
4343-}
4444
libraries/JavaScript.elm+2−6
@@ -11,8 +11,6 @@ integration.
1111# JavaScript from Elm
1212@docs fromString, fromInt, fromFloat, fromBool fromList
1313
14−-}
15−{-
1614# DOM Nodes and Elements
1715@docs toElement, fromElement
1816-}
@@ -27,7 +25,7 @@ data JSArray a = JSArray a
2725data JSDomNode = JSDomNode
2826data JSObject = JSObject
2927
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) -}
3129toList : JSArray a -> [a]
3230toList = Native.JavaScript.toList
3331
@@ -44,7 +42,7 @@ toString : JSString -> String
4442toString = Native.JavaScript.toString
4543
4644
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. -}
4846fromList : [a] -> JSArray a
4947fromList = Native.JavaScript.fromList
5048
@@ -60,7 +58,6 @@ fromBool = Native.JavaScript.fromBool
6058fromString : String -> JSString
6159fromString = Native.JavaScript.fromString
6260
63−{--
6461{-| Turn an `Element` into a DOM node. -}
6562fromElement : Element -> JSDomNode
6663fromElement = Native.JavaScript.fromElement
@@ -69,4 +66,3 @@ fromElement = Native.JavaScript.fromElement
6966using the normal `width` and `height` functions. -}
7067toElement : Int -> Int -> JSDomNode -> Element
7168toElement = Native.JavaScript.toElement
72−--}
libraries/Keyboard.elm+12−11
@@ -20,30 +20,31 @@ import Signal (Signal)
2020import Native.Keyboard
2121
2222{-| Type alias to make it clearer what integers are supposed to represent
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.
25− Use the uppercase character with `toCode`. -}
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.
25+Use the uppercase character with `toCode`.
26+-}
2627type KeyCode = Int
2728
2829{-| Custom key directions to support different locales. The order is up, down,
29−left, right. -}
30−-- The plan is to have a locale independent version of this function
31−-- that uses the physical location of keys, but I don't know how to do it.
30+left, right.
31+-}
3232directions : KeyCode -> KeyCode -> KeyCode -> KeyCode -> Signal { x:Int, y:Int }
3333directions = Native.Keyboard.directions
3434
3535{-| A signal of records indicating which arrow keys are pressed.
3636
37− `{ x = 0, y = 0 }` when pressing no arrows.<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>
40− `{ x = 0, y =-1 }` when pressing the down, left, and right arrows.
37+`{ x = 0, y = 0 }` when pressing no arrows.<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>
40+`{ x = 0, y =-1 }` when pressing the down, left, and right arrows.
4141-}
4242arrows : Signal { x:Int, y:Int }
4343arrows = directions 38 40 37 39
4444
4545{-| 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+-}
4748wasd : Signal { x:Int, y:Int }
4849wasd = directions 87 83 65 68
4950
libraries/Random.elm−1
@@ -1,4 +1,3 @@
1−
21module Random where
32
43{-| 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
44include gestures that would be useful for both games and web-pages.
55
66# Touches
7−@docs touches
7+@docs Touch, touches
88
99# Gestures
1010@docs taps
@@ -14,15 +14,14 @@ import Signal (Signal)
1414import Native.Touch
1515import Time (Time)
1616
17−{-|
18−Every `Touch` has `xy` coordinates. It also has an identifier `id` to
19−distinguish one touch from another.
17+{-| Every `Touch` has `xy` coordinates. It also has an identifier
18+`id` to distinguish one touch from another.
2019
2120A touch also keeps info about the initial point and time of contact:
2221`x0`, `y0`, and `t0`. This helps compute more complicated gestures
2322like 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 }
2523-}
24+type Touch = { x:Int, y:Int, id:Int, x0:Int, y0:Int, t0:Time }
2625
2726{-| A list of ongoing touches. -}
2827touches : Signal [Touch]