Opened 13 years ago

Closed 13 years ago

#17177 closed Bug (duplicate)

Building django documentation with Sphinx 1.1

Reported by: Oleksandr Gavenko Owned by: Dan Poirier
Component: Documentation Version: 1.3
Severity: Normal Keywords:
Cc: Oleksandr Gavenko Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I install python-sphinx from Cygwin:

  $ cygcheck.exe -c python-sphinx
Cygwin Package Information
Package              Version        Status
python-sphinx        1.1-1          OK

Get Django from official mirror:

  $ hg clone https://bitbucket.org/django/django
  $ hg up -r releases/1.3.1

and try build html docs:

  $ cd docs
  $ make html

I get error:

sphinx-build -b djangohtml -d _build/doctrees   . _build/html
Running Sphinx v1.1
loading pickled environment... done
building [djangohtml]: targets for 205 source files that are out of date
updating environment: [config changed] 205 added, 0 changed, 0 removed
reading sources... [100%] topics/testing
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [  5%] howto/apache-auth
Exception occurred:
  File "/usr/lib/python2.6/site-packages/sphinx/writers/html.py", line 522, in visit_row
    self._table_row_index += 1
AttributeError: DjangoHTMLTranslator instance has no attribute '_table_row_index'

I go to docs/_ext/djangodocs.py class DjangoHTMLTranslator and just add _table_row_index field. Next build stoped at:

  $ make html
sphinx-build -b djangohtml -d _build/doctrees   . _build/html
Running Sphinx v1.1
loading pickled environment... done
building [djangohtml]: targets for 205 source files that are out of date
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found
preparing documents... done
writing output... [  7%] howto/custom-management-commands
Exception occurred:
  File "/usr/lib/python2.6/site-packages/sphinx/writers/html.py", line 125, in visit_desc_parameter
    self.body.append(self.param_separator)
AttributeError: DjangoHTMLTranslator instance has no attribute 'param_separator'

So I add param_separator to DjangoHTMLTranslator. So I get:

class DjangoHTMLTranslator(SmartyPantsHTMLTranslator):
    """
    Django-specific reST to HTML tweaks.
    """

    _table_row_index = 0
    param_separator = ', '

    ....

After this I succesfully build Djando docs!

Change History (3)

comment:1 by Oleksandr Gavenko, 13 years ago

Cc: Oleksandr Gavenko added

comment:2 by Dan Poirier, 13 years ago

Owner: changed from nobody to Dan Poirier
Status: newassigned

comment:3 by Dan Poirier, 13 years ago

Resolution: duplicate
Status: assignedclosed

Dup of 15649

Version 0, edited 13 years ago by Dan Poirier (next)
Note: See TracTickets for help on using tickets.
Back to Top