[Checkins] SVN: grokcore.view/branches/jw-generic_directory_resource/ update readme and changes to document the directoryresource feature

Jan-Wijbrand Kolman janwijbrand at gmail.com
Mon Oct 13 16:07:13 EDT 2008


Log message for revision 92168:
  update readme and changes to document the directoryresource feature

Changed:
  U   grokcore.view/branches/jw-generic_directory_resource/CHANGES.txt
  U   grokcore.view/branches/jw-generic_directory_resource/README.txt

-=-
Modified: grokcore.view/branches/jw-generic_directory_resource/CHANGES.txt
===================================================================
--- grokcore.view/branches/jw-generic_directory_resource/CHANGES.txt	2008-10-13 20:04:33 UTC (rev 92167)
+++ grokcore.view/branches/jw-generic_directory_resource/CHANGES.txt	2008-10-13 20:07:12 UTC (rev 92168)
@@ -4,7 +4,11 @@
 1.2 (unreleased)
 ----------------
 
-* ...
+* Expose the ``DirectoryResource`` class as a component for registering
+  directories as resources. This is accompanied by the ``path`` directive that
+  is used to point to the directory holding resources by way of an relative (to
+  the module) or absolute path. ``DirectoryResource`` components can be
+  differentiated by name and layer.
 
 1.1 (2008-09-22)
 ----------------

Modified: grokcore.view/branches/jw-generic_directory_resource/README.txt
===================================================================
--- grokcore.view/branches/jw-generic_directory_resource/README.txt	2008-10-13 20:04:33 UTC (rev 92167)
+++ grokcore.view/branches/jw-generic_directory_resource/README.txt	2008-10-13 20:07:12 UTC (rev 92168)
@@ -110,6 +110,30 @@
 
   <img src="hello.png" tal:attributes="src static/hello.png" />
 
+DirectoryResource
+-----------------
+
+In addition to the very convenient "static resources", one can use more
+explicitly configured and flexible DirectoryResource components.
+DirectoryResource component allow for differentiating resources based on layers
+and names and provide a way to register resources in one package and make use
+of these resources in another package's views::
+
+  class FooResource(grokcore.view.DirectoryResource):
+      grokcore.view.path('foo')
+
+Or with an explicit name::
+
+  class BarResource(grokcore.view.DirectoryResource):
+      grokcore.view.name('bar')
+      grokcore.view.path('bar')
+
+Registered for a layer::
+
+  class BazResource(grokcore.view.DirectoryResource):
+      grokcore.view.layer(ISomeLayer)
+      grokcore.view.path('baz/qux')
+
 Layers and skins
 ----------------
 
@@ -230,6 +254,11 @@
     Directive used on a layer interface to register it as skin using a
     human-readable name (``skin_name``).
 
+``path(relative_or_absolute_path)``
+    Directove used in a DirectoryResource registration to point to a non-
+    package directory(hierarchy) containing resources like images, css files,
+    etc.
+
 Other
 -----
 



More information about the Checkins mailing list