[Checkins] SVN: grok/trunk/doc/ improve css for function and decorators. improve ref docs for components and directives. fix typo in header.

Kevin Teague kevin at bud.ca
Sun Sep 28 23:14:40 EDT 2008


Log message for revision 91586:
  improve css for function and decorators. improve ref docs for components and directives.  fix typo in header.

Changed:
  U   grok/trunk/doc/.static/grok.css
  U   grok/trunk/doc/layout.html
  U   grok/trunk/doc/reference/components.rst
  U   grok/trunk/doc/reference/directives.rst

-=-
Modified: grok/trunk/doc/.static/grok.css
===================================================================
--- grok/trunk/doc/.static/grok.css	2008-09-28 20:19:58 UTC (rev 91585)
+++ grok/trunk/doc/.static/grok.css	2008-09-29 03:14:38 UTC (rev 91586)
@@ -696,6 +696,8 @@
     border: 1px solid #dddddd;
 }
 
+
+/* only applies to the class name */
 dl.class {
     color: #555555;
     background: #fafaf8;
@@ -708,7 +710,6 @@
     padding: 0;
 }
 
-/* only applies to the class name */
 dl.class > dt {
     padding: 0.5em;
     margin: 0 -1em;
@@ -727,6 +728,37 @@
     padding: 0;
 }
 
+/* only applies to functions */
+dl.function {
+    color: #555555;
+    background: #fafaf8;
+    padding: 0 1em 1em 1em;
+    border: 1px solid #eed;
+}
+
+dl.function dt {
+    margin: 0;
+    padding: 0;
+}
+
+dl.function > dt {
+    padding: 0.5em;
+    margin: 0 -1em;
+    background-color: #eed;
+}
+
+dl.function dd {
+    color: black;
+    font-size: 100%;
+    padding: 0;
+    margin: 0.5em 1em 0.5em 1em;
+}
+
+dl.function > dd {
+    margin: 0.5em 0 0 0;
+    padding: 0;
+}
+
 p.admonition-title {
     margin: 0 0.5em 0.5em 0;
     display: inline;

Modified: grok/trunk/doc/layout.html
===================================================================
--- grok/trunk/doc/layout.html	2008-09-28 20:19:58 UTC (rev 91585)
+++ grok/trunk/doc/layout.html	2008-09-29 03:14:38 UTC (rev 91586)
@@ -18,7 +18,7 @@
             <li><a href="{{ pathto("reference/index") }}">Reference</a></li>
             <li><a rel="index" title="Global index" href="{{ pathto('genindex') }}">Index</a></li>
             <li><a href="{{ pathto("changes") }}">What's Changed</a></li>
-            <li><a href="http://grok.zope.org/documentation/">Grok Community Doucmentation</a></li>
+            <li><a href="http://grok.zope.org/documentation/">Grok Community Documentation</a></li>
             {%- block relbaritems %}{% endblock %}
       </ul>
       </div>

Modified: grok/trunk/doc/reference/components.rst
===================================================================
--- grok/trunk/doc/reference/components.rst	2008-09-28 20:19:58 UTC (rev 91585)
+++ grok/trunk/doc/reference/components.rst	2008-09-29 03:14:38 UTC (rev 91586)
@@ -1194,8 +1194,8 @@
 
 Permissions are used to protect Views so that they can only be called by
 an authenticated principal. If a View in Grok does not have a `grok.require`
-directive declaring a permission needed to use the View, then the view will
-be public.
+directive declaring a permission needed to use the View, then the default
+anonymously viewable `grok.Public` permission used.
 
 .. class:: grok.Permission
 

Modified: grok/trunk/doc/reference/directives.rst
===================================================================
--- grok/trunk/doc/reference/directives.rst	2008-09-28 20:19:58 UTC (rev 91585)
+++ grok/trunk/doc/reference/directives.rst	2008-09-29 03:14:38 UTC (rev 91586)
@@ -110,14 +110,22 @@
     :class:`grok.View`
 
 
-:func:`grok.title` -- succincint description
-============================================
+:func:`grok.title` -- succinct description
+==========================================
 
-.. function:: grok.title(*arg)
+.. function:: grok.title(title)
 
    A descriptive title for a component.
 
 
+:func:`grok.description` -- longer description
+==============================================
+
+.. function:: grok.description(description)
+
+  A longer description for a component.
+
+ 
 :func:`grok.implements` -- indicate, that a class implements an interface
 =========================================================================
 
@@ -200,6 +208,19 @@
     :func:`grok.implements`
 
 
+:func:`grok.direct` -- specify that the class should be the component
+=====================================================================
+
+.. function:: grok.direct()
+
+    Specify whether the class should be used for the component
+    or whether it should be used to instantiate the component.
+
+    This directive can be used on GlobalUtility-based classes to
+    indicate whether the class itself should be registered as a
+    utility, or an instance of it.
+
+
 :func:`grok.adapts` -- declare that a class adapts certain objects
 ==================================================================
 
@@ -457,9 +478,51 @@
     :class:`grok.Permission` component, :func:`@grok.require` decorator
 
 
-Template directives
-~~~~~~~~~~~~~~~~~~~
+Component registry directives
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+:func:`grok.site` -- specify the local component registry to use for indexes
+============================================================================
+
+A class level directive used in `grok.Indexes` sub-classes to define
+in which local component registry the indexes should be located.
+
+.. function:: grok.site(*arg)
+
+**Example**
+
+.. code-block:: python
+
+    class MammothIndexes(grok.Indexes):
+	grok.site(Herd)
+	grok.context(IMammoth)
+
+	name = index.Field()
+
+View directives
+~~~~~~~~~~~~~~~
+
+:func:`grok.layer` -- declare the layer for the view
+====================================================
+
+.. function:: grok.layer(layer)
+
+    Declare the layer for the view.
+
+    This directive acts as a contraint on the 'request' of
+    grok.View. This directive can only be used on class level.
+
+
+:func:`grok.skin` -- declare this layer as a named skin
+=======================================================
+
+.. function:: grok.skin(skin)
+
+    Declare this layer as a named skin.
+
+    This directive can only be used on class level.
+
+
 :func:`grok.template` -- specify a template filename
 ====================================================
 
@@ -492,34 +555,35 @@
 
     `directory` -- the name of the directory inside the same package
                    as the module
-    
+
 .. seealso::
 
     :func:`grok.template`
 
 
-Component registry directives
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+:func:`grok.order` -- specify ordering of components
+====================================================
 
-:func:`grok.site` -- specify the local component registry to use for indexes
-============================================================================
+Ordering is typically used in Viewlets to determine the order in which 
+they are displayed.
 
-A class level directive used in `grok.Indexes` sub-classes to define
-in which local component registry the indexes should be located.
+.. function:: grok.order(order)
 
-.. function:: grok.site(*arg)
+    Control the ordering of components.
 
-**Example**
+    If the value is specified, the order will be determined by sorting on it.
+    If no value is specified, the order will be determined by definition
+    order within the module. If the directive is absent, the order will be
+    determined by class name.
 
-.. code-block:: python
+    Inter-module order is by dotted name of the module the components are in,
+    unless an explicit argument is specified to ``grok.order()``, components are
+    grouped by module.
 
-    class MammothIndexes(grok.Indexes):
-	grok.site(Herd)
-	grok.context(IMammoth)
+The function grok.util.sort_components can be used to sort
+components according to these rules.
 
-	name = index.Field()
 
-
 URL Traversal directives
 ~~~~~~~~~~~~~~~~~~~~~~~~
 



More information about the Checkins mailing list