From e2b653ad94e973b42313ed95d18b143e2deaedea Mon Sep 17 00:00:00 2001
From: Martin Stjernholm <mast@lysator.liu.se>
Date: Mon, 7 Mar 2011 14:33:58 +0100
Subject: [PATCH] Attempt to clean up some confusion regarding the attribute to
 <section>.

---
 lib/modules/Tools.pmod/AutoDoc.pmod/DocParser.pmod | 2 +-
 refdoc/keywords.txt                                | 8 +++++---
 refdoc/presentation/make_html.pike                 | 4 +++-
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/lib/modules/Tools.pmod/AutoDoc.pmod/DocParser.pmod b/lib/modules/Tools.pmod/AutoDoc.pmod/DocParser.pmod
index 9ded9cb339..5c55065606 100644
--- a/lib/modules/Tools.pmod/AutoDoc.pmod/DocParser.pmod
+++ b/lib/modules/Tools.pmod/AutoDoc.pmod/DocParser.pmod
@@ -408,7 +408,7 @@ protected class DocParserClass {
   }
 
   protected mapping(string : string) sectionArgHandler(string keyword, string arg) {
-    return ([ "name" : arg ]);
+    return ([ "title" : String.trim_all_whites (arg) ]);
   }
 
   protected string typeArgHandler(string keyword, string arg) {
diff --git a/refdoc/keywords.txt b/refdoc/keywords.txt
index 109cf6f4d6..33370c0702 100644
--- a/refdoc/keywords.txt
+++ b/refdoc/keywords.txt
@@ -606,9 +606,9 @@ _______________________________________________________________________________
 
 Keyword:      @section - @endsection
 Description:  Begin a new section in the text.
-Arguments:    <name>
+Arguments:    <title>
               Where:
-                <name> is any text that is the name of the section.
+		<title> is any text that is the title of the section.
 Children:     Text (with markup)
 Groups with:  -
 Examples:
@@ -619,7 +619,9 @@ Examples:
                 ...
               @endsection
 
-XML:          <section name=" ... ">
+XML:          <section title=" ... ">
+	      The attribute "name" can be used instead of "title", for
+	      compatibility.
 _______________________________________________________________________________
 
 Keyword:      @string - @endstring
diff --git a/refdoc/presentation/make_html.pike b/refdoc/presentation/make_html.pike
index 0003f7574c..93bbcac83c 100644
--- a/refdoc/presentation/make_html.pike
+++ b/refdoc/presentation/make_html.pike
@@ -125,7 +125,9 @@ string low_parse_chapter(Node n, int chapter, void|int section, void|int subsect
       ret += "</dd>\n<dt><a name='" + section + "'></a>\n"
 	"<table width='100%' cellpadding='3' cellspacing='0' border='0'><tr>"
 	"<td bgcolor='#EEEEEE'><font size='+3'>&nbsp; " + chapter + "." + section +
-	". " + quote(c->get_attributes()->title) +
+	". " + quote(c->get_attributes()->title ||
+		     // The following for bug compat.
+		     c->get_attributes()->name) +
 	"</font></td></tr></table><br />\n"
 	"</dt>\n<dd>";
       ret += low_parse_chapter(c, chapter, section);
-- 
GitLab