:Class Index : MiPage
:Include #.HTMLInput
:Field Public ExFile←'' ⍝ Examples file to show
:Field Public Action←'Reset' ⍝ buttons to show which examples file menu to show
∇ Render req;links;hdr;btns;examples;html
:Access Public
DoAction
html←'h2'Enclose'Welcome to MiServer! Learn APL & Write Web Pages with it.'
html,←'p'Enclose'Links Written in APL to teach APL including live practice & applications all in APL. '
html,←'p'Enclose'APL: Elegant, Concise, Powerful, Logical. Click on Orange Dragon to see how I wrote this web page in APL.'
html,←'<li><a href="JBgames/TamS/AplExamples.pdf">APL Lessons & Examples to try: PDF by Jerry M Brennan 68 pages (revised 5/28/2020)</a></li>'
:If 0=⍴,ExFile ⍝ If no file selected show buttons to select an ExFile(example file) to show
btns←'Action'∘Submit¨'All' 'IntroLive' 'Math A Magic' 'Math' 'Statistics' 'Games' 'Web' 'Reset'
:Else ⍝ Else show selected ExFile(example file)
examples←(#.XML.ToNS #.Files.GetText #.Boot.AppRoot,'Examples/',ExFile,'.xml').Examples
html,←BR,Table(↑{(('a href="',⍵.path,'"')Enclose ⍵.name)⍵.description}¨examples)'class="exampletable"'
btns←'' ⋄ Action←'Reset' ⍝ no need to show any buttons or do any more Actions.
:End
html←html,req('post'Form)btns
html,←'<br>Other Resources:<br><li><a href="http://tryapl.org">Dyalog: tryAPL.org interactive/introductory website & free educational download</a></li>'
html,←'<li><a href="http://aplwiki.com">APL Wiki with extensive resources & tutorials</a></li>'
html,←'<li><a href="http://dyalog.com/uploads/documents/MasteringDyalogAPL.pdf">APL Tutorial Manual: Mastering Dyalog APL: A Complete Introduction 800+ pages (pdf)</a></li>'
html,←'<li><a href="http://tutorial.dyalog.com">Detailed Dyalog APL tutorial you can try.</a></li>'
req.Return html
∇
∇ DoAction
:Select Action
:Case 'All' ⋄ ExFile←'Examples'
:Case 'IntroLive' ⋄ ExFile←'ExamplesIntroLive'
:Case 'Math A Magic' ⋄ ExFile←'ExamplesMathAMagic'
:Case 'Math' ⋄ ExFile←'ExamplesMath'
:Case 'Statistics' ⋄ ExFile←'ExamplesStat'
:Case 'Games' ⋄ ExFile←'ExamplesGames'
:Case 'Web' ⋄ ExFile←'ExamplesWeb'
:Else ⋄ Action←'Reset' ⋄ ExFile←''
:EndSelect
∇
:EndClass