Differences between revisions 4 and 5
Revision 4 as of 2008-02-26 15:21:30
Size: 694
Editor: anonymous
Comment:
Revision 5 as of 2008-02-26 15:34:22
Size: 873
Editor: anonymous
Comment:
Deletions are marked like this. Additions are marked like this.
Line 14: Line 14:
[1] body←'body'tag('h1'tag'"Hello World with APL in HTML'),('h2'tag'hello...'),tag'...wor [1] body←'body'tag('h1'tag'"Hello World with APL in HTML'),('h2'tag'hello...'),tag'...world'
Line 19: Line 19:
}}}

{{{
<html>
<head>
<title>Hello world with APL</title>
</head>
<body>
<h1>"Hello World with APL in HTML</h1>
<h2>hello...</h2>
<p>...world</p>
</body>
</html>

tag←{
     ⍺←'p'
     0∊⍴⍵:''
     (tg style)←{⎕ML←1
         ' '∊⍵:⍵{(⍵↑⍺)(⍵↓⍺)}¯1+⍵⍳' '
         ⍵''}⍺
     '<',tg,style,'>',(('<'=1⍴⍵)/nl),⍵,'</',tg,'>',nl
 }

     ∇ CreateHtml;htmlCode;body;head
[1]    body←'body'tag('h1'tag'"Hello World with APL in HTML'),('h2'tag'hello...'),tag'...world'
[2]    head←'head'tag('title'tag'Hello world with APL'),(''tag'')
[3]    htmlCode←'html'tag head,body
[4]    htmlCode{(⎕NUNTIE ⍵){}⍺ ⎕NAPPEND ⍵}'helloworld.html'⎕NCREATE 0

<html>
<head>
<title>Hello world with APL</title>
</head>
<body>
<h1>"Hello World with APL in HTML</h1>
<h2>hello...</h2>
<p>...world</p>
</body>
</html>

attachment:helloworldhtml.jpg

Page created by Phil Last at 2008-02-26

CategoryHelloWorld CategoryDyalog

HelloWorldHtml (last edited 2017-02-16 19:18:46 by KaiJaeger)