Mercurial > urweb
annotate tests/urblog.ur @ 1906:0d2fdc2cc46c
Allow building in a separate build directory
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
---
Makefile.am | 30 +++---
src/c/Makefile.am | 2 +-
src/compiler.mlb | 2 +-
src/sources | 302 +++++++++++++++++++++++++++---------------------------
4 files changed, 168 insertions(+), 168 deletions(-)
author | Anders Kaseorg <andersk@mit.edu> |
---|---|
date | Fri, 22 Nov 2013 09:36:14 -0500 |
parents | 19e8e3d556d6 |
children |
rev | line source |
---|---|
adam@1443 | 1 table entry : { Id : int, Title : string, Created : time, Author : string, |
adam@1443 | 2 Body : string } |
adam@1443 | 3 PRIMARY KEY Id |
adam@1443 | 4 |
adam@1443 | 5 fun list () = |
adam@1443 | 6 rows <- queryX (SELECT * FROM entry) |
adam@1443 | 7 (fn row => |
adam@1443 | 8 <xml> |
adam@1443 | 9 <div> |
adam@1443 | 10 <h1>{[row.Entry.Title]}</h1><br /> |
adam@1443 | 11 <h2>By {[row.Entry.Author]} at {[row.Entry.Created]}</h2> |
adam@1443 | 12 <p>{[row.Entry.Body]}</p> |
adam@1443 | 13 </div> |
adam@1443 | 14 </xml> |
adam@1443 | 15 ); |
adam@1443 | 16 return |
adam@1443 | 17 <xml> |
adam@1443 | 18 <head> |
adam@1443 | 19 <title>All Entries</title> |
adam@1443 | 20 </head> |
adam@1443 | 21 <body> |
adam@1443 | 22 <h1>All Entries</h1> |
adam@1443 | 23 {rows} |
adam@1443 | 24 </body> |
adam@1443 | 25 </xml> |
adam@1443 | 26 |
adam@1443 | 27 fun main () = return <xml> |
adam@1443 | 28 <head> |
adam@1443 | 29 <title>UrBlog</title> |
adam@1443 | 30 </head> |
adam@1443 | 31 |
adam@1443 | 32 <body> |
adam@1443 | 33 <h1>UrBlog</h1> |
adam@1443 | 34 </body> |
adam@1443 | 35 </xml> |