*** empty log message ***
[m17n/m17n-docs.git] / utils / mkman.rb
index 2906fee..303fc78 100644 (file)
@@ -19,6 +19,9 @@ else
 end
 $sampledir="sample/man3/"
 
+$headfile = $currentdir+"manhead"
+headbuf = open($headfile, "r").readlines
+
 #
 # Extra information about header strings Doxygen generates in a man file.
 #
@@ -259,19 +262,17 @@ def desrewrite(text)
 
 #headers
   if line =~ /Return\svalue:/
-     line = "\n.SH RETURNS\n.PP"
      returndescribed = true
   end 
-#  line.gsub!(/^\\fBReturn value:\\fP/,"\n.SH RETURNS\n.PP")
+  line.gsub!(/^\\fBReturn value:\\fP/,"\n.SH RETURN VALUE\n.PP")
   if line =~ /Errors:/  
-     line = "\n.SH ERRORS\n.PP"
      errordescribed = true
   end
-#  line.gsub!(/^\\fBErrors:\\fP/,"\n.SH ERRORS\n.PP")
+  line.gsub!(/^\\fBErrors:\\fP/,"\n.SH ERRORS\n.PP")
   line.gsub!(/^\\fBSee Also:\\fP/,"\n.SH \"SEE ALSO\"\n.PP")
 
-
-  line.gsub!(/^\\fB(.+)\\fP/){"\n.SS " << $1}
+  line.gsub!(/^\\fB(.+)[^\)]\\fP/){"\n.SS " << $1}
+ # [^\)] in the pattern is added to avoid the first function in see also section. 
 
 #removing indentation
  if text[i - 1] =~ /^.PP/
@@ -471,6 +472,7 @@ unless FileTest.directory? filename
       end
 
      filetowrite = open($dstman3m+filename,"w")
+     filetowrite.puts(headbuf)
      filetowrite.puts(buf)
      filetowrite.flush
 end