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 = " accesskey class contenteditable dir hidden id lang spellcheck style tabindex title translate "
eventAttr = "onabort onblur oncancel oncanplay oncanplaythrough onchange onclick oncuechange ondblclick ondurationchange onemptied onended onerror onfocus oninput oninvalid onkeydown onkeypress onkeyup onload onloadeddata onloadedmetadata onloadstart onmousedown onmouseenter onmouseleave onmousemove onmouseout onmouseover onmouseup onmousewheel onpause onplay onplaying onprogress onratechange onreset onresize onscroll onseeked onseeking onselect onshow onstalled onsubmit onsuspend ontimeupdate ontoggle onvolumechange onwaiting "
ariaAttr = " role "
commonAttr = " accesskey class contenteditable dir hidden id lang spellcheck style tabindex title translate onabort onblur oncancel oncanplay oncanplaythrough onchange onclick oncuechange ondblclick ondurationchange onemptied onended onerror onfocus oninput oninvalid onkeydown onkeypress onkeyup onload onloadeddata onloadedmetadata onloadstart onmousedown onmouseenter onmouseleave onmousemove onmouseout onmouseover onmouseup onmousewheel onpause onplay onplaying onprogress onratechange onreset onresize onscroll onseeked onseeking onselect onshow onstalled onsubmit onsuspend ontimeupdate ontoggle onvolumechange onwaiting role "
proc xmlCheckedTag(e: NimNode; tag: string; optAttr = ""; reqAttr = ""; isLeaf = false): NimNode {...}{. compileTime, raises: [], tags: [].}
macro a(e: varargs[untyped]): untyped
a
element. macro abbr(e: varargs[untyped]): untyped
abbr
element. macro address(e: varargs[untyped]): untyped
address
element. macro area(e: varargs[untyped]): untyped
area
element. macro article(e: varargs[untyped]): untyped
article
element. macro aside(e: varargs[untyped]): untyped
aside
element. macro audio(e: varargs[untyped]): untyped
audio
element. macro b(e: varargs[untyped]): untyped
b
element. macro base(e: varargs[untyped]): untyped
base
element. macro bdi(e: varargs[untyped]): untyped
bdi
element. macro bdo(e: varargs[untyped]): untyped
bdo
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. macro button(e: varargs[untyped]): untyped
button
element. macro canvas(e: varargs[untyped]): untyped
canvas
element. macro caption(e: varargs[untyped]): untyped
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 data(e: varargs[untyped]): untyped
data
element. macro datalist(e: varargs[untyped]): untyped
datalist
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 embed(e: varargs[untyped]): untyped
embed
element. macro fieldset(e: varargs[untyped]): untyped
fieldset
element. macro figure(e: varargs[untyped]): untyped
figure
element. macro figcaption(e: varargs[untyped]): untyped
figcaption
element. macro footer(e: varargs[untyped]): untyped
footer
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 header(e: varargs[untyped]): untyped
header
element. macro html(e: varargs[untyped]): untyped
html
element. macro hr(): untyped
hr
element. macro i(e: varargs[untyped]): untyped
i
element. macro iframe(e: varargs[untyped]): untyped
iframe
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 keygen(e: varargs[untyped]): untyped
keygen
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 main(e: varargs[untyped]): untyped
main
element. macro map(e: varargs[untyped]): untyped
map
element. macro mark(e: varargs[untyped]): untyped
mark
element. macro meta(e: varargs[untyped]): untyped
meta
element. macro meter(e: varargs[untyped]): untyped
meter
element. macro nav(e: varargs[untyped]): untyped
nav
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 output(e: varargs[untyped]): untyped
output
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 progress(e: varargs[untyped]): untyped
progress
element. macro q(e: varargs[untyped]): untyped
q
element. macro rb(e: varargs[untyped]): untyped
rb
element. macro rp(e: varargs[untyped]): untyped
rp
element. macro rt(e: varargs[untyped]): untyped
rt
element. macro rtc(e: varargs[untyped]): untyped
rtc
element. macro ruby(e: varargs[untyped]): untyped
ruby
element. macro s(e: varargs[untyped]): untyped
s
element. macro samp(e: varargs[untyped]): untyped
samp
element. macro script(e: varargs[untyped]): untyped
script
element. macro section(e: varargs[untyped]): untyped
section
element. macro select(e: varargs[untyped]): untyped
select
element. macro small(e: varargs[untyped]): untyped
small
element. macro source(e: varargs[untyped]): untyped
source
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 `template`(e: varargs[untyped]): untyped
template
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 time(e: varargs[untyped]): untyped
time
element. macro title(e: varargs[untyped]): untyped
title
element. macro tr(e: varargs[untyped]): untyped
tr
element. macro track(e: varargs[untyped]): untyped
track
element. macro tt(e: varargs[untyped]): untyped
tt
element. macro u(e: varargs[untyped]): untyped
u
element. macro ul(e: varargs[untyped]): untyped
ul
element. macro `var`(e: varargs[untyped]): untyped
var
element. macro video(e: varargs[untyped]): untyped
video
element. macro wbr(e: varargs[untyped]): untyped
wbr
element.
© 2006–2018 Andreas Rumpf
Licensed under the MIT License.
https://nim-lang.org/docs/htmlgen.html