Commits

Stefan Scherfke committed 9981221

documentation fixes

Comments (0)

Files changed (6)

 # serve to show the default.
 
 import sys, os
+# from django.conf import settings
+# settings.configure()
 
 # If extensions (or modules to document with autodoc) are in another directory,
 # add these directories to sys.path here. If the directory is relative to the
 # documentation root, use os.path.abspath to make it absolute, like shown here.
-#sys.path.append(os.path.abspath('.'))
+sys.path.append(os.path.abspath('.'))
+sys.path.append(os.path.abspath('../'))
 
 # -- General configuration -----------------------------------------------------
 

doc/quickstart.txt

 
 This guide assumes that you already have a `Django
 <http://www.djangoproject.com/>`_ installation up and running. If this is not
-the case, you should work through `Django tutorial
+the case, you should work through the `Django tutorial
 <http://docs.djangoproject.com/en/dev/intro/install/#intro-install>`_ first.
 
 
 installation. Optionally, If you want to run the tests, you need to install
 `Mock <http://www.voidspace.org.uk/python/mock/>`_.
 
-You can either `download a stabled version
+You can either `download a stable version
 <http://bitbucket.org/scherfke/django-lastfm/downloads/>`_ or use the latest
-version from the repository.
+version from the `repository <http://bitbucket.org/scherfke/django-lastfm/src/>`_.
 
 If you downloaded the stable version, unpack it and open a terminal. Change to
-the directory that contains django-lastfm’s ``setup.py`` and execute it as
+the directory that contains *django-lastfm’s* ``setup.py`` and execute it as
 follows:
 
 .. sourcecode:: bash
 
 .. sourcecode:: bash
 
-    $ hg clone hg clone http://bitbucket.org/scherfke/django-lastfm/
+    $ hg clone http://bitbucket.org/scherfke/django-lastfm/
     $ cd django-lastfm/
     $ sudo python setup.py develop
+    
+With this done, all you need to do to upgrade your installation of *django-lastfm* is to type:
+
+.. sourcecode:: bash
+
+   $ hg pull -u
 
 
 Configuration
 Add the widget to your templates
 --------------------------------
 
-Django-lastfm provides a template tag that inserts the widget to the context
+*Django-lastfm* provides a template tag that inserts the widget to the context
 of your template (e.g. ``base.html``):
 
 .. sourcecode:: html+django
     
     <!-- ... -->
     
-The template tag ``get_last_widget`` creates a new context variable whose name
+The template tag ``get_lastfm_widget`` creates a new context variable whose name
 can be chosen as you want (e.g. ``lastfm_widget``). It has two attributes:
 ``title`` contains the string, that you specified in your ``settings.py``;
 ``content`` contains a ``<div>`` container and some AJAX code that retrieves the
     </div>
     
 The surrounding ``<div>`` has the CSS class *lastfm*. You can use this to
-customize the style of the widget. 
+customize the style of the widget. Here is an example:
 
 .. sourcecode:: css
 
         min-height: 225px; /* required due to "float: left" in the next sec. */
     }
 
-    #sidebar #lastfm div {
+    #sidebar > #lastfm div {
         width: 54px;
         height: 39px;
         overflow: hidden;
         margin: 0px 2px 4px 2px;
     }
 
-    #sidebar #lastfm div:active, #sidebar #lastfm div:hover {
+    #sidebar > #lastfm div:active, #sidebar #lastfm div:hover {
         border-color: #9FC765;
     }
 
-    #sidebar #lastfm img {
+    #sidebar > #lastfm img {
         width: 54px;
         min-height: 39px;
     }

doc/ref/templatetags.txt

 .. ref-templatetags:
 
-:mod:`lastfm.templatetags.lastfm_widget`
-========================================
+Template Tags
+=============
+
+Django-lastfm contains only one template tag in :mod:`lastfm.templatetags.lastfm_widget` that is used to load a context object
+with all necessary data.
 
 Usage of the template tag
 -------------------------
 Implementation
 --------------
 
-As for every template tag, there is a compilation function (:func:`get_lastfm_widget`) and a render (:class:`LastfmWidgetNode`) that do all the work.
+As for every template tag, there is a compilation function (:func:`get_lastfm_widget`) and a renderer (:class:`LastfmWidgetNode`) that do all the work.
 
 .. autoclass:: LastfmWidgetNode
 

doc/ref/views.txt

 .. _ref-views:
 
-:mod:`lastfm.views`
-===================
+Views
+=====
 
 .. automodule:: lastfm.views
 

lastfm/templatetags/lastfm_widget.py

         min-height: 225px; /* required due to "float: left" in the next sec. */
     }
 
-    #sidebar #lastfm div {
+    #sidebar > #lastfm div {
         width: 54px;
         height: 39px;
         overflow: hidden;
         margin: 0px 2px 4px 2px;
     }
 
-    #sidebar #lastfm div:active, #sidebar #lastfm div:hover {
+    #sidebar > #lastfm div:active, #sidebar #lastfm div:hover {
         border-color: #9FC765;
     }
 
-    #sidebar #lastfm img {
+    #sidebar > #lastfm img {
         width: 54px;
         min-height: 39px;
     }
 
 """
 The AJAX code generate by the template tag (see
-:mod:`templatetags.lastfm_widget`) doesn’t contact Last.fm directly, but uses a
-Django view as proxy. The advantage of this is, that you can exactly control
-what data your site gets. Another advantage is, that visitors can’t see your
-Last.fm username by inspecting the HTML source of your site.
+:mod:`lastfm.templatetags.lastfm_widget`) doesn’t contact Last.fm directly, but
+uses a Django view as proxy. The advantage of this is, that you can exactly
+control what data your site gets. Another advantage is, that visitors can’t see
+your Last.fm username by inspecting the HTML source of your site.
 
 In addition to the view itself this module also defines some helper classes that
 are responsible for handling the different types of charts (e.g. top tracks or
 
 
 def lastfm_data(request):
-    """This view retrievs the data from Last.fm and returns a JSON encoded list.         
-    The AJAX code from the template tag will retrive this list and generate
-    the chart from it.
+    """This view retrievs the data from Last.fm and returns a JSON encoded list.
+    The template tag’s AJAX code will retrive this list and generate the chart
+    from it.
     
-    Each list entry is a with three elements:
+    Each list entry is a dict with three elements:
      * ``title``: Contains the song title or artist name and can be displayed as
-       alternative text or link title
-     * ``url``: A url pointing to the track or artist on Last.fm
-     * ``img_url``: A url pointing to the track’s cover or artist image
+       alternative text or link title.
+     * ``url``: A url pointing to the track or artist on Last.fm.
+     * ``img_url``: A url pointing to the track’s cover or artist image.
     
     For each chart type there is a class that handles its data. They are
     necessary to unify Last.fm’s different key names to those three explained
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.