examples: move Html Roc files into platform dir

This commit is contained in:
Brian Carroll 2022-08-28 14:26:00 +01:00
parent 2af152dfe2
commit c1a38bc400
No known key found for this signature in database
GPG Key ID: 5C7B2EC4101703C0
2 changed files with 9 additions and 2 deletions

View File

@ -136,8 +136,8 @@ text = Text
## Define a non-standard HTML Element
##
## You can use this to add elements that are not already supported.
## For example, if you wanted to add some 90's nostalgia to your
## web page, you could bring back the obsolete <blink> element:
## For example, you could bring back the obsolete <blink> element,
## and add some 90's nostalgia to your web page!
##
## blink : List Attribute, List Node -> Node
## blink = element "blink"
@ -166,12 +166,19 @@ nodeSize = \node ->
Element _ size _ _ ->
size
## Render a Node to an HTML string
##
## The output has no whitespace between nodes, to make it small.
## This is intended for generating full HTML documents, so it
## automatically adds `<!DOCTYPE html>` to the start of the string.
## See also `renderWithoutDocType`.
render : Node -> Str
render = \node ->
buffer = Str.reserve "<!DOCTYPE html>" (nodeSize node)
renderHelp buffer node
## Render a Node to a string, without a DOCTYPE tag
renderWithoutDocType : Node -> Str
renderWithoutDocType = \node ->
buffer = Str.reserve "" (nodeSize node)