From: Paul Duncan Date: 2006-01-14T01:13:35+09:00 Subject: Re: [PATCH] Ruby 1.8.4 RDoc HTML Cleanups and HTML Language Support --PMULwz+zIGJzpDN9 Content-Type: multipart/mixed; boundary="FUaywKC54iCcLzqT" Content-Disposition: inline --FUaywKC54iCcLzqT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * H.Yamamoto (ocean@m2.ccsnet.ne.jp) wrote: >=20 > >> I have reviewed your patch, and have noticed two things. > >>=20 > >> 1. In your patch, xml:lang is specified in HTML4.01. Is this allowed? > > > >I think most browsers ignore attributes that they don't understand. So, > >is it correct? Probably not. Will it cause problems? Probably not. > >Does it matter? Not really; the HTML produced with the patch is > >certainly more valid than the HTML produced without it. >=20 > Yes, and most browsers can parse without end tag. > Why is this not good? because it's not valid xhtml. On the other hand xml= :lang > is using xml namespace, so I think this is not valid html4. Invalid elements are not the anywhere near the same thing as invalid element attributes. This thread is a waste of time. I've reattached the patch with the xml:lang attribute removed for the one_page_html.rb. [snipped useless conversation] > Anyway, I'm not RDoc maintainer, I cannot decide intruducing new option. > I'll fix invalid xhtml error first based on your patch. Then don't apply the patch; wait until someone who is responsible for RDoc takes a look at it. Don't gut it because you don't agree with one attribute (which is removed anyway in the attached patch). > Regards, > Yamamoto --=20 Paul Duncan OpenPGP Key ID: 0x82C29562 http://www.pablotron.org/ http://www.paulduncan.org/ --FUaywKC54iCcLzqT Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ruby-1.8.4-rdoc_html_cleanup-2.diff" Content-Transfer-Encoding: quoted-printable Only in ruby-1.8.4/lib/rdoc: .foo2.html.swp diff -ur ruby-1.8.4-orig/lib/rdoc/README ruby-1.8.4/lib/rdoc/README --- ruby-1.8.4-orig/lib/rdoc/README 2004-12-04 00:38:15.000000000 -0500 +++ ruby-1.8.4/lib/rdoc/README 2005-12-29 18:45:37.000000000 -0500 @@ -146,6 +146,11 @@ [--help-output] explain the various output options. =20 +[--html-language _language_] + Set the language (the lang and xml:lang attributes) for the=20 + generated HTML. Can be any valid RFC 1766-style language + string. Defaults to 'en-US' if unspecified. + [--image-format gif/png/jpg/jpeg] sets output image format for diagrams. Can be png, gif, jpeg, jpg. If this option is omitted, png is used. Requires --diagram. diff -ur ruby-1.8.4-orig/lib/rdoc/generators/html_generator.rb ruby-1.8.4/l= ib/rdoc/generators/html_generator.rb --- ruby-1.8.4-orig/lib/rdoc/generators/html_generator.rb 2005-02-12 05:57:= 20.000000000 -0500 +++ ruby-1.8.4/lib/rdoc/generators/html_generator.rb 2005-12-29 18:14:46.00= 0000000 -0500 @@ -151,9 +151,9 @@ end =20 if (type =3D=3D "http" || type =3D=3D "link") &&=20 - url =3D~ /\.(gif|png|jpg|jpeg|bmp)$/ + url =3D~ /\.(gif|png|jpg|jpeg|bmp)$/i =20 - "" + "" else "#{text.sub(%r{^#{type}:/*}, '')}" end @@ -636,6 +636,7 @@ add_table_of_sections =20 @values["charset"] =3D @options.charset + @values['html_lang'] =3D @options.html_lang @values["style_url"] =3D style_url(path, @options.css) =20 d =3D markup(@context.comment) @@ -804,6 +805,7 @@ add_table_of_sections =20 @values["charset"] =3D @options.charset + @values["html_lang"] =3D @options.html_lang @values["href"] =3D path @values["style_url"] =3D style_url(path, @options.css) =20 @@ -1027,7 +1029,8 @@ 'title' =3D> CGI.escapeHTML(index_name), 'code' =3D> code_body, 'style_url' =3D> style_url(file_path, @options.css), - 'charset' =3D> @options.charset + 'charset' =3D> @options.charset, + 'html_lang' =3D> @options.html_lang } template.write_html_on(f, values) end @@ -1322,6 +1325,7 @@ 'list_title' =3D> CGI.escapeHTML(title), 'index_url' =3D> main_url, 'charset' =3D> @options.charset, + 'html_lang' =3D> @options.html_lang, 'style_url' =3D> style_url('', @options.css), } =20 @@ -1341,7 +1345,8 @@ values =3D { "initial_page" =3D> main_url, 'title' =3D> CGI.escapeHTML(@options.title), - 'charset' =3D> @options.charset + 'charset' =3D> @options.charset, + 'html_lang' =3D> @options.html_lang, } if @options.inline_source values['inline_source'] =3D true @@ -1444,6 +1449,7 @@ def generate_xml values =3D {=20 'charset' =3D> @options.charset, + 'html_lang' =3D> @options.html_lang, 'files' =3D> gen_into(@files), 'classes' =3D> gen_into(@classes), 'title' =3D> CGI.escapeHTML(@options.title), Only in ruby-1.8.4/lib/rdoc/generators/template/html: .html.rb.swp diff -ur ruby-1.8.4-orig/lib/rdoc/generators/template/html/hefss.rb ruby-1.= 8.4/lib/rdoc/generators/template/html/hefss.rb --- ruby-1.8.4-orig/lib/rdoc/generators/template/html/hefss.rb 2003-12-01 0= 2:12:48.000000000 -0500 +++ ruby-1.8.4/lib/rdoc/generators/template/html/hefss.rb 2005-12-29 18:00:= 35.000000000 -0500 @@ -111,10 +111,10 @@ =20 =20 BODY =3D %{ - + %title% - +