From 81934ea4c2cf2260b6000e9be4d13e328204929a Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Thu, 30 Sep 2010 18:29:59 -0400 Subject: Demo improvements --- demo/counter.ur | 1 + demo/prose | 2 +- src/demo.sig | 2 ++ src/demo.sml | 4 ++++ src/main.mlton.sml | 3 +++ 5 files changed, 11 insertions(+), 1 deletion(-) diff --git a/demo/counter.ur b/demo/counter.ur index b11fc936..23768ad3 100644 --- a/demo/counter.ur +++ b/demo/counter.ur @@ -1,3 +1,4 @@ +(* Workhorse function, which [main] will call *) fun counter n = return Current counter: {[n]}
Increment
diff --git a/demo/prose b/demo/prose index df0ed0a9..1cc9a6ac 100644 --- a/demo/prose +++ b/demo/prose @@ -5,7 +5,7 @@
./configure
 make
 sudo make install
-urweb -demo /Demo demo

+urweb -noEmacs -demo /Demo demo

The -demo /Demo flag says that we want to build a demo application that expects its URIs to begin with /Demo. The final argument demo gives the path to a directory housing demo files. One of the files in that directory is prose, a file describing the different demo pieces with HTML. Some lines of prose have the form foo.urp, naming particular project files (with the extension .urp) in that directory.

diff --git a/src/demo.sig b/src/demo.sig index 5f5fa2bb..57154ed7 100644 --- a/src/demo.sig +++ b/src/demo.sig @@ -30,4 +30,6 @@ signature DEMO = sig val make : {prefix : string, dirname : string, guided : bool} -> unit val make' : {prefix : string, dirname : string, guided : bool} -> bool + val noEmacs : bool ref + end diff --git a/src/demo.sml b/src/demo.sml index 358815de..19632d0e 100644 --- a/src/demo.sml +++ b/src/demo.sml @@ -27,6 +27,8 @@ structure Demo :> DEMO = struct +val noEmacs = ref false + fun make' {prefix, dirname, guided} = let val prose = OS.Path.joinDirFile {dir = dirname, @@ -333,6 +335,8 @@ fun make' {prefix, dirname, guided} = else () end) + + val highlight = fn () => if !noEmacs then () else highlight () in if OS.Path.base file = "demo" then () diff --git a/src/main.mlton.sml b/src/main.mlton.sml index 33838c93..09b53c58 100644 --- a/src/main.mlton.sml +++ b/src/main.mlton.sml @@ -88,6 +88,9 @@ fun doArgs args = | "-moduleOf" :: fname :: _ => (print (Compiler.moduleOf fname ^ "\n"); OS.Process.exit OS.Process.success) + | "-noEmacs" :: rest => + (Demo.noEmacs := true; + doArgs rest) | arg :: rest => (if size arg > 0 andalso String.sub (arg, 0) = #"-" then raise Fail ("Unknown flag " ^ arg) -- cgit v1.2.3