diff src/tutorial.sml @ 1496:3010472edf44

Tutorial section headings
author Adam Chlipala <adam@chlipala.net>
date Fri, 15 Jul 2011 17:31:57 -0400
parents af0d4d11c5d7
children 0b639858200b
line wrap: on
line diff
--- a/src/tutorial.sml	Fri Jul 15 17:25:09 2011 -0400
+++ b/src/tutorial.sml	Fri Jul 15 17:31:57 2011 -0400
@@ -75,7 +75,26 @@
                 val (befor, after) = Substring.position "<span class=\"comment-delimiter\">(* </span><span class=\"comment\">" source
             in
                 if Substring.isEmpty after then
-                    TextIO.outputSubstr (outf, source)
+                    let
+                        val (befor, after) = Substring.position "<span class=\"comment-delimiter\">(** </span><span class=\"comment\">" source
+                    in
+                        if Substring.isEmpty after then
+                            TextIO.outputSubstr (outf, source)
+                        else
+                            let
+                                val (befor', after) = Substring.position " </span><span class=\"comment-delimiter\">*)</span>"
+                                                                         (Substring.slice (after, 65, NONE))
+                            in
+                                if Substring.isEmpty after then
+                                    TextIO.outputSubstr (outf, source)
+                                else
+                                    (TextIO.outputSubstr (outf, befor);
+                                     TextIO.output (outf, "<h2>");
+                                     proseLoop befor';
+                                     TextIO.output (outf, "</h2>");
+                                     loop (Substring.slice (after, 49, NONE)))
+                            end
+                    end
                 else
                     let
                         val (befor', after) = Substring.position " </span><span class=\"comment-delimiter\">*)</span>"
@@ -105,6 +124,12 @@
              TextIO.output (outf, "\t\tpadding: 5px;\n");
              TextIO.output (outf, "\t\tfont-size: larger;\n");
              TextIO.output (outf, "\t}\n");
+             TextIO.output (outf, "\th2 {\n");
+             TextIO.output (outf, "\t\tfont-family: Arial;\n");
+             TextIO.output (outf, "\t\tfont-size: 20pt;\n");
+             TextIO.output (outf, "\t\tbackground-color: #99FF99;\n");
+             TextIO.output (outf, "\t\tpadding: 5px;\n");
+             TextIO.output (outf, "\t}\n");
              TextIO.output (outf, "-->\n");
              TextIO.output (outf, "</style>\n");
              TextIO.output (outf, "<title>");