NB. Some simple html tools
tag =: dyad define
'<',x.,'>',y.,'',x.,'>'
)
NB. 'html' tag 'hi there'
html =: 'html'&tag
NB. html' hi there'
title =: 'title'&tag
head =:'head'&tag
NB. head title'A Simple HTML Example'
body =: 'body'&tag
h1 =:'h1'&tag
p =: 'p'&tag
NB. html (head title'A Simple HTML Example'),body (h1 'HTML is Easy To Learn'),(p 'Welcome to the world of HTML. This is the first paragraph. While short it is still a paragraph'),p 'And this is the second paragraph.'
NB. (html (head title'A Simple HTML Example'),body (h1 'HTML is Easy To Learn'),(p 'Welcome to the world of HTML. This is the first paragraph. While short it is still a paragraph'),p 'And this is the second paragraph.') write 'foo2.html'
tag
tag =: dyad define
'<',x.,'>',y.,'',x.,'>',10{a.
)
NB. (html (head title'A Simple HTML Example'),body (h1 'HTML is Easy To Learn'),(p 'Welcome to the world of HTML. This is the first paragraph. While short it is still a paragraph'),p 'And this is the second paragraph.') write 'foo2.html'
tag2 =: dyad define
if. 1=# x. do. (>x.)tag y.
else. '<',(>0{x.),' ',(>1{x.),'>',y.,'',(>0{x.),'>'
end.
)
NB. ('A';'HREF="MainStats.html"')tag2 'Maine'
NB. (<'p')tag2 'Hi there'