From: Eric Hodel Date: 2004-09-11T14:38:22+09:00 Subject: RDoc Formatter Simple Mode --k7W93gQNhKgsYkEv Content-Type: multipart/mixed; boundary="dClnwdpHIAy5TST4" Content-Disposition: inline --dClnwdpHIAy5TST4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable For rbot's ri module I needed a more compact ri format than plain to avoid flooding the bot off the server. I added a 'simple' format that strips out extra newlines and reduces lines to just their labels. When combined with a really large line width, the formatter is perfect for use in an IRC bot. --=20 Eric Hodel - drbrain@segment7.net - http://segment7.net All messages signed with fingerprint: FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04 --dClnwdpHIAy5TST4 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="rdoc_simple_formatter.patch" Content-Transfer-Encoding: quoted-printable Index: ri_formatter.rb =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /src/ruby/lib/rdoc/ri/ri_formatter.rb,v retrieving revision 1.11 diff -u -9 -p -r1.11 ri_formatter.rb --- ri_formatter.rb 24 Mar 2004 19:17:13 -0000 1.11 +++ ri_formatter.rb 11 Sep 2004 05:17:36 -0000 @@ -1,22 +1,23 @@ module RI class TextFormatter =20 def TextFormatter.list - "plain, html, bs, ansi" + "plain, html, bs, ansi, simple" end =20 def TextFormatter.for(name) case name - when /plain/i then TextFormatter - when /html/i then HtmlFormatter - when /bs/i then OverstrikeFormatter - when /ansi/i then AnsiFormatter + when /plain/i then TextFormatter + when /html/i then HtmlFormatter + when /bs/i then OverstrikeFormatter + when /ansi/i then AnsiFormatter + when /simple/i then SimpleFormatter else nil end end =20 attr_reader :indent =20 def initialize(options, indent) @options =3D options @width =3D options.width @@ -585,15 +586,57 @@ module RI print("") end =20 def escape(str) str. gsub(/&/n, '&'). gsub(/\"/n, '"'). gsub(/>/n, '>'). gsub(/