28
28
semantic markup you can add the better. So::
30
30
Add ``django.contrib.auth`` to your ``INSTALLED_APPS``...
32
32
Isn't nearly as helpful as::
34
34
Add :mod:`django.contrib.auth` to your :setting:`INSTALLED_APPS`...
36
This is because Sphinx will generate proper links for the later, which greatly
36
This is because Sphinx will generate proper links for the latter, which greatly
37
37
helps readers. There's basically no limit to the amount of useful markup you can
45
45
__ http://sphinx.pocoo.org/markup/desc.html
49
49
.. setting:: INSTALLED_APPS
51
51
To link to a setting, use ``:setting:`INSTALLED_APPS```.
55
55
.. templatetag:: regroup
57
57
To link, use ``:ttag:`regroup```.
59
59
* Template filters::
61
61
.. templatefilter:: linebreaksbr
63
63
To link, use ``:tfilter:`linebreaksbr```.
65
65
* Field lookups (i.e. ``Foo.objects.filter(bar__exact=whatever)``)::
67
67
.. fieldlookup:: exact
69
69
To link, use ``:lookup:`exact```.
71
71
* ``django-admin`` commands::
73
73
.. django-admin:: syncdb
75
75
To link, use ``:djadmin:`syncdb```.
77
77
* ``django-admin`` command-line options::
79
79
.. django-admin-option:: --traceback
81
81
To link, use ``:djadminopt:`--traceback```.
86
86
For a quick example of how it all fits together, check this out:
88
88
* First, the ``ref/settings.txt`` document starts out like this::
97
97
* Next, if you look at the ``topics/settings.txt`` document, you can see how
98
98
a link to ``ref/settings`` works::
100
100
Available settings
101
101
==================
103
103
For a full list of available settings, see the :ref:`settings reference
106
106
* Next, notice how the settings (right now just the top few) are annotated::
108
108
.. setting:: ADMIN_FOR
115
115
Used for admin-site settings modules, this should be a tuple of settings
116
116
modules (in the format ``'foo.bar.baz'``) for which this site is an
119
119
The admin site uses this in its automatically-introspected
120
120
documentation of models, views and template tags.
122
122
This marks up the following header as the "canonical" target for the
123
123
setting ``ADMIN_FOR`` This means any time I talk about ``ADMIN_FOR``, I
124
124
can reference it using ``:setting:`ADMIN_FOR```.
126
126
That's basically how everything fits together.
134
134
this TODO item my permission and license) into
135
135
``topics/generic-views.txt``; remove the intro material from
136
136
``ref/generic-views.txt`` and just leave the function reference.
138
138
* Change the "Added/changed in development version" callouts to proper
139
139
Sphinx ``.. versionadded::`` or ``.. versionchanged::`` directives.
141
141
* Check for and fix malformed links. Do this by running ``make linkcheck``
142
142
and fix all of the 300+ errors/warnings.
144
In particular, look at all the relative links; these need to be
144
In particular, look at all the relative links; these need to be
145
145
changed to proper references.
147
147
* Most of the various ``index.txt`` documents have *very* short or even
148
148
non-existent intro text. Each of those documents needs a good short intro
149
149
the content below that point.
151
151
* The glossary is very perfunctory. It needs to be filled out.
153
153
* Add more metadata targets: there's lots of places that look like::
158
158
\... these should be::
160
160
.. method:: File.close()
162
162
That is, use metadata instead of titles.
164
164
* Add more links -- nearly everything that's an inline code literal
165
right now can probably be turned into a xref.
165
right now can probably be turned into a xref.
167
167
See the ``literals_to_xrefs.py`` file in ``_ext`` -- it's a shell script
168
168
to help do this work.
170
170
This will probably be a continuing, never-ending project.
172
172
* Add `info field lists`__ where appropriate.
174
174
__ http://sphinx.pocoo.org/markup/desc.html#info-field-lists
176
176
* Add ``.. code-block:: <lang>`` to literal blocks so that they get
189
189
"crossref" directives. Others (``.. class::``, e.g.) generate their own
190
190
markup; these should go inside the section they're describing. These are
191
191
called "description units".
193
193
You can tell which are which by looking at in :file:`_ext/djangodocs.py`;
194
194
it registers roles as one of the other.
196
196
* When referring to classes/functions/modules, etc., you'll want to use the
197
197
fully-qualified name of the target
198
(``:class:`django.contrib.contenttypes.models.ContentType```).
198
(``:class:`django.contrib.contenttypes.models.ContentType```).
200
200
Since this doesn't look all that awesome in the output -- it shows the
201
201
entire path to the object -- you can prefix the target with a ``~``
202
202
(that's a tilde) to get just the "last bit" of that path. So