X-Git-Url: http://git.chise.org/gitweb/?p=m17n%2Fm17n-docs.git;a=blobdiff_plain;f=utils%2Fmkman.rb;h=b136889fcb04597a2e9ba370fa1677fbfee147bc;hp=f695ff15c4873a3e9f5ba830dfc1c8956816bc77;hb=6adca6c942e39d270401bd617577eace5009030b;hpb=cce6d2787df1b2fcbeb916b3e37a0096549f3775 diff --git a/utils/mkman.rb b/utils/mkman.rb index f695ff1..b136889 100644 --- a/utils/mkman.rb +++ b/utils/mkman.rb @@ -198,7 +198,7 @@ def documentfunc2 (dstart, title, func_text, short_text) def frewrite(text) # let the library name appear in the header - buf = [text[0].gsub!("\" \"", "\" \"\" \"")] + buf = [text[0].gsub!(/\" \"/, "\" \"\" \"")] title = text[0].split(" ")[1].chop!.reverse.chop!.reverse @@ -247,20 +247,32 @@ def desrewrite(text) ind = text.index(line) text.delete_at(ind+1) if text[ind+1] == (".in +1c\n")} +### letting verbatim end in place Part1 + verbatim = false text.each_with_index{|line,i| ### TEST 6/24 - line.gsub!(".RS 4","") + line.gsub!(/^\.RS 4/,"") -### letting verbatim end in place - line.gsub!(/^.nf/,".NF") +### letting verbatim end in place Part2 + if line =~ /^\.nf/ + verbatim = true + end + + if verbatim == true + if line =~ /^\.PP/ + line.gsub!(/^\.PP/,".fi") + verbatim = false + end + end #removing "More..." hyperlink line.gsub!(/More.../,"") # ? ad hoc line.gsub!(/^\.TP/,"") + #headers if line =~ /Return\svalue:/ returndescribed = true @@ -347,9 +359,20 @@ def orewrite(text) ### let verbatim end in place line.gsub!(/^.nf/,".NF") + ### test1/16/2004 changes the type of list, and indentation + if line =~ /^.IP/ + line = ".TP" + text[i+2] = "" + end + + if line =~ /^.TP/ + text[i+2] = "" + end + ### end of test1/20/2004 + # let the library name appear in the header if line =~ /^.TH/ - line = line.gsub!("\" \"", "\" \"\" \"") + line = line.gsub!(/\" \"/, "\" \"\" \"") end # finding structure documentations and merging into "structures" @@ -375,7 +398,7 @@ def orewrite(text) #removing author section line.gsub!(/^\.SH\s\"AUTHOR\"/,"") - line.gsub!("Generated automatically by Doxygen for m17n_test from the source code.","") + line.gsub!(/Generated automatically by Doxygen for m17n_test from the source code\./,"") line.gsub!(/\\fP\s+,/,"\\fP,") line.gsub!(/\\fP\s+\./,"\\fP.") @@ -408,9 +431,13 @@ Dir.open(".").each{|filename| next end - #if filename =~ /\.c\./ - # next - #end + if filename =~ /\.[ch]\./ + next + end + + if filename =~ /\.txt\./ + next + end file = open(filename,"r") text = file.readlines