[Commits] r447 - in sandbox/website/trunk: docsrc/lib geoext/lib/GeoExt/widgets

commits at geoext.org commits at geoext.org
Thu Apr 23 02:27:23 CEST 2009


Author: tschaub
Date: 2009-04-23 02:27:23 +0200 (Thu, 23 Apr 2009)
New Revision: 447

Added:
   sandbox/website/trunk/docsrc/lib/template.jst
Modified:
   sandbox/website/trunk/geoext/lib/GeoExt/widgets/MapPanel.js
Log:
Using a jinja template to produce rst based on context extracted from js source.

Added: sandbox/website/trunk/docsrc/lib/template.jst
===================================================================
--- sandbox/website/trunk/docsrc/lib/template.jst	                        (rev 0)
+++ sandbox/website/trunk/docsrc/lib/template.jst	2009-04-23 00:27:23 UTC (rev 447)
@@ -0,0 +1,71 @@
+.. currentmodule:: {{ module }}
+
+:class:`{{ module }}.{{ class }}`
+=================================
+
+{{ constructor }}
+
+{% if parent_link is defined %}
+.. rubric:: Extends
+
+* {{ parent_link }}
+{% endif %}
+
+{% if xtype is defined %}
+{{ xtype }}
+{% endif %}
+
+{% if example is defined %}
+Example Use
+-----------
+
+{{ example }}
+{% endif %}    
+
+{% if config is defined %}
+Config Options
+--------------
+
+Configuration properties{% if parent_link is defined %} in addition to
+those listed for {{ parent_link }}{% endif %}.
+
+{% for c in config %}
+{{ c }}
+{% endfor %}
+{% endif %}
+
+{% if properties is defined %}
+Public Properties
+-----------------
+
+Public properties{% if parent_link is defined %} in addition to those
+listed for {{ parent_link }}{% endif %}.
+
+{% for p in properties %}
+{{ p }}
+{% endfor %}
+{% endif %}
+
+{% if methods is defined %}
+Public Methods
+--------------
+
+Public methods{% if parent_link is defined %} in addition to those
+listed for {{ parent_link }}{% endif %}.
+
+{% for m in methods %}
+{{ m }}
+{% endfor %}
+{% endif %}
+
+{% if events is defined %}
+Events
+------
+
+Events{% if parent_link is defined %} in addition to those
+listed for {{ parent_link }}{% endif %}.
+
+{% for e in events %}
+{{ e }}
+{% endfor %}
+{% endif %}

Modified: sandbox/website/trunk/geoext/lib/GeoExt/widgets/MapPanel.js
===================================================================
--- sandbox/website/trunk/geoext/lib/GeoExt/widgets/MapPanel.js	2009-04-23 00:25:21 UTC (rev 446)
+++ sandbox/website/trunk/geoext/lib/GeoExt/widgets/MapPanel.js	2009-04-23 00:27:23 UTC (rev 447)
@@ -9,88 +9,98 @@
  * @include GeoExt/data/LayerStore.js
  */
 
+/** jst: defs
+ *  module = GeoExt
+ *  class = MapPanel
+ *  parent_link = `Ext.Panel <http://extjs.com/deploy/dev/docs/?class=Ext.Panel>`_
+ */
 Ext.namespace("GeoExt");
 
-/**
- * Class: GeoExt.MapPanel
- *     A map panel is a panel with a map inside it.
- *
- * Example: create a map panel and render it in a div identified
- * by "div-id".
- *
- * (start code)
- * var mapPanel = new GeoExt.MapPanel({
- *     border: false,
- *     renderTo: "div-id",
- *     map: new OpenLayers.Map({
- *         maxExtent: new OpenLayers.Bounds(-90, -45, 90, 45)
- *     })
- * });
- * (end)
- *
- * Example: create a panel including a map panel with a toolbar.
- *
- * (start code)
- * var panel = new Ext.Panel({
- *     items: [{
- *         xtype: "gx_mappanel",
- *         bbar: new Ext.Toolbar()
- *     }]
- * });
- * (end)
- *
- * Inherits from:
- *  - {Ext.Panel}
+/** jst: example
+ *  Sample code to create a panel with a new map:
+ * 
+ *  .. code-block:: javascript
+ *     
+ *      var mapPanel = new GeoExt.MapPanel({
+ *          border: false,
+ *          renderTo: "div-id",
+ *          map: {
+ *              maxExtent: new OpenLayers.Bounds(-90, -45, 90, 45)
+ *          }
+ *      });
+ *     
+ *  Sample code to create a map panel with a bottom toolbar in a Window:
+ * 
+ *  .. code-block:: javascript
+ * 
+ *      var win = new Ext.Window({
+ *          title: "My Map",
+ *          items: [{
+ *              xtype: "gx_mappanel",
+ *              bbar: new Ext.Toolbar()
+ *          }]
+ *      });
  */
 
