/
HtmlTemplate.purs
51 lines (27 loc) · 1.41 KB
/
HtmlTemplate.purs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
module Control.Google.Apps.Html.HtmlTemplate (
evaluate,
getCode,
getCodeWithComments,
getRawContent
) where
import Effect (Effect)
import Data.Google.Apps.Html.HtmlOutput as HtmlHtmlOutput
import Data.Google.Apps.Html.HtmlTemplate as HtmlHtmlTemplate
foreign import evaluateImpl :: HtmlHtmlTemplate.HtmlTemplate -> Effect HtmlHtmlOutput.HtmlOutput
-- | Evaluates this template and returns an HtmlOutput object.
evaluate :: HtmlHtmlTemplate.HtmlTemplate -> Effect HtmlHtmlOutput.HtmlOutput
evaluate p' = evaluateImpl p'
foreign import getCodeImpl :: HtmlHtmlTemplate.HtmlTemplate -> Effect String
-- | Generates a string of JavaScript code, based on the template file, that can
-- | be evaluated.
getCode :: HtmlHtmlTemplate.HtmlTemplate -> Effect String
getCode p' = getCodeImpl p'
foreign import getCodeWithCommentsImpl :: HtmlHtmlTemplate.HtmlTemplate -> Effect String
-- | Generates a string of JavaScript code that can be evaluated, with each line
-- | of the code containing the original line from the template as a comment.
getCodeWithComments :: HtmlHtmlTemplate.HtmlTemplate -> Effect String
getCodeWithComments p' = getCodeWithCommentsImpl p'
foreign import getRawContentImpl :: HtmlHtmlTemplate.HtmlTemplate -> Effect String
-- | Returns the unprocessed content of this template.
getRawContent :: HtmlHtmlTemplate.HtmlTemplate -> Effect String
getRawContent p' = getRawContentImpl p'