summaryrefslogtreecommitdiff
path: root/docs/zcml/resource.rst
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2010-01-17 17:55:39 +0000
committerChris McDonough <chrism@agendaless.com>2010-01-17 17:55:39 +0000
commitbd73fc6cc17544d14b029c528cd70da73dd0a364 (patch)
tree29cb63aabf483a6049f5481c680a94cf9d1077af /docs/zcml/resource.rst
parent04bee54e9b793790e8e612ccaa50547f1e440e9f (diff)
downloadpyramid-bd73fc6cc17544d14b029c528cd70da73dd0a364.tar.gz
pyramid-bd73fc6cc17544d14b029c528cd70da73dd0a364.tar.bz2
pyramid-bd73fc6cc17544d14b029c528cd70da73dd0a364.zip
Using a single chapter for the API docs and a single chapter for the ZCML directives made it hard to read.
Diffstat (limited to 'docs/zcml/resource.rst')
-rw-r--r--docs/zcml/resource.rst64
1 files changed, 64 insertions, 0 deletions
diff --git a/docs/zcml/resource.rst b/docs/zcml/resource.rst
new file mode 100644
index 000000000..45aa1ce53
--- /dev/null
+++ b/docs/zcml/resource.rst
@@ -0,0 +1,64 @@
+.. _resource_directive:
+
+``resource``
+------------
+
+The ``resource`` directive adds a resource override for a single
+resource.
+
+Attributes
+~~~~~~~~~~
+
+``to_override``
+
+ A :term:`resource specification` specifying the resource to be
+ overridden.
+
+``override_with``
+
+ A :term:`resource specification` specifying the resource which
+ is used as the override.
+
+Examples
+~~~~~~~~
+
+.. topic:: Overriding a Single Resource File
+
+ .. code-block:: xml
+ :linenos:
+
+ <resource
+ to_override="some.package:templates/mytemplate.pt"
+ override_with="another.package:othertemplates/anothertemplate.pt"
+ />
+
+.. topic:: Overriding all Resources in a Package
+
+ .. code-block:: xml
+ :linenos:
+
+ <resource
+ to_override="some.package"
+ override_with="another.package"
+ />
+
+.. topic:: Overriding all Resources in a Subdirectory of a Package
+
+ .. code-block:: xml
+ :linenos:
+
+ <resource
+ to_override="some.package:templates/"
+ override_with="another.package:othertemplates/"
+ />
+
+Alternatives
+~~~~~~~~~~~~
+
+The :meth:`repoze.bfg.configuration.Configurator.override_resource`
+method can be used instead of the ``resource`` ZCML directive.
+
+See Also
+~~~~~~~~
+
+See also :ref:`resource_zcml_directive`.