on master help sign in
Convert Text docs
commit7b86205c4f93cfba90a2a7dfc532b6d32187b9f1 authorJustin Leitgeb <justin@stackbuilders.com> dateMon 9 Sep 2013, 22:57 (13 years ago) parent2edcced
1 file changed+44−25
libraries/Text.elm+44−25
libraries/Text.elm+44−25
@@ -1,6 +1,19 @@
11
22module Text where
33
4+{-| Functions for displaying text
5+
6+# Constructors
7+@docs toText
8+
9+# Stylizing and displaying Text
10+@docs typeface, monospace, header, link, height, color, bold, italic, overline, underline, strikethrough, justified, centered, righted, text, plaintext
11+
12+# Converting other elements to Text
13+@docs asText
14+
15+-}
16+
417import open Basics
518import Color (Color)
619import Graphics.Element (Element, Three, Pos, ElementPrim, Properties)
@@ -10,84 +23,90 @@ import Native.Text
1023
1124data Text = Text
1225
13−-- Convert a string into text which can be styled and displayed.
26+{-| Convert a string into text which can be styled and displayed. -}
1427toText : String -> Text
1528toText = Native.Text.toText
1629
17−-- Set the typeface of some text. The first argument should be a comma separated listing of the desired typefaces
18−-- "helvetica, arial, sans-serif"
19−-- Works the same as the CSS font-family property.
30+{-| Set the typeface of some text. The first argument should be a comma
31+separated listing of the desired typefaces
32+
33+ "helvetica, arial, sans-serif"
34+
35+Works the same as the CSS font-family property.
36+-}
2037typeface : String -> Text -> Text
2138typeface = Native.Text.typeface
2239
23−-- Switch to a monospace typeface. Good for code snippets.
40+{-| Switch to a monospace typeface. Good for code snippets. -}
2441monospace : Text -> Text
2542monospace = Native.Text.monospace
2643
27−-- Make text big and noticable.
44+{-| Make text big and noticable. -}
2845header : Text -> Text
2946header = Native.Text.header
3047
31−-- Create a link.
48+{-| Create a link. -}
3249link : String -> Text -> Text
3350link = Native.Text.link
3451
35−-- Set the height of text in pixels.
52+{-| Set the height of text in pixels. -}
3653height : Float -> Text -> Text
3754height = Native.Text.height
3855
39−-- Set the color of a string.
56+{-| Set the color of a string. -}
4057color : Color -> Text -> Text
4158color = Native.Text.color
4259
43−-- Make a string bold.
60+{-| Make a string bold. -}
4461bold : Text -> Text
4562bold = Native.Text.bold
4663
47−-- Italicize a string.
64+{-| Italicize a string. -}
4865italic : Text -> Text
4966italic = Native.Text.italic
5067
51−-- Draw a line above a string.
68+{-| Draw a line above a string. -}
5269overline : Text -> Text
5370overline = Native.Text.overline
5471
55−-- Underline a string.
72+{-| Underline a string. -}
5673underline : Text -> Text
5774underline = Native.Text.underline
5875
59−-- Draw a line through a string.
76+{-| Draw a line through a string. -}
6077strikeThrough : Text -> Text
6178strikeThrough = Native.Text.strikeThrough
6279
63−-- Display justified, styled text.
80+{-| Display justified, styled text. -}
6481justified : Text -> Element
6582justified = Native.Text.justified
6683
67−-- Display centered, styled text.
84+{-| Display centered, styled text. -}
6885centered : Text -> Element
6986centered = Native.Text.centered
7087
71−-- Display right justified, styled text.
88+{-| Display right justified, styled text. -}
7289righted : Text -> Element
7390righted = Native.Text.righted
7491
75−-- Display styled text.
92+{-| Display styled text. -}
7693text : Text -> Element
7794text = Native.Text.text
7895
79−-- Display a plain string.
96+{-| Display a plain string. -}
8097plainText : String -> Element
8198plainText = Native.Text.plainText
8299
83−-- for internal use only
100+{-| for internal use only -}
84101markdown : Element
85102markdown = Native.Text.markdown
86103
87−-- Convert anything to it's textual representation and make it displayable in browser
88−--
89−-- asText == text . monospace . show
90−--
91−-- Excellent for debugging.
104+{-| Convert anything to it's textual representation and make it displayable in
105+browser
106+
107+ asText == text . monospace . show
108+
109+Excellent for debugging.
110+-}
92111asText : a -> Element
93112asText = Native.Text.asText