[Laszlo-checkins] r9019 - in openlaszlo/trunk: WEB-INF/lps/server/src/org/openlaszlo/js2doc docs/src/reference/navbuilder

dda@openlaszlo.org dda at openlaszlo.org
Tue May 6 09:12:09 PDT 2008


Author: dda
Date: 2008-05-06 09:12:01 -0700 (Tue, 06 May 2008)
New Revision: 9019

Modified:
   openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/js2doc/JS2DocUtils.java
   openlaszlo/trunk/docs/src/reference/navbuilder/navxmlbuilder.rb
Log:
Change 20080506-dda-3 by dda at lester.local on 2008-05-06 11:57:26 EDT
    in /Users/dda/laszlo/src/svn/openlaszlo/trunk-doc3
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Mark features available in all but one runtime as '(except RUNTIME)'

New Features:

Bugs Fixed: LPP-5905

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

Documentation:

Release Notes:

Details:
    This cleans up the doc pages and index in cases where
    a class/method, etc. is available in all runtimes except one.
    For example, instead of listing "LzCursor (dhtml swf7 swf8)"
    we would list "LzCursor (except swf9)".  As runtimes come and
    go, this becomes more important as we add supported runtimes.

Tests:
    Built at top level: ant clean build
    Build in docs/src: ant clean reference
    Verified changes in class index (e.g. LzCursor), verified changes in 
    LzNode reference page which has some runtime specific methods.



Modified: openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/js2doc/JS2DocUtils.java
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/js2doc/JS2DocUtils.java	2008-05-06 16:09:31 UTC (rev 9018)
+++ openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/js2doc/JS2DocUtils.java	2008-05-06 16:12:01 UTC (rev 9019)
@@ -158,6 +158,25 @@
             node.setAttribute(attr, oldvalue + " " + value.trim());
     }
 
+    /**
+     * If the set has all elements from the complete set
+     * except one, return the single missing element.
+     */
+    static String findStateException(Set set, Set complete) {
+        Set notseen = new HashSet();
+
+        notseen.addAll(complete);
+        for (Iterator iter = set.iterator(); iter.hasNext();) {
+            notseen.remove((String)iter.next());
+        }
+        if (notseen.size() == 1) {
+            return (String)notseen.iterator().next();
+        }
+        else {
+            return null;
+        }
+    }
+
     static void describeConditionalState(ConditionalState state, org.w3c.dom.Element docNode) {
         if (state.inferredValue == ConditionalState.indeterminateValue) {
             Set includeSet = new HashSet();
@@ -166,7 +185,12 @@
             state.describeExclusiveConditions(includeSet);
             
             if (includeSet.isEmpty() == false) {
-                docNode.setAttribute("runtimes", optionsToString(includeSet));
+                String except = findStateException(includeSet, Main.runtimeOptions);
+                if (except != null) {
+                    docNode.setAttribute("runtimes", "except " + except);
+                } else {
+                    docNode.setAttribute("runtimes", optionsToString(includeSet));
+                }
             }
             
             includeSet.clear();

Modified: openlaszlo/trunk/docs/src/reference/navbuilder/navxmlbuilder.rb
===================================================================
--- openlaszlo/trunk/docs/src/reference/navbuilder/navxmlbuilder.rb	2008-05-06 16:09:31 UTC (rev 9018)
+++ openlaszlo/trunk/docs/src/reference/navbuilder/navxmlbuilder.rb	2008-05-06 16:12:01 UTC (rev 9019)
@@ -90,6 +90,27 @@
   tag
 end
 
+# If the title of this document does not have a tag name, return it.
+def nontagname_for(filename)
+  name = nil;
+  open(filename) {|f|
+      f.each_line { |line|
+          line.chomp!
+          if (line =~ /<title>.*<\/title>/) then
+              if (line =~ /<title>.*<\/title>/ &&
+                  line !~ /<title>&lt;.*&gt;.*<\/title>/) then
+                  name = line.sub(/.*<title>/, '').sub(/<\/title>.*/, '')
+              end
+          end
+          if (line =~ /<link.*\.Incubator\./) then
+             name = nil
+             break
+          end
+      }
+  }
+  name
+end
+
 opts = GetoptLong.new(
   [ '--help', GetoptLong::NO_ARGUMENT ],
   [ '--inputdir', GetoptLong::REQUIRED_ARGUMENT ],
@@ -119,7 +140,10 @@
 generate_index("{[Ll]z,tag}*.html", $outdir + "/tags.xml", "index") { | file,fullname |
     tagname_for(fullname);
  }
-generate_index("Lz*.html", $outdir + "/classes.xml", "index") { | file,ignored | 
-   file.sub(/\.html/, '').sub(/([^+]*)\+(.*)/, '\1 (\2)').gsub(/\+/, ' ').
-        sub('swf7 swf8 swf9', 'swf');
+generate_index("Lz*.html", $outdir + "/classes.xml", "index") { | file,fullname | 
+   name = nontagname_for(fullname);
+   if (!name) then
+      name = file.sub(/\.html/, '').sub(/([^+]*)\+(.*)/, '\1 (\2)').gsub(/\+/, ' ');
+   end
+   name
 }



More information about the Laszlo-checkins mailing list