comparison src/demo.sml @ 943:e2194a6793ae

Fix JavaScript char literals; don't generate demo links to nonexistent files
author Adam Chlipala <adamc@hcoop.net>
date Tue, 15 Sep 2009 13:07:57 -0400
parents 8f2159040bbb
children 93315ac00394
comparison
equal deleted inserted replaced
942:280f81731426 943:e2194a6793ae
195 let 195 let
196 val src = OS.Path.joinBaseExt {base = file, 196 val src = OS.Path.joinBaseExt {base = file,
197 ext = SOME s} 197 ext = SOME s}
198 val src' = OS.Path.file src 198 val src' = OS.Path.file src
199 in 199 in
200 if OS.FileSys.access (src, []) then 200 if String.isPrefix (OS.Path.mkCanonical dirname) src
201 andalso OS.FileSys.access (src, []) then
201 (TextIO.output (out, " | <a target=\"showcase\" href=\""); 202 (TextIO.output (out, " | <a target=\"showcase\" href=\"");
202 TextIO.output (out, src'); 203 TextIO.output (out, src');
203 TextIO.output (out, ".html\"><tt>"); 204 TextIO.output (out, ".html\"><tt>");
204 TextIO.output (out, src'); 205 TextIO.output (out, src');
205 TextIO.output (out, "</tt></a>")) 206 TextIO.output (out, "</tt></a>"))