Browse Source

Added context_processors doc and removed Jinja mention.

Rafał Pitoń 11 years ago
parent
commit
24e738802e
3 changed files with 21 additions and 1 deletions
  1. 18 0
      docs/developers/context_processors.rst
  2. 2 1
      docs/developers/index.rst
  3. 1 0
      docs/index.rst

+ 18 - 0
docs/developers/context_processors.rst

@@ -0,0 +1,18 @@
+=========================
+Misago Context Processors
+=========================
+
+Context Processors are simple python functions that receive HttpRequest object and extend template context with additional values. In addition to `default context processors defined by Django <https://docs.djangoproject.com/en/dev/ref/templates/api/#subclassing-context-requestcontext>`_, Misago defines its own context processors:
+
+
+misago.core.context_processors.site_address
+===========================================
+
+:py:func:`misago.core.context_processors.site_address`
+
+This function adds `SITE_ADDRESS` value to template context that you can use to build absolue links in your templates::
+
+    # Will become "http://mysite.com/"
+    {{ SITE_ADDRESS }}{% url 'forum_index' %}
+
+This is most useful for links in e-mail templates.

+ 2 - 1
docs/developers/index.rst

@@ -14,7 +14,7 @@ Customizing Appearance
 
 Misago appearance is product of many different technologies acting together to produce final result that you and your users see in their browsers.
 
-On server side powerful, performant and extensible template engine named `Jinja2 <http://jinja.pocoo.org/>`_ turns template files into final html that is displayed in browser while asset pipeline compiles, merges and optimizes less, css and javascript files making your browser load faster and relieving you from burden of compressing and optimizing them yourself.
+On server side simple and easy to learn but powerful `Django template engine <https://docs.djangoproject.com/en/dev/ref/templates/>`_ turns template files into final html that is displayed in browser while asset pipeline compiles, merges and optimizes less, css and javascript files making your browser load faster and relieving you from burden of compressing and optimizing them yourself.
 
 On browser side Misago comes with it's own UI framework that uses `Bootstrap <http://getbootstrap.com>`_, `jQuery <http://jquery.org>`_ as well Glyphicons and `Font Awesome <http://fontawesome.io>`_ as it's foundations that allows you to provide smooth, pleasant and modern experience to your site's users.
 
@@ -37,3 +37,4 @@ Following references cover everything you want to know about writing your own ap
    cache_buster
    thread_store
    forms
+   context_processors

+ 1 - 0
docs/index.rst

@@ -26,3 +26,4 @@ Table of Contents
    developers/cache_buster
    developers/thread_store
    developers/forms
+   developers/context_processors