#! lua
local div, table, tr, td in TAG
local navbox = \ (left, up, right)
 => table "" (tr "" {
     td "" (left);
     td "" (up);
     td "" (right);
       })
end -- function
local trg = "%s.html"
=> {
    paradiv = div [[class="parastyle"]];
    titleheader = div [[class="banner"]];
    header = div [[class="header"]];
    frame = \ (x)
      local hleft = div [[class="header_shadow_left"]]
      local hright = div [[class="header_shadow_right"]]
      local hmid = div [[class="header_content"]]
      local h = hleft (hright (hmid ( )))
      local cleft = div [[class="shadow_left"]]
      local cright = div [[class="shadow_right"]]
      local cmid = div [[class="body_content"]]
      local c = cleft (cright (cmid (x)))
      local fleft = div [[class="footer_shadow_left"]]
      local fright = div [[class="footer_shadow_right"]]
      local fmid = div [[class="footer_content"]]
      local f = fleft (fright (fmid ( )))
      => { h,c,f}
      end;
      nav = \ (n,ch)
       local N, y = #ch, [[contents]]
       local x = (n>1) and ch[n-1] or y
       local z = (n<N) and ch[n+1] or y
       local left = link (trg:format (x)) (n>1 and [[back]] or y)
       local up = link (trg:format (y)) (n>1 and n<N and y or "")
       local right = link (trg:format (z)) (n<N and [[next]] or y)
        => div [[class="nav"]] (navbox (left, up, right))
       end;
    }