Opened 17 years ago

Last modified 12 years ago

#1973 closed defect

Problem for Includewikimacro with trac 0.11 — at Version 4

Reported by: sibok@… Owned by: Ryan J Ollos
Priority: normal Component: IncludeMacro
Severity: normal Keywords:
Cc: Trac Release: 0.10

Description (last modified by Ryan J Ollos)

The macros.py of Includewikimacro contains macro = WikiProcessor(self.env, 'Include') for the rendering of the wiki page, whereas now with the version 0.11 the function WikiProcessor() needs a formatter as first argument.

Change History (4)

comment:1 Changed 17 years ago by sibok@…

The class IncludeWikiMacro for trac 0.11 is :

class !IncludeWikiMacro(!WikiMacroBase):
    
    # IWikiMacroProvider methods
    def render_macro(self, req, name, content):
		#context = Context(self, req)
		#ctx = Context(self.env, req, db=db, abs_urls=absurls)
		#format = Formatter(self.context)
        macro = !WikiProcessor(Formatter(Context(self.env, req)), 'Include')
        if macro.error:
            return('Need the Include macro - error %s',
                   macro.error)

        if content[:5] == 'wiki:':
            pagename = content[5:]
        else:
            pagename = content

        source="wiki:%s" % pagename

        processed=macro.process(content, source)

        url = req.href.wiki(pagename)

        link = html.A(pagename,
                      href=url)
        
        editlink = html.A("edit",
                          href="%s?action=edit" % url)
        
        return """
        <div align="right"><small>[included from %s [%s]]</small></div>
        <div>%s</div>
        <div align="right"><small>[end of %s]</small></div>
        """ % (link,editlink,processed,pagename)

Benoît

comment:2 Changed 14 years ago by anonymous

This issue remains with Trac 0.12. Will it ever be resolved? The suggested change by Benoît is probably reasonable. But isn't it time to put that in the released macro?

comment:3 Changed 13 years ago by Ryan J Ollos

#5221 closed as a duplicate.

comment:4 Changed 13 years ago by Ryan J Ollos

Description: modified (diff)
Owner: changed from Noah Kantrowitz to Ryan J Ollos
Status: newassigned
Note: See TracTickets for help on using tickets.