Warning: This module uses immediate
macros which are known to cause problems. Do yourself a favor and import the module as from htmlgen import nil
and then fully qualify the macros.
This module implements a simple XML and HTML code generator. Each commonly used HTML tag has a corresponding macro that generates a string with its HTML representation.
Example:
var nim = "Nim" echo h1(a(href="http://nim-lang.org", nim))
Writes the string:
<h1><a href="http://nim-lang.org">Nim</a></h1>
coreAttr = " id class title style "
eventAttr = " onclick ondblclick onmousedown onmouseup onmouseover onmousemove onmouseout onkeypress onkeydown onkeyup onload "
commonAttr = " id class title style onclick ondblclick onmousedown onmouseup onmouseover onmousemove onmouseout onkeypress onkeydown onkeyup onload "
proc xmlCheckedTag(e: NimNode; tag: string; optAttr = ""; reqAttr = ""; isLeaf = false): NimNode {. compileTime, raises: [], tags: [].}
macro a(e: varargs[untyped]): untyped
a
element. macro acronym(e: varargs[untyped]): untyped
acronym
element. macro address(e: varargs[untyped]): untyped
address
element. macro area(e: varargs[untyped]): untyped
area
element. macro b(e: varargs[untyped]): untyped
b
element. macro base(e: varargs[untyped]): untyped
base
element. macro big(e: varargs[untyped]): untyped
big
element. macro blockquote(e: varargs[untyped]): untyped
blockquote
element. macro body(e: varargs[untyped]): untyped
body
element. macro br(e: varargs[untyped]): untyped
br
element. button
element. caption
element. macro cite(e: varargs[untyped]): untyped
cite
element. macro code(e: varargs[untyped]): untyped
code
element. macro col(e: varargs[untyped]): untyped
col
element. macro colgroup(e: varargs[untyped]): untyped
colgroup
element. macro dd(e: varargs[untyped]): untyped
dd
element. macro del(e: varargs[untyped]): untyped
del
element. macro dfn(e: varargs[untyped]): untyped
dfn
element. macro `div`(e: varargs[untyped]): untyped
div
element. macro dl(e: varargs[untyped]): untyped
dl
element. macro dt(e: varargs[untyped]): untyped
dt
element. macro em(e: varargs[untyped]): untyped
em
element. macro fieldset(e: varargs[untyped]): untyped
fieldset
element. macro form(e: varargs[untyped]): untyped
form
element. macro h1(e: varargs[untyped]): untyped
h1
element. macro h2(e: varargs[untyped]): untyped
h2
element. macro h3(e: varargs[untyped]): untyped
h3
element. macro h4(e: varargs[untyped]): untyped
h4
element. macro h5(e: varargs[untyped]): untyped
h5
element. macro h6(e: varargs[untyped]): untyped
h6
element. macro head(e: varargs[untyped]): untyped
head
element. macro html(e: varargs[untyped]): untyped
html
element. macro hr(): untyped
hr
element. macro i(e: varargs[untyped]): untyped
i
element. macro img(e: varargs[untyped]): untyped
img
element. macro input(e: varargs[untyped]): untyped
input
element. macro ins(e: varargs[untyped]): untyped
ins
element. macro kbd(e: varargs[untyped]): untyped
kbd
element. macro label(e: varargs[untyped]): untyped
label
element. macro legend(e: varargs[untyped]): untyped
legend
element. macro li(e: varargs[untyped]): untyped
li
element. macro link(e: varargs[untyped]): untyped
link
element. macro map(e: varargs[untyped]): untyped
map
element. macro meta(e: varargs[untyped]): untyped
meta
element. macro noscript(e: varargs[untyped]): untyped
noscript
element. macro `object`(e: varargs[untyped]): untyped
object
element. macro ol(e: varargs[untyped]): untyped
ol
element. macro optgroup(e: varargs[untyped]): untyped
optgroup
element. macro option(e: varargs[untyped]): untyped
option
element. macro p(e: varargs[untyped]): untyped
p
element. macro param(e: varargs[untyped]): untyped
param
element. macro pre(e: varargs[untyped]): untyped
pre
element. macro q(e: varargs[untyped]): untyped
q
element. macro samp(e: varargs[untyped]): untyped
samp
element. macro script(e: varargs[untyped]): untyped
script
element. macro select(e: varargs[untyped]): untyped
select
element. macro small(e: varargs[untyped]): untyped
small
element. macro span(e: varargs[untyped]): untyped
span
element. macro strong(e: varargs[untyped]): untyped
strong
element. macro style(e: varargs[untyped]): untyped
style
element. macro sub(e: varargs[untyped]): untyped
sub
element. macro sup(e: varargs[untyped]): untyped
sup
element. macro table(e: varargs[untyped]): untyped
table
element. macro tbody(e: varargs[untyped]): untyped
tbody
element. macro td(e: varargs[untyped]): untyped
td
element. macro textarea(e: varargs[untyped]): untyped
textarea
element. macro tfoot(e: varargs[untyped]): untyped
tfoot
element. macro th(e: varargs[untyped]): untyped
th
element. macro thead(e: varargs[untyped]): untyped
thead
element. macro title(e: varargs[untyped]): untyped
title
element. macro tr(e: varargs[untyped]): untyped
tr
element. macro tt(e: varargs[untyped]): untyped
tt
element. macro ul(e: varargs[untyped]): untyped
ul
element. macro `var`(e: varargs[untyped]): untyped
var
element.
© 2006–2017 Andreas Rumpf
Licensed under the MIT License.
https://nim-lang.org/docs/htmlgen.html