Skip to content

Commit

Permalink
Update doc and extension, close #528
Browse files Browse the repository at this point in the history
  • Loading branch information
Fantomas42 committed Mar 10, 2018
1 parent 449552f commit b494930
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
'extensions.zinnia_docs']

intersphinx_mapping = {
'django': ('http://readthedocs.org/docs/django/en/latest/', None),
'django': ('https://django.readthedocs.io/en/latest/', None),
}

# Add any paths that contain templates here, relative to this directory.
Expand Down
24 changes: 12 additions & 12 deletions docs/extensions/zinnia_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import inspect

from django.db import models
from django.utils.encoding import force_text
from django.utils.html import strip_tags
from django.utils.encoding import force_unicode


def skip_model_member(app, what, name, obj, skip, options):
Expand All @@ -22,10 +22,10 @@ def process_model_docstring(app, what, name, obj, options, lines):
if inspect.isclass(obj) and issubclass(obj, models.Model):
for field in obj._meta.fields:
# Decode and strip any html out of the field's help text
help_text = strip_tags(force_unicode(field.help_text))
help_text = strip_tags(force_text(field.help_text))
# Decode and capitalize the verbose name, for use if there isn't
# any help text
verbose_name = force_unicode(field.verbose_name).capitalize()
verbose_name = force_text(field.verbose_name).capitalize()

if help_text:
lines.append(':param %s: %s' % (field.attname, help_text))
Expand All @@ -40,19 +40,19 @@ def process_model_docstring(app, what, name, obj, options, lines):

def setup(app):
app.add_crossref_type(
directivename = 'setting',
rolename = 'setting',
indextemplate = 'pair: %s; setting',
directivename='setting',
rolename='setting',
indextemplate='pair: %s; setting',
)
app.add_crossref_type(
directivename = 'templatetag',
rolename = 'ttag',
indextemplate = 'pair: %s; template tag'
directivename='templatetag',
rolename='ttag',
indextemplate='pair: %s; template tag'
)
app.add_crossref_type(
directivename = 'templatefilter',
rolename = 'tfilter',
indextemplate = 'pair: %s; template filter'
directivename='templatefilter',
rolename='tfilter',
indextemplate='pair: %s; template filter'
)
app.connect('autodoc-process-docstring',
process_model_docstring)
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
beautifulsoup4==4.6.0
django==2.0.2
django==2.0.3
django-contrib-comments==1.8.0
django-mptt==0.9.0
django-tagging==0.4.6
Expand Down

0 comments on commit b494930

Please sign in to comment.