-/**
- * Constructor: GeoExt.MapPanel
- *     Creates a panel with a map inside it.
- *
- * Parameters:
- * config - {Object} A config object. In addition to the config options
- *     of its parent class, this object can receive specific options,
- *     see the API properties to know about these specific options.
+/** jst: constructor
+ *  .. class:: MapPanel(config)
+ *   
+ *      Create a panel container for a map.
  */
 GeoExt.MapPanel = Ext.extend(Ext.Panel, {
-    /**
-     * APIProperty: map
-     * {OpenLayers.Map|Object} An {OpenLayers.Map} instance
-     * or an {OpenLayers.Map} config object, in the latter case
-     * the map panel will take care of creating the {OpenLayers.Map}
-     * object.
+    
+    /** jst: config[]
+     *  .. describe:: map
+     *       
+     *      ``OpenLayers.Map or Object``  A configured map or a configuration object
+     *      for the map constructor.  A configured map will be available after
+     *      construction through the :attr:`map` property.
      */
+
+    /** jst: properties[]
+     *  .. attribute:: MapPanel.map
+     *
+     *  ``OpenLayers.Map``  A configured map object.
+     */
     map: null,
     
-    /**
-     * APIProperty: layers
-     * {GeoExt.data.LayerStore|GeoExt.data.GroupingStore|Array(OpenLayers.Layer)}
-     *     A store holding records. If not provided, an empty
-     *     {<GeoExt.data.LayerStore>} will be created. After instantiation
-     *     this property will always be an {Ext.data.Store}, even if an array
-     *     of {OpenLayers.Layer} was provided.
+    /** jst: config[]
+     *  .. describe:: layers
+     *  
+     *      ``GeoExt.data.LayerStore or GeoExt.data.GroupingStore or Array(OpenLayers.Layer)``
+     *      A store holding records. If not provided, an empty
+     *      :class:`GeoExt.data.LayerStore` will be created.
      */
+    
+    /** jst: properties[]
+     *  .. attribute:: MapPanel.layers
+     *      
+     *      :class:`GeoExt.data.LayerStore`  A store containing
+     *      :class:`GeoExt.data.LayerRecord` objects.
+     */
     layers: null,
-
-    /**
-     * APIProperty: center
-     * {OpenLayers.LonLat} The lonlat to which the map will
-     * be initially centered, to be used in conjunction with
-     * the zoom option.
+    
+    /** jst: config[]
+     *  .. describe:: center
+     *  
+     *      ``OpenLayers.LonLat or Array(Number)``  A location for the map center.  If
+     *      an array is provided, the first two items should represent x & y coordinates.
      */
     center: null,
 
-    /**
-     * APIProperty: zoom
-     * {Number} The initial zoom level of the map, to be used
-     * in conjunction with the center option.
+    /** jst: config[]
+     *  .. describe:: zoom
+     *  
+     *      ``Number``  An initial zoom level for the map.
      */
     zoom: null,
 
-    /**
-     * APIProperty: extent
-     * {OpenLayers.Bounds} The initial extent of the map, use
-     * either this option of the center and zoom options.
+    /** jst: config[]
+     *  .. describe:: extent
+     *  
+     *      ``OpenLayers.Bounds or Array(Number)``  An initial extent for the map (used
+     *      if center and zoom are not provided.  If an array, the first four items
+     *      should be minx, miny, maxx, maxy.
      */
     extent: null,
     
@@ -192,7 +202,9 @@
     
 });
 
-/**
- * XType: gx_mappanel
+/** jst: xtype
+ *  .. describe:: xtype
+ *  
+ *      gx_mappanel
  */
 Ext.reg('gx_mappanel', GeoExt.MapPanel); 



More information about the Commits mailing list