Mar 20 2009

Reffering to Django docs from your docs using Sphinx

Category: Djangovbmendes @ 12:25

Sphinx is a great documentation tool, and one of it’s built-in extensions is sphinx.ext.intersphinx. It simply takes your objects references for other projects and converts to links in the other project’s documentation.

In sphinx-quickstart command, it asks if you want to add this extension. If so, It adds this code to your conf.py file:

extensions = ['sphinx.ext.intersphinx']
intersphinx_mapping = {'http://docs.python.org/dev': None}

As you can see, it comes integrated with python documentation by default. But what I want is to integrate with Django documentation. So I changed the code a little bit:

extensions = ['sphinx.ext.intersphinx']
intersphinx_mapping = {
    'http://docs.python.org/dev': None,
    'http://docs.djangoproject.com/en/dev': 'http://docs.djangoproject.com/en/dev/_objects',
}

Sphinx looks for default for the file name objects.inv inside the documentation root, but django doesn’t provide such a file. Since ticket #10315 they provided a file like objects.inv but with a different URL: http://docs.djangoproject.com/en/dev/_objects/.

Now, all you have to do is reffer to classe or any kind of objects inside django: :class:django.contrib.auth.models.User. It will refference the User documentation inside django’s docs.

Tags: , , , ,


Mar 18 2009

Documenting Django pluggable apps with Sphinx

Category: Djangovbmendes @ 15:06

I decided to document my Django projects with the same tool used by Django team: Sphinx. It is a very good documenting tool, and was used for many other projects, including the Python Project itself.

But it has a simple problem with Django, that I found the solution rlazo’s blog. But it still has some problems, when you are trying to document a pluggable app, that doesn’t have a project, you have to configure the django settings without the project settings, since pluggable apps doesn’t have a settings module.

Thanks to apollo13, who shown me this better approach, you can simply add this code to sphinx’s conf.py file:

from django.conf import settings
settings.configure()

With this approach, you don’t need to add any kind of fake files in your project.

Tags: , , , ,


Jan 28 2009

MeioUpload Behavior documentation in other languages

Category: CakePHPvbmendes @ 20:12

I found out that the documentation of the MeioUpload was translated to other languages and I want to announce it. Here are the links:

Tags: , , , ,