~ubuntu-branches/ubuntu/maverick/sphinx/maverick

« back to all changes in this revision

Viewing changes to sphinx/builders/html.py

  • Committer: Bazaar Package Importer
  • Author(s): Debian Python Modules Team, Piotr Ożarowski
  • Date: 2010-01-13 23:26:40 UTC
  • mfrom: (5.2.4 sid)
  • Revision ID: james.westby@ubuntu.com-20100113232640-eb3h3hdngb07g0tv
Tags: 0.6.4-1
[ Piotr Ożarowski ]
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
    Several HTML builders.
7
7
 
8
 
    :copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS.
 
8
    :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
9
9
    :license: BSD, see LICENSE for details.
10
10
"""
11
11
 
161
161
            if docname not in self.env.all_docs:
162
162
                yield docname
163
163
                continue
164
 
            targetname = self.env.doc2path(docname, self.outdir,
165
 
                                           self.out_suffix)
 
164
            targetname = self.get_outfilename(docname)
166
165
            try:
167
166
                targetmtime = path.getmtime(targetname)
168
167
            except Exception:
416
415
                else:
417
416
                    stripped = ''
418
417
 
 
418
                # we stripped the whole module name
 
419
                if not mn:
 
420
                    continue
 
421
 
419
422
                if fl != mn[0].lower() and mn[0] != '_':
420
423
                    # heading
421
424
                    letter = mn[0].upper()
642
645
                   baseuri=self.get_target_uri(pagename)):
643
646
            if not resource:
644
647
                otheruri = self.get_target_uri(otheruri)
645
 
            return relative_uri(baseuri, otheruri)
 
648
            uri = relative_uri(baseuri, otheruri) or '#'
 
649
            return uri
646
650
        ctx['pathto'] = pathto
647
651
        ctx['hasdoc'] = lambda name: name in self.env.all_docs
648
652
        ctx['customsidebar'] = self.config.html_sidebars.get(pagename)
652
656
        self.app.emit('html-page-context', pagename, templatename,
653
657
                      ctx, event_arg)
654
658
 
655
 
        output = self.templates.render(templatename, ctx)
 
659
        try:
 
660
            output = self.templates.render(templatename, ctx)
 
661
        except UnicodeError:
 
662
            self.warn("a Unicode error occurred when rendering the page %s. "
 
663
                      "Please make sure all config values that contain "
 
664
                      "non-ASCII content are Unicode strings." % pagename)
 
665
            return
 
666
 
656
667
        if not outfilename:
657
668
            outfilename = self.get_outfilename(pagename)
658
669
        # outfilename's path is in general different from self.outdir