[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-API] [PATCH 1 of 3] [ocamldoc] Layout improvements and parameter lists for functions


  • To: xen-api@xxxxxxxxxxxxxxxxxxx
  • From: Rob Hoes <rob.hoes@xxxxxxxxxx>
  • Date: Wed, 4 Nov 2009 10:25:20 +0000
  • Delivery-date: Wed, 04 Nov 2009 02:26:24 -0800
  • List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>

# HG changeset patch
# User Rob Hoes <rob.hoes@xxxxxxxxxx>
# Date 1257330033 0
# Node ID 024f541bfe08116a6291e1bc97bf3de0985734dc
# Parent  15f16d50983d82ec15ca52153d85cdf0b03dcfa0
[ocamldoc] Layout improvements and parameter lists for functions

Signed-off-by: Rob Hoes <rob.hoes@xxxxxxxxxx>

diff -r 15f16d50983d -r 024f541bfe08 ocaml/doc/ocamldoc.js
--- a/ocaml/doc/ocamldoc.js     Wed Nov 04 10:20:33 2009 +0000
+++ b/ocaml/doc/ocamldoc.js     Wed Nov 04 10:20:33 2009 +0000
@@ -116,16 +116,33 @@
        html += '<div class="field-type"><a name="' + name + 
'">[value]</a></div>';
        html += '<div class="field-name">' + name + '</div>';
        if (v.info.deprecated != undefined) {
-               html += '<div class="deprecated">!! deprecated ' + 
v.info.deprecated + ' !!</div>';
+               html += '<div class="deprecated"><b>Deprecated</b> ' + 
v.info.deprecated + '</div>';
        }
+       
+       html += '<div class="field-description">';
+       if (v.info.description != undefined)
+               html += v.info.description + '</div>';
+       else
+               html += '<span class="empty">to be completed!</span></div>';
+               
+       html += '<table class="field-table">';
+       html += '<tr><td width="100px"><span 
class="field-head">Type:</span></td><td>' + v.type + '</td></tr>';
+       
+       html += '<tr id="' + name + '_params" style="display: none"><td 
width="100px"><span class="field-head">Parameters:</span></td><td>';
        html += '<table>';
-       html += '<tr><td width="100px"><span 
class="field-head">Type:</span></td><td>' + v.type + '</td></tr>';
-       html += '<tr><td><span class="field-head">Description:</span></td><td>';
-       if (v.info.description != undefined)
-               html += transform_links(v.info.description) + '</td></tr>';
-       else
-               html += '<span class="empty">to be completed!</span></td></tr>';
+       for (c in v.params) {
+               n = v.params[c].name;
+               html += '<tr><td width="20%">' + (n == "" ? '(no name)' : 
v.params[c].name) + '</td>';
+               html += '<td>' + v.params[c].type + '</td></tr>';
+       }
        html += '</table>';
+       html += '</td></tr>';
+       
+       if (v.params.length > 0)
+               html += '<tr><td></td><td><input type="button" 
class="small-button" value="parameters" onclick="document.getElementById(\'' + 
name + '_params\').style.display=\'\'; this.style.display=\'none\'" 
/></td></tr>';
+       
+       html += '</table>';
+       
        html += '</div>';
        append_content(html);
 }
@@ -138,17 +155,17 @@
        html = '<div class="field' + toggle(n) + '">';
        html += '<div class="field-type"><a name="' + name + 
'">[exception]</a></div>';
        html += '<div class="field-name">' + name + '</div>';
-       html += '<table>';
+       html += '<div class="field-description">';
+       if (v.info.description != undefined)
+               html += v.info.description + '</div>';
+       else
+               html += '<span class="empty">to be completed!</span></div>';
+       html += '<table class="field-table">';
        html += '<tr><td width="100px"><span 
class="field-head">Arguments:</span></td><td>';
        if (v.exception_args != undefined)
                html += v.exception_args + '</td></tr>';
        else
                html += '[none]</td></tr>';
-       html += '<tr><td><span class="field-head">Description:</span></td><td>';
-       if (v.info.description != undefined)
-               html += v.info.description + '</td></tr>';
-       else
-               html += '<span class="empty">to be completed!</span></td></tr>';
        html += '</table>';
        html += '</div>';
        append_content(html);
@@ -158,7 +175,7 @@
 {
        cons = v.constructors;
        html = '';
-       html += '<table>';
+       html += '<table class="field-table">';
        html += '<tr><th 
width="25%">Constructor</th><th>Type</th><th>Description</th></tr>';
        for (c in cons) {
                html += '<tr><td>' + cons[c].name + '</td>'
@@ -176,7 +193,7 @@
 function record(v)
 {
        fields = v.fields;
-       html = '<table>';
+       html = '<table class="field-table">';
        html += '<tr><th width="25%">Field</th><th 
width="20%">Type</th><th>Description</th></tr>';
        for (c in fields) {
                html += '<tr><td>' + fields[c].name + '</td>'
@@ -244,15 +261,16 @@
                
        html = '<div class="field' + toggle(n) + '">';
        html += '<div class="field-type"><a name="' + name + 
'">[module]</a></div>';
-       html += '<div class="field-name">' + name + ' (<a href="index.html?c=' 
+ component +
-               '&m=' + v.name + '">details</a>)</div>';
-       html += '<table>';
+       html += '<div class="field-name">' + name + '</div>';
+       html += '<div class="field-description">';
+       if (v.info.description != undefined)
+               html += v.info.description + '</div>';
+       else
+               html += '<span class="empty">to be completed!</span></div>';
+       html += '<table class="field-table">';
        html += '<tr><td width="100px"><span 
class="field-head">Type:</span></td><td>' + v.type + '</td></tr>';
-       html += '<tr><td><span class="field-head">Description:</span></td><td>';
-       if (v.info.description != undefined)
-               html += v.info.description + '</td></tr>';
-       else
-               html += '<span class="empty">to be completed!</span></td></tr>';
+       
+       html += '<tr><td></td><td><input type="button" class="small-button" 
value="details" onclick="location=\'index.html?c=' + component + '&m=' + v.name 
+ '\'" /></td></tr>';
        html += '</table>';
        html += '</div>';
        append_content(html);
diff -r 15f16d50983d -r 024f541bfe08 ocaml/doc/style.css
--- a/ocaml/doc/style.css       Wed Nov 04 10:20:33 2009 +0000
+++ b/ocaml/doc/style.css       Wed Nov 04 10:20:33 2009 +0000
@@ -203,8 +203,11 @@
 }
 
 .deprecated {
-       color: red;
-       padding: .5em 3em .7em;
+       margin: .5em 5em .7em;
+       padding: 5px;
+       border: 1px solid grey;
+       text-align: center;
+       background-color: orange;
 }
 
 .field, .field2
@@ -235,8 +238,12 @@
        margin: .7em 0;
 }
 
-.field table, .field2 table {
-       margin-left: 3em;
-       width: 90%;
+.field-table {
+//     margin-left: 3em;
+//     width: 90%;
 }
 
+.small-button {
+       font-size: 70%;
+       text-align: right;
+}

Attachment: xen-api.hg-3.patch
Description: Text Data

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.