|New on arc-wiki.git - lib/repage.arc|
Often you find yourself designing a web page where the most common actions are immediately displayed, but further actions (more rarely used) are accessed by clicking on a link. Alternatively, an action may require confirmation - for example, to verify if a blog post is to be deleted.
Most of the time, you want to display almost exactly the same page, but with the options expanded, or with a confirmation box. By using (repage ...), you can.
To use, just capture the page you want to display in a (repage ...) form. Then, set the parts you want to replace with (repage-point) forms.
For example, if you want to create some actions:
The current version does not work as expected when doing (repage-point (repage-link "foo" (repage-point (repage-link "bar" (prn "bar"))))). I'm attempting to explain why currently in the source although my explanation could be wrong.
(tag b (prn "Actions: "))
; generate the "more >>" link
(repage-link "more >>"
; gets expanded iff the link is pressed
(repage-back-link "less <<"))))))