librelist archives

« back to archive

Add a snippet

Add a snippet

From:
Stephane Wirtel
Date:
2010-05-25 @ 07:09
Hi all,

I want to add a snippet in the "Template Tricks" section, but the rendered
result does not contain the block of python code and the html+jinja code.

--------------------------------------------------
#!python

import markdown
from flask import Markup

#!html+jinja

{{ message }}
--------------------------------------------------

What's my error ?

Thanks

Regards,
Stéphane

Re: [flask] Add a snippet

From:
Peter Ward
Date:
2010-05-25 @ 07:30
Try this:
{{{
#!python

print "Hello World!"
}}}

{{{
#!html+jinja

{{ message }}
}}}

Regards,
  Peter

On Tue, May 25, 2010 at 5:09 PM, Stephane Wirtel <stephane@wirtel.be> wrote:

> Hi all,
>
> I want to add a snippet in the "Template Tricks" section, but the rendered
> result does not contain the block of python code and the html+jinja code.
>
> --------------------------------------------------
> #!python
>
> import markdown
> from flask import Markup
>
> #!html+jinja
>
> {{ message }}
> --------------------------------------------------
>
> What's my error ?
>
> Thanks
>
> Regards,
> Stéphane
>
>


-- 
Peter Ward
http://flowblok.id.au/
Bachelor of Computer Science and Technology II
University of Sydney

Re: [flask] Add a snippet

From:
Stephane Wirtel
Date:
2010-05-25 @ 07:51
Thanks :-)
On 05/25/2010 09:30 AM, Peter Ward wrote:
> Try this:
> {{{
> #!python
> 
> print "Hello World!"
> }}}
> 
> {{{
> #!html+jinja
> 
> {{ message }}
> }}}
> 
> Regards,
>   Peter
> 
> On Tue, May 25, 2010 at 5:09 PM, Stephane Wirtel <stephane@wirtel.be> wrote:
> 
>> Hi all,
>>
>> I want to add a snippet in the "Template Tricks" section, but the rendered
>> result does not contain the block of python code and the html+jinja code.
>>
>> --------------------------------------------------
>> #!python
>>
>> import markdown
>> from flask import Markup
>>
>> #!html+jinja
>>
>> {{ message }}
>> --------------------------------------------------
>>
>> What's my error ?
>>
>> Thanks
>>
>> Regards,
>> Stéphane
>>
>>
> 
> 

Re: [flask] Add a snippet

From:
Stephane Wirtel
Date:
2010-05-25 @ 08:08
Thank you for your help.
The new snippet: http://flask.pocoo.org/snippets/19/

Regards,

Stéphane

On 05/25/2010 09:51 AM, Stephane Wirtel wrote:
> Thanks :-)
> On 05/25/2010 09:30 AM, Peter Ward wrote:
>> Try this:
>> {{{
>> #!python
>>
>> print "Hello World!"
>> }}}
>>
>> {{{
>> #!html+jinja
>>
>> {{ message }}
>> }}}
>>
>> Regards,
>>   Peter
>>
>> On Tue, May 25, 2010 at 5:09 PM, Stephane Wirtel <stephane@wirtel.be> wrote:
>>
>>> Hi all,
>>>
>>> I want to add a snippet in the "Template Tricks" section, but the rendered
>>> result does not contain the block of python code and the html+jinja code.
>>>
>>> --------------------------------------------------
>>> #!python
>>>
>>> import markdown
>>> from flask import Markup
>>>
>>> #!html+jinja
>>>
>>> {{ message }}
>>> --------------------------------------------------
>>>
>>> What's my error ?
>>>
>>> Thanks
>>>
>>> Regards,
>>> Stéphane
>>>
>>>
>>
>>
>