mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
some more functions in prelude/HTML
This commit is contained in:
@@ -5,4 +5,20 @@ resource HTML = open Prelude in {
|
||||
intag : Str -> Str -> Str = \t,s -> tag t ++ s ++ endtag t ;
|
||||
intagAttr : Str -> Str -> Str -> Str =
|
||||
\t,a,s -> ("<" + t) ++ (a + ">") ++ s ++ endtag t ;
|
||||
|
||||
-- common formatting
|
||||
|
||||
document : Str -> Str = \s ->
|
||||
intag "html" (intag "head" ("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />") ++ intag "body" s) ;
|
||||
|
||||
paragraph : Str -> Str = intag "p" ;
|
||||
heading1 : Str -> Str = intag "h1" ;
|
||||
heading2 : Str -> Str = intag "h2" ;
|
||||
heading3 : Str -> Str = intag "h3" ;
|
||||
|
||||
-- for building tables
|
||||
frameTable : Str -> Str = intagAttr "table" ("rules=all border=yes") ;
|
||||
tr : Str -> Str = intag "tr" ;
|
||||
td : Str -> Str = intag "td" ;
|
||||
th : Str -> Str = intag "th" ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user