Code

Opened 3 years ago

Closed 3 years ago

#17177 closed Bug (duplicate)

Building django documentation with Sphinx 1.1

Reported by: gavenkoa Owned by: poirier
Component: Documentation Version: 1.3
Severity: Normal Keywords:
Cc: gavenkoa 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!

Attachments (0)

Change History (3)

comment:1 Changed 3 years ago by gavenkoa

  • Cc gavenkoa added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 3 years ago by poirier

  • Owner changed from nobody to poirier
  • Status changed from new to assigned

comment:3 Changed 3 years ago by poirier

  • Resolution set to duplicate
  • Status changed from assigned to closed

Dup of 15649

Version 0, edited 3 years ago by poirier (next)

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.