Re: preformatters and entry parsers

"Wai Yip Tung" <tungwaiyip-/[email protected]>
Newsgroups gmane.comp.web.pyblosxom.user
Message-ID <[email protected]>
An off topic comment.

I think RFC2822 (email) format would be great as a base entry format. It  
can include abitrary meta data as headers. I use it to keep the date  
attribute. It support values span multiple lines like the summary  
attribute you have. And it has Python support with the email.Message  
module. And it is no more difficult to type as the current simple text  
format.

Just my 2 cents.

Wai Yip Tung

On Fri, 20 Aug 2004 23:06:02 -0700, David Ascher <[email protected]>  
wrote:

> 1. It looks to me like only the default txt (plain) entry parser calls
> the cb_preformat and cb_postformat callbacks.  Shouldn't all entry
> parsers call them?
>
> 2. Also, I'm once again stumbling on an 'order of data collection'
> problem.  Here's the scenario.
>
> I was thinking that I could implement a version of the 'extended
> entry' concept by supporting the following markup:
>
>>>>>
> Title of the entry
>
> Summary:
>    This is the summary of the entry that shows
>    up in the index
>
> This is the body of the entry, in other words the 'extended' entry.
>>>>>
>
> Something like this _would_ have worked:
>
> def cb_preformat(args):
>     lines = args['story']
>     entry = []
>     summary = []
>     target = entry
>     for line in lines:
>         if line.startswith("Summary:"):
>             target = summary
>             continue
>         if not line.startswith(' ') and target == summary:
>             target = entry
>             continue
>         target.append(line)
>     request = args["request"]
>     config = request.getConfiguration()
>     renderer = args['renderer']
>     if len(renderer.getContent()) == 1:
>         return ''.join(entry)
>     else:
>         return ''.join(summary)
>
>
> except that args['renderer'] (which I saw the comments plugin using to
> figure out whether a single entry was being shown or not) isn't
> available at the time that cb_preformat is called.
>
> I want this concept to work with all entry parsers, hence my idea of
> putting it in the preformat as a 'filter'.
>
> Are there other ways of finding out if we're looking at a single entry
> or an index?
>
> --david
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
> 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
> Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
> http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
> _______________________________________________
> pyblosxom-users mailing list
> pyblosxom-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/pyblosxom-users



-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.