From 178623bbd8e9aab75b6206ef69f67b62edb3d12e Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 28 Jul 2008 05:31:47 +0000 Subject: Tweaks. --- docs/tutorials/lxmlgraph/step02.rst | 39 +++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 19 deletions(-) (limited to 'docs/tutorials/lxmlgraph/step02.rst') diff --git a/docs/tutorials/lxmlgraph/step02.rst b/docs/tutorials/lxmlgraph/step02.rst index 94aca07e4..1dc1ebcd3 100644 --- a/docs/tutorials/lxmlgraph/step02.rst +++ b/docs/tutorials/lxmlgraph/step02.rst @@ -6,7 +6,7 @@ We now have a project named ``lxmlgraph``. It contains a *package* (also) named ``lxmlgraph``. In this step we will add an XML document to the *package* as our model -data. We will leverage the following ``repoze.bfg`` machinery: +data. We will leverage the following :mod:`repoze.bfg` machinery: - Model data with interfaces that define "types" @@ -14,11 +14,11 @@ data. We will leverage the following ``repoze.bfg`` machinery: Our application will need to do these things: - - Use :term:`lxml` Element classes to inject ``repoze.bfg`` behavior into - ``lxml`` nodes + - Use :term:`lxml` Element classes to inject :mod:`repoze.bfg` + behavior into ``lxml`` nodes - - That model class needs to implement the ``repoze.bfg`` publishing - contract + - That model class needs to implement the :mod:`repoze.bfg` + publishing contract All of the below filenames are relative to the ``lxmlgraph`` *package* rather than the *project*. @@ -40,18 +40,17 @@ your package: #. In lines 3-4, the ```` contains 2 top-level children: a and b. These are provided as an element name ````. This, - also, is meaningless as far as ``repoze.bfg`` is concerned. + also, is meaningless as far as :mod:`repoze.bfg` is concerned. However, this is where you compose the information model you are publishing. The only special constraint is that an XML node that wants to be -"found" by ``repoze.bfg`` in during traversal *must* have a ``name`` -attribute. (The use of ``@name`` corresponds to ``__name__`` in the -``repoze.bfg`` sense of ``repoze.bfg`` :term:`location` ). Each hop -in the URL tries to grab a child with an attribute matching the next -hop. Also, the value of the ``@name`` should be unique in its -containing node. - +"found" by :mod:`repoze.bfg` in during traversal *must* have a +``name`` attribute. (The use of ``@name`` corresponds to ``__name__`` +in the :mod:`repoze.bfg` sense of :term:`location` ). Each hop in the +URL tries to grab a child with an attribute matching the next hop. +Also, the value of the ``@name`` should be unique in its containing +node. Module ``models.py`` ------------------------------ @@ -64,7 +63,7 @@ class with the parser. Replace the contents of the autogenerated .. literalinclude:: step02/myapp/models.py :linenos: -#. Line 4 imports ``lxml``. +#. Line 4 imports :term:`lxml`. #. Line 9 creates the custom class we are going to use to extend etree.ElementBase. The `