Re: [AD] chapters for devhelp documentation

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Mon, 2004-09-20 at 12:35 +0200, Elias Pschernig wrote:
> Luckily, was easy to fix. Just commited the attached one-line patch. Now
> I'm going to check text, info and man docs as well.. who knows where
> else those TOC entries are used.
> 

They seem all ok, but I had to make the same change to devhelp (yes,
really should have checked better before). While I was at it, I made the
attached patch which also uses the @chapter commands in the html TOC. If
nobody thinks the html TOC looks bad with it, I'll apply it.

-- 
Elias Pschernig
Index: docs/src/makedoc/makehtml.c
===================================================================
RCS file: /cvsroot/alleg/allegro/docs/src/makedoc/makehtml.c,v
retrieving revision 1.31
diff -u -r1.31 makehtml.c
--- docs/src/makedoc/makehtml.c	20 Sep 2004 10:36:50 -0000	1.31
+++ docs/src/makedoc/makehtml.c	20 Sep 2004 11:01:28 -0000
@@ -592,7 +592,7 @@
    char *s;
    TOC *toc;
    int nested = 0;
-   
+
    #define ALT_TEXT(toc)   ((toc->alt) ? toc->alt : toc->text)
 
    if (root) {
@@ -604,25 +604,33 @@
       fprintf(_file, "<ul>\n");
 
       while (toc) {
-	 if ((toc->root) && (toc->htmlable)) {
-	    if (toc->otherfile) {
-	       sprintf(name, "%s.%s", toc->text, html_extension);
-	       mystrlwr(name);
-	       _hfprintf("<li><a href=\"%s\">%s</a>\n", name, ALT_TEXT(toc));
-	    }
-	    else if (body) {
-	       _hfprintf("<li><a href=\"#%s\">%s</a>\n", toc->text, ALT_TEXT(toc));
-	       section_number++;
-	    }
-	    else {
-	       strcpy(name, filename);
-	       s = get_extension(name)-1;
-	       if (s - get_filename(name) > 5)
-		  s = get_filename(name)+5;
-	       sprintf(s, "%03d.%s", section_number, html_extension);
-	       _hfprintf("<li><a href=\"%s\">%s</a>\n", get_filename(name), ALT_TEXT(toc));
-	       section_number++;
-	    }
+	 if (toc->root) {
+            if (toc->htmlable) {
+               if (toc->otherfile) {
+                  sprintf(name, "%s.%s", toc->text, html_extension);
+                  mystrlwr(name);
+                  _hfprintf("<li><a href=\"%s\">%s</a>\n", name, ALT_TEXT(toc));
+               }
+               else if (body) {
+                  _hfprintf("<li><a href=\"#%s\">%s</a>\n", toc->text, ALT_TEXT(toc));
+                  section_number++;
+               }
+               else {
+                  strcpy(name, filename);
+                  s = get_extension(name)-1;
+                  if (s - get_filename(name) > 5)
+                     s = get_filename(name)+5;
+                  sprintf(s, "%03d.%s", section_number, html_extension);
+                  _hfprintf("<li><a href=\"%s\">%s</a>\n", get_filename(name), ALT_TEXT(toc));
+                  section_number++;
+               }
+            }
+            else if (toc->root == 2) {
+               _hfprintf("</ul><p>%s</p><ul>\n", ALT_TEXT(toc));
+            }
+            else if (toc->root == 3) {
+               _hfprintf("</ul><ul>\n");
+            }
 	 }
 	 toc = toc->next;
       }


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/