[Laszlo-checkins] r9229 - in openlaszlo/trunk/docs/src: reference xsl

dda@openlaszlo.org dda at openlaszlo.org
Mon May 19 18:39:37 PDT 2008


Author: dda
Date: 2008-05-19 18:39:32 -0700 (Mon, 19 May 2008)
New Revision: 9229

Modified:
   openlaszlo/trunk/docs/src/reference/info.xml
   openlaszlo/trunk/docs/src/reference/postprocess.rb
   openlaszlo/trunk/docs/src/xsl/js2doc2dbk.xsl
Log:
Change 20080519-dda-P by dda at lester.local on 2008-05-19 21:33:37 EDT
    in /Users/dda/laszlo/src/svn/openlaszlo/trunk-doc
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Ruby postprocessing improved

New Features:

Bugs Fixed: LPP-5942, LPP-5946

Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: liorio (pending)

Documentation:

Release Notes:

Details:
    This does not provide any changes to doc, but it improves the
    recent ruby postprocessing scheme to remove the undesirable side
    effects.  There are now no more spurious warnings when building doc
    due to this technique, and pages written into reference/*.html will
    be readable, although not completed between the time that they are
    created and when they are post processed and the build is finished.


Tests:
     built doc and looked at results for typical pages.



Modified: openlaszlo/trunk/docs/src/reference/info.xml
===================================================================
--- openlaszlo/trunk/docs/src/reference/info.xml	2008-05-20 01:39:19 UTC (rev 9228)
+++ openlaszlo/trunk/docs/src/reference/info.xml	2008-05-20 01:39:32 UTC (rev 9229)
@@ -84,8 +84,8 @@
 href="${tutorials}classes-tutorial.html">Classes</a> tutorial describes how to
 use attributes to define a class.</p>
 
-<!-- TODO: [2008-05-13 dda] hrule should go here and between each section -->
-<postprocess-html-hrule/>
+<!-- This is our current workaround for inserting an hrule -->
+<para role="postprocess-html-hr"/>
 
 <p><a name="types"></a>There are five kinds of attributes: </p>
 <ul>
@@ -98,7 +98,7 @@
   </li>
 </ul>
 
-<postprocess-html-hrule/>
+<para role="postprocess-html-hr"/>
 <a name="setter"></a>
 <simplesect>
 <h2>Attributes (with setter)</h2>
@@ -124,7 +124,7 @@
 <p align="right"><ulink url="#top">More on attributes</ulink></p>
 </simplesect>
 
-<postprocess-html-hrule/>
+<para role="postprocess-html-hr"/>
 <a name="defaultsetter"></a>
 <simplesect>
 <h2>Attributes (without setter)</h2>
@@ -144,7 +144,7 @@
 <p align="right"><ulink url="#top">More on attributes</ulink></p>
 </simplesect>
 
-<postprocess-html-hrule/>
+<para role="postprocess-html-hr"/>
 <a name="eventhandler"></a>
 <simplesect>
 <h2>Event Handler Attributes</h2>
@@ -160,7 +160,7 @@
 <p align="right"><ulink url="#top">More on attributes</ulink></p>
 </simplesect>
 
-<postprocess-html-hrule/>
+<para role="postprocess-html-hr"/>
 <a name="final"></a>
 <simplesect>
 <h2>Final Attributes</h2>
@@ -170,7 +170,7 @@
 <p align="right"><ulink url="#top">More on attributes</ulink></p>
 </simplesect>
 
-<postprocess-html-hrule/>
+<para role="postprocess-html-hr"/>
 <a name="readonly"></a>
 <simplesect>
 <h2>Read Only Attributes (Fields)</h2>

Modified: openlaszlo/trunk/docs/src/reference/postprocess.rb
===================================================================
--- openlaszlo/trunk/docs/src/reference/postprocess.rb	2008-05-20 01:39:19 UTC (rev 9228)
+++ openlaszlo/trunk/docs/src/reference/postprocess.rb	2008-05-20 01:39:32 UTC (rev 9229)
@@ -50,32 +50,37 @@
   open(fname) {|f|
     open(outname, "w") {|outf|
       f.each_line { |line|
-        if (line =~ /<font color="red">&lt;/) then
+        if (line =~ /class="postprocess/) then
           foundthis = true
-          if (line =~ /&lt;postprocess-html-/) then
+          pptagname = line.sub(/.*<p class=\".*postprocess-([^"]*)".*/, '\1').chomp
+
+          if (pptagname =~ /^html-/) then
             # A simple html tag that we want to pass through
