Preview mode in WikiProcessor

7 views
Skip to first unread message

Dirk Stöcker

unread,
Jan 18, 2013, 3:57:51 AM1/18/13
to trac...@googlegroups.com
Hello,

I try to detect in expand_macro() of a wiki processor if I'm in preview
state or in final state. Is this possible. If yes, how?

Didn't succeed with Google search or a look at the trac sources.

Ciao
--
http://www.dstoecker.eu/ (PGP key available)

RjOllos

unread,
Jan 20, 2013, 12:12:51 AM1/20/13
to trac...@googlegroups.com
On Friday, January 18, 2013 12:57:51 AM UTC-8, Dirk Stöcker wrote:
Hello,

I try to detect in expand_macro() of a wiki processor if I'm in preview
state or in final state. Is this possible. If yes, how?

Hi, Will this do what you are trying to accomplish?:

'preview' in formatter.req.args and formatter.req.args.get('preview') == 'Preview Page' 

It will evaluate to True when the user has explicitly pressed the "Preview page" button.

Dirk Stöcker

unread,
Jan 20, 2013, 4:28:51 AM1/20/13
to trac...@googlegroups.com
On Sat, 19 Jan 2013, RjOllos wrote:

> Hi, Will this do what you are trying to accomplish?:
>
> 'preview' in formatter.req.args and formatter.req.args.get('preview') == 'Preview Page'�
>
> It will evaluate to True when the user has explicitly pressed the "Preview page" button.

Yes, thanks. Exactly what I wanted.
Reply all
Reply to author
Forward
0 new messages