on c19ccfe help sign in
elk/libraries/Text.elm
83 lines 1.9 kB history raw
2module Text where
4import open Color
5import Native.Text as Native
7-- Convert a string into text which can be styled and displayed.
8toText : String -> Text
9toText = Native.toText
11-- Set the typeface of some text. The first argument should be a comma separated listing of the desired typefaces
12-- "helvetica, arial, sans-serif"
13-- Works the same as the CSS font-family property.
14typeface : String -> Text -> Text
15typeface = Native.typeface
17-- Switch to a monospace typeface. Good for code snippets.
18monospace : Text -> Text
19monospace = Native.monospace
21-- Make text big and noticable.
22header : Text -> Text
23header = Native.header
25-- Create a link.
26link : String -> Text -> Text
27link = Native.link
29-- Set the height of text in pixels.
30height : Float -> Text -> Text
31height = Native.height
33-- Set the color of a string.
34color : Color -> Text -> Text
35color = Native.color
37-- Make a string bold.
38bold : Text -> Text
39bold = Native.bold
41-- Italicize a string.
42italic : Text -> Text
43italic = Native.italic
45-- Draw a line above a string.
46overline : Text -> Text
47overline = Native.overline
49-- Underline a string.
50underline : Text -> Text
51underline = Native.underline
53-- Draw a line through a string.
54strikeThrough : Text -> Text
55strikeThrough = Native.strikeThrough
57-- Display justified, styled text.
58justified : Text -> Element
59justified = Native.justified
61-- Display centered, styled text.
62centered : Text -> Element
63centered = Native.centered
65-- Display right justified, styled text.
66righted : Text -> Element
67righted = Native.righted
69-- Display styled text.
70text : Text -> Element
71text = Native.text
73-- Display a plain string.
74plainText : String -> Element
75plainText = Native.plainText
77-- Convert anything to it's textual representation and make it displayable in browser
78--
79-- asText == text . monospace . show
80--
81-- Excellent for debugging.
82asText : a -> Element
83asText = Native.asText