-            line.gsub!(/&lt;(\/*)postprocess-html-([^&]*)&gt;/, '<\1\2>')
-          elsif (line =~ /&lt;postprocess-methodname/)
+            htmltagname = pptagname.sub(/html-/, '')
+            line.gsub!(/<p class="postprocess-html-([^>]*)>/, '<' + htmltagname + '>')
+            line.gsub!(/<\/p>/, '</' + htmltagname + '>')
+          elsif (pptagname =~ /^methodname$/)
             # We want to have a band with the background color stretched
             # the entire width.
-            line.gsub!(/&lt;postprocess-methodname&gt;/, '<table width="100%" style="border-left: 0px;"><tr><th style="background-color:#e8e8e8; font-size: 14px;" align="left">')
-            line.gsub!(/&lt;\/postprocess-methodname&gt;/, '</th></tr></table>')
-          elsif (line =~ /&lt;postprocess-method-end/)
+            line.gsub!(/<p class="postprocess-methodname([^>]*)>/, '<table width="100%" style="border-left: 0px;"><tr><th style="background-color:#e8e8e8; font-size: 14px;" align="left">')
+            line.gsub!(/<\/p>/, '</th></tr></table>')
+          elsif (pptagname =~ /^method-end$/)
             # Create an horizontal rule
             outf.write('<hr/>')
-            line.gsub!(/&lt;(\/*)postprocess-method-end&gt;/, '')
-          elsif (line =~ /&lt;postprocess-attribute-end/)
+            line.gsub!(/<p class="postprocess-method-end([^>]*)>/, '')
+            line.gsub!(/<\/p>/, '')
+          elsif (pptagname =~ /^attribute-end$/)
             # Create an horizontal rule
             outf.write('<hr/>')
-            line.gsub!(/&lt;(\/*)postprocess-attribute-end&gt;/, '')
+            line.gsub!(/<p class="postprocess-method-end([^>]*)>/, '')
+            line.gsub!(/<\/p>/, '')
           else
             foundthis = false
           end
-          if (foundthis)
-            line.gsub!(/<font color="red">/, '')
-            line.gsub!(/<\/font>/, '')
+          # if (foundthis) ... could do extra cleanup here
+        end
+        if (foundthis)
             found = true
-          end
         end
         outf.write(line)
       }

Modified: openlaszlo/trunk/docs/src/xsl/js2doc2dbk.xsl
===================================================================
--- openlaszlo/trunk/docs/src/xsl/js2doc2dbk.xsl	2008-05-20 01:39:19 UTC (rev 9228)
+++ openlaszlo/trunk/docs/src/xsl/js2doc2dbk.xsl	2008-05-20 01:39:32 UTC (rev 9229)
@@ -605,10 +605,11 @@
               <xsl:value-of select="$name"/>
             </primary>
           </indexterm>
-          <!-- TODO [dda 2008-05-14] handle postprocess tags in docbook.
-               We need to inject certain HTML formatting that is hard
-               to work out in docbook/XSL in a timely manner.  The
-               technique is to put a <postprocess-*> tag in place, let
+          <!-- TODO [dda 2008-05-14] handle postprocess tags in
+               docbook.  We need to inject certain HTML formatting
+               that is hard to work out in docbook/XSL in a timely
+               manner.  The technique is to put a
+               <para role="postprocess-XXXX"> tag in place, let
                docbook warn us about it (but leave a doctored version
                in place), and then a ruby script, postprocess.rb, does
                a final clean up pass by locating and replacing the
@@ -617,9 +618,9 @@
                The postprocess-methodname tag puts a grey background
                against the method name and stretches it the entire width.
             -->
-          <postprocess-methodname>
+          <para role="postprocess-methodname">
             <xsl:value-of select="$desc"/>
-          </postprocess-methodname>
+          </para>
         </term>
         <listitem>
             <refsect3>
@@ -697,7 +698,7 @@
           <refsect3>
             <!-- The postprocess-method-end tag puts an hrule after the method.
                  See also 'handle postprocess tags' comment.  -->
-            <postprocess-method-end/>
+            <para role="postprocess-method-end"/>
           </refsect3>
         </listitem>
       </varlistentry>



More information about the Laszlo-checkins mailing list