@@ -1,6 +1,19 @@
2module Text where
2module Text where
4+{-| Functions for displaying text
9+# Stylizing and displaying Text
10+@docs typeface, monospace, header, link, height, color, bold, italic, overline, underline, strikethrough, justified, centered, righted, text, plaintext
12+# Converting other elements to Text
4import open Basics
17import open Basics
5import Color (Color)
18import Color (Color)
6import Graphics.Element (Element, Three, Pos, ElementPrim, Properties)
19import Graphics.Element (Element, Three, Pos, ElementPrim, Properties)
@@ -10,84 +23,90 @@ import Native.Text
11data Text = Text
24data Text = Text
13−-- Convert a string into text which can be styled and displayed.
26+{-| Convert a string into text which can be styled and displayed. -}
14toText : String -> Text
27toText : String -> Text
15toText = Native.Text.toText
28toText = Native.Text.toText
17−-- Set the typeface of some text. The first argument should be a comma separated listing of the desired typefaces
30+{-| Set the typeface of some text. The first argument should be a comma
31+separated listing of the desired typefaces
18−-- "helvetica, arial, sans-serif"
33+ "helvetica, arial, sans-serif"
19−-- Works the same as the CSS font-family property.
35+Works the same as the CSS font-family property.
20typeface : String -> Text -> Text
37typeface : String -> Text -> Text
21typeface = Native.Text.typeface
38typeface = Native.Text.typeface
23−-- Switch to a monospace typeface. Good for code snippets.
40+{-| Switch to a monospace typeface. Good for code snippets. -}
24monospace : Text -> Text
41monospace : Text -> Text
25monospace = Native.Text.monospace
42monospace = Native.Text.monospace
27−-- Make text big and noticable.
44+{-| Make text big and noticable. -}
28header : Text -> Text
45header : Text -> Text
29header = Native.Text.header
46header = Native.Text.header
31−-- Create a link.
48+{-| Create a link. -}
32link : String -> Text -> Text
49link : String -> Text -> Text
33link = Native.Text.link
50link = Native.Text.link
35−-- Set the height of text in pixels.
52+{-| Set the height of text in pixels. -}
36height : Float -> Text -> Text
53height : Float -> Text -> Text
37height = Native.Text.height
54height = Native.Text.height
39−-- Set the color of a string.
56+{-| Set the color of a string. -}
40color : Color -> Text -> Text
57color : Color -> Text -> Text
41color = Native.Text.color
58color = Native.Text.color
43−-- Make a string bold.
60+{-| Make a string bold. -}
44bold : Text -> Text
61bold : Text -> Text
45bold = Native.Text.bold
62bold = Native.Text.bold
47−-- Italicize a string.
64+{-| Italicize a string. -}
48italic : Text -> Text
65italic : Text -> Text
49italic = Native.Text.italic
66italic = Native.Text.italic
51−-- Draw a line above a string.
68+{-| Draw a line above a string. -}
52overline : Text -> Text
69overline : Text -> Text
53overline = Native.Text.overline
70overline = Native.Text.overline
55−-- Underline a string.
72+{-| Underline a string. -}
56underline : Text -> Text
73underline : Text -> Text
57underline = Native.Text.underline
74underline = Native.Text.underline
59−-- Draw a line through a string.
76+{-| Draw a line through a string. -}
60strikeThrough : Text -> Text
77strikeThrough : Text -> Text
61strikeThrough = Native.Text.strikeThrough
78strikeThrough = Native.Text.strikeThrough
63−-- Display justified, styled text.
80+{-| Display justified, styled text. -}
64justified : Text -> Element
81justified : Text -> Element
65justified = Native.Text.justified
82justified = Native.Text.justified
67−-- Display centered, styled text.
84+{-| Display centered, styled text. -}
68centered : Text -> Element
85centered : Text -> Element
69centered = Native.Text.centered
86centered = Native.Text.centered
71−-- Display right justified, styled text.
88+{-| Display right justified, styled text. -}
72righted : Text -> Element
89righted : Text -> Element
73righted = Native.Text.righted
90righted = Native.Text.righted
75−-- Display styled text.
92+{-| Display styled text. -}
76text : Text -> Element
93text : Text -> Element
77text = Native.Text.text
94text = Native.Text.text
79−-- Display a plain string.
96+{-| Display a plain string. -}
80plainText : String -> Element
97plainText : String -> Element
81plainText = Native.Text.plainText
98plainText = Native.Text.plainText
83−-- for internal use only
100+{-| for internal use only -}
84markdown : Element
101markdown : Element
85markdown = Native.Text.markdown
102markdown = Native.Text.markdown
87−-- Convert anything to it's textual representation and make it displayable in browser
104+{-| Convert anything to it's textual representation and make it displayable in
89−-- asText == text . monospace . show
107+ asText == text . monospace . show
91−-- Excellent for debugging.
109+Excellent for debugging.
92asText : a -> Element
111asText : a -> Element
93asText = Native.Text.asText
112asText = Native.Text.asText