Changeset 3132

Show
Ignore:
Timestamp:
01/23/08 04:21:31 (9 months ago)
Author:
cboos
Message:

Finalize porting to 0.11 (tested with [trac 6391]).

I remember now why I kept the Clearsilver template... I was a bit reluctant to have to read the doxygen generated files in memory.

So those changes will have a slight performance/memory impact, until Genshi supports raw includes (and more efficient streaming).

Should fix #2446.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • doxygenplugin/0.11/doxygentrac/doxygentrac.py

    r2651 r3132  
    1313 
    1414from genshi.builder import tag 
     15from genshi.core import Markup 
    1516 
    1617from trac.config import Option 
     
    1920from trac.perm import IPermissionRequestor 
    2021from trac.web.chrome import INavigationContributor, ITemplateProvider, \ 
    21   add_stylesheet 
     22                            add_stylesheet, add_ctxtnav 
    2223from trac.search.api import ISearchSource 
    2324from trac.wiki.api import WikiSystem, IWikiSyntaxProvider 
     
    146147                    text = 'Doxygen index page [wiki:%s] does not exist.' % \ 
    147148                           wiki 
    148                 text = wiki_to_html(text, self.env, req) 
    149                 req.hdf['doxygen.text'] = text 
    150                 req.hdf['doxygen.wiki_href'] = req.href.wiki(wiki) 
    151                 req.hdf['doxygen.wiki_page'] = wiki 
    152                 return 'doxygen.cs', 'text/html' 
     149                data = {'doxygen_text': wiki_to_html(text, self.env, req)} 
     150                add_ctxtnav(req, "View %s page" % wiki, req.href.wiki(wiki)) 
     151                return 'doxygen.html', data, 'text/html' 
    153152            # use configured Doxygen index 
    154153            path = os.path.join(self.base_path, self.default_doc, 
     
    166165        if mimetype == 'text/html': 
    167166            add_stylesheet(req, 'doxygen/css/doxygen.css') 
    168             req.hdf['doxygen.path'] = path 
    169             return 'doxygen.cs', 'text/html' 
     167            # Genshi can't include an unparsed file 
     168            # data = {'doxygen_path': path} 
     169            try: 
     170                content = Markup(file(path).read()) 
     171                data = {'doxygen_content': content} 
     172                return 'doxygen.html', data, 'text/html' 
     173            except OSError, e: 
     174                raise TracError("Can't read doxygen content: %s" % e) 
    170175        else: 
    171176            req.send_file(path, mimetype)             
  • doxygenplugin/0.11/doxygentrac/templates/doxygen.html

    r1251 r3132  
    11<?cs include "header.cs"?> 
    2 <?cs include "macros.cs"?> 
     2<!DOCTYPE html 
     3    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
     4    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
     5<html xmlns="http://www.w3.org/1999/xhtml" 
     6      xmlns:py="http://genshi.edgewall.org/" 
     7      xmlns:xi="http://www.w3.org/2001/XInclude"> 
     8  <xi:include href="layout.html" /> 
     9  <head> 
     10    <title>Doxygen Trac</title> 
     11  </head> 
    312 
    4 <?cs if:doxygen.text ?> 
    5   <?cs if:doxygen.wiki_page ?> 
    6    <div id="ctxtnav" class="nav"> 
    7     <h2>Doxygen Navigation</h2> 
    8     <ul><li class="first last"><a href="<?cs var:doxygen.wiki_href ?>"> 
    9        View <?cs var:doxygen.wiki_page ?></a></li> 
    10     </ul> 
    11    </div> 
    12   <?cs /if ?> 
    13   <div id="content" class="wiki"> 
    14     <div class="wikipage"> 
    15       <div id="searchable"> 
    16         <?cs var:doxygen.text ?> 
     13  <body> 
     14    <div id="content" class="doxygen"> 
     15      <div py:if="doxygen_text" id="content" class="wiki"> 
     16         <div class="wikipage"> 
     17           <div id="searchable" py:content="doxygen_text" /> 
     18        </div> 
    1719      </div> 
    18    </div> 
    19 <?cs else ?> 
    20   <?cs include doxygen.path ?> 
    21 <?cs /if ?> 
    2220 
    23 <?cs include "footer.cs"?> 
     21      <div py:if="doxygen_content"> 
     22        <!--! 
     23         !    Ideally it would be nice to be able to use Genshi xi:include 
     24         !    but there's currently no way to specify /no/ parsing on the 
     25         !    included file, as in: 
     26         ! 
     27         !      <xi:include href="$doxygen_path" parse="" />  
     28         ! 
     29         !    (using parse="text" won't work either, as the output will be 
     30         !     HTML escaped) 
     31         !--> 
     32        ${doxygen_content} 
     33      </div> 
     34 
     35    </div> 
     36  </body> 
     37</html> 
  • doxygenplugin/0.11/setup.py

    r2069 r3132  
    88    description='Doxygen plugin for Trac', 
    99    keywords='trac doxygen', 
    10     version='0.11.1', 
     10    version='0.11.0.1', 
    1111    url='http://trac-hacks.org/wiki/DoxygenPlugin', 
    1212    license = """Copyright (C) 2005 Jason Parks <jparks@jparks.net>