changeset 1496:3010472edf44

Tutorial section headings
author Adam Chlipala <adam@chlipala.net>
date Fri, 15 Jul 2011 17:31:57 -0400 (2011-07-15)
parents af0d4d11c5d7
children 0b639858200b
files doc/intro.ur src/tutorial.sml
diffstat 2 files changed, 30 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/doc/intro.ur	Fri Jul 15 17:25:09 2011 -0400
+++ b/doc/intro.ur	Fri Jul 15 17:31:57 2011 -0400
@@ -1,6 +1,6 @@
 (* Introduction *)
 
-(* This work is licensed under a <a href="http://creativecommons.org/licenses/by-nc-nd/3.0/">Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Unported License</a>. *)
+(* This tutorial is licensed under a <a href="http://creativecommons.org/licenses/by-nc-nd/3.0/">Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 Unported License</a>. *)
 
 (* Test evaluation.... *)
 
@@ -10,4 +10,6 @@
 f 6
 (* end *)
 
-(* Did it work? *)
+(** Section *)
+
+val y = 9
--- 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>");