diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/data/format/html.lux | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/stdlib/source/lux/data/format/html.lux b/stdlib/source/lux/data/format/html.lux index 0cf59690c..206485991 100644 --- a/stdlib/source/lux/data/format/html.lux +++ b/stdlib/source/lux/data/format/html.lux @@ -1,15 +1,17 @@ (.module: [lux (#- Meta Source comment and) + ["." function] [data ["." product] - ["." maybe] + ["." maybe ("#@." functor)] ["." text format] [collection - ["." list ("#;." functor fold)]]] - ["." function] + ["." list ("#@." functor fold)]]] [type abstract] + [host + ["." js]] [macro ["." template]] [world @@ -28,7 +30,7 @@ {#.doc "Attributes for an HTML tag."} (List [Text Text])) -(type: #export Script Text) +(type: #export Script js.Statement) (type: #export Target #Blank @@ -58,7 +60,7 @@ (def: attributes (-> Attributes Text) - (|>> (list;map (function (_ [key val]) + (|>> (list@map (function (_ [key val]) (format key "=" text.double-quote (..sanitize val) text.double-quote))) (text.join-with " "))) @@ -186,6 +188,7 @@ (def: #export (script attributes inline) (-> Attributes (Maybe Script) Meta) (|> inline + (maybe@map js.code) (maybe.default "") (..raw "script" attributes))) @@ -253,7 +256,7 @@ (def: (%polygon [first second third extra]) (Format Polygon) (|> (list& first second third extra) - (list;map %coord) + (list@map %coord) (text.join-with ..coord-separator))) (type: #export Shape @@ -289,13 +292,13 @@ (-> Attributes (List [Attributes Shape]) Image Image) ($_ ..and for - (case (list;map (product.uncurry ..area) areas) + (case (list@map (product.uncurry ..area) areas) #.Nil (..empty "map" attributes) (#.Cons head tail) (..tag "map" attributes - (list;fold (function.flip ..and) head tail))))) + (list@fold (function.flip ..and) head tail))))) (do-template [<name> <tag> <type>] [(def: #export <name> @@ -449,7 +452,7 @@ (def: #export (description-list attributes descriptions) (-> Attributes (List [Content Element]) Element) - (case (list;map (function (_ [term description]) + (case (list@map (function (_ [term description]) ($_ ..and (..term term) (..description description))) @@ -459,7 +462,7 @@ (#.Cons head tail) (..tag "dl" attributes - (list;fold (function.flip ..and) head tail)))) + (list@fold (function.flip ..and) head tail)))) (def: #export p ..paragraph) @@ -511,14 +514,14 @@ (def: #export (table attributes caption columns headers rows footer) (-> Attributes (Maybe Content) (Maybe Column) Header (List Cell) (Maybe Cell) Element) (let [head (..table-head (..table-row headers)) - content (case (list;map table-row rows) + content (case (list@map table-row rows) #.Nil head (#.Cons first rest) (..and head (..table-body - (list;fold (function.flip ..and) first rest)))) + (list@fold (function.flip ..and) first rest)))) content (case footer #.None content |