From ac6ebd8b38a46afb0b249574be71a276f95b6efa Mon Sep 17 00:00:00 2001 From: Stephen Burrows Date: Thu, 12 May 2011 16:54:47 -0400 Subject: [PATCH] Added docs for the db template loader and skeleton docs for templatetags. Updated template tag references to actually point to templatetags. Made some minor improvements to references. --- docs/conf.py | 4 ++ docs/index.rst | 4 +- docs/loaders.rst | 5 ++ docs/models/entities.rst | 2 +- docs/models/nodes-and-views.rst | 2 + docs/templatetags.rst | 74 ++++++++++++++++++++++++++++ philo/loaders/database.py | 4 ++ philo/models/pages.py | 14 +++--- philo/templatetags/collections.py | 5 +- philo/templatetags/containers.py | 5 +- philo/templatetags/embed.py | 13 +++-- philo/templatetags/include_string.py | 6 ++- philo/templatetags/nodes.py | 11 +++-- 13 files changed, 130 insertions(+), 19 deletions(-) create mode 100644 docs/loaders.rst create mode 100644 docs/templatetags.rst diff --git a/docs/conf.py b/docs/conf.py index 043219d..f32576a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -91,6 +91,10 @@ pygments_style = 'sphinx' #modindex_common_prefix = [] +# Autodoc config +autodoc_member_order = "bysource" + + # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for diff --git a/docs/index.rst b/docs/index.rst index 3575ddb..3e4b1e7 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -14,10 +14,12 @@ Contents: intro models/intro exceptions - middleware + handling_requests signals validators utilities + templatetags + loaders Indices and tables ================== diff --git a/docs/loaders.rst b/docs/loaders.rst new file mode 100644 index 0000000..41c4cd9 --- /dev/null +++ b/docs/loaders.rst @@ -0,0 +1,5 @@ +Database Template Loader +======================== + +.. automodule:: philo.loaders.database + :members: diff --git a/docs/models/entities.rst b/docs/models/entities.rst index c311d59..d794c90 100644 --- a/docs/models/entities.rst +++ b/docs/models/entities.rst @@ -1,7 +1,7 @@ Entities and Attributes ======================= -.. automodule:: philo.models.base +.. module:: philo.models.base One of the core concepts in Philo is the relationship between the :class:`Entity` and :class:`Attribute` classes. :class:`Attribute`\ s represent an arbitrary key/value pair by having one :class:`GenericForeignKey` to an :class:`Entity` and another to an :class:`AttributeValue`. diff --git a/docs/models/nodes-and-views.rst b/docs/models/nodes-and-views.rst index b78dbd9..ab6dfb9 100644 --- a/docs/models/nodes-and-views.rst +++ b/docs/models/nodes-and-views.rst @@ -52,6 +52,8 @@ Pages .. autoclass:: Template :members: :show-inheritance: + + .. seealso:: :mod:`philo.loaders.database` .. autoclass:: Contentlet :members: diff --git a/docs/templatetags.rst b/docs/templatetags.rst new file mode 100644 index 0000000..60224eb --- /dev/null +++ b/docs/templatetags.rst @@ -0,0 +1,74 @@ +Template Tags +============= + +.. automodule:: philo.templatetags + +Collections ++++++++++++ + +.. automodule:: philo.templatetags.collections + + .. templatetag:: membersof + + membersof + --------- + + Usage:: + + {% membersof with . as %} + + +.. automodule:: philo.templatetags.containers + + .. templatetag:: container + + container + --------- + + Usage:: + + {% container [[references .] as ] %} + +.. automodule:: philo.templatetags.embed + + .. templatetag:: embed + + embed + ----- + + The {% embed %} tag can be used in two ways. + + To set which template will be used to render a particular model:: + + {% embed . with