Good, I read trac.mimeview.api source and found that I can make child
context something like that:
def wiki_output(self, parentcontext, pagename, content):
out = StringIO()
Formatter(self.env, parentcontext('wiki',
pagename)).format(content, out)
return Markup(out.getvalue())
Use in expand_macro: self.wiki_output(formatter.context, pagename,
pagecontent)
Can anyone say it is valid solution or not ?
On 28 мар, 12:02, En_t_end <[email protected]> wrote:
> Ok, if I understand you, need to do so:
>
> def wiki_output(self, pagename, content):
> out = StringIO()
> # Wait, I don't know how make a new formatter by page name :)
> return Markup(out.getvalue())
>
> How make a new formatter if I know page name only ? I know it's
> simple, but it's undocumented. Thanks
>
> On 28 ÍÁÒ, 03:00, Noah Kantrowitz <[email protected]> wrote:
>
> > You have to make a new formatter, not use the one passed to you (since š
> > that one has a context scoped to the original page). You could try š
> > just replacing formatter.context and then putting it back after your š
> > render call.
>
> > --Noah
--
You received this message because you are subscribed to the Google Groups "Trac
Development" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/trac-dev?hl=en.