Re: pybloxsom

Wari Wahab <[email protected]>
Newsgroups gmane.comp.web.pyblosxom.user
Message-ID <[email protected]>
Joseph Reagle wrote:
> Hello, I was glad to see "Support for different types of caching system" as 

Caching is documented in the config.py, and the available cache 
mechanism (only two of them for now) are available in libs/cache/ 
directory. You enable the cache by commenting out certain lines in 
config.py (find cache)

> I like to edit valid html files. However, how do I enable this feature, 
> don't see it in config.py ? (I'd like to use valid html, then have 
> pybloxsom strip the html/head elements and replace them for that 
> "category")

This requires an entryparser plugin that handles *.html files. Quite 
easy to do actually. I don't have much time now, but if you know how to 
program in python, here's the psuedocode of such plugin (please note 
what I give you here will not work, just what you can do):

-htmlentryparser.py--------------------------------
FILE_EXT = 'html'
"""
Files with a .html extension will be an entry.
"""
__version__ = '$Id:$'
__author__ = 'someone'

def cb_entryparser(args):
     args[FILE_EXT] = readfile
     return args

def readfile(filename, request):
     entryData = {}
     d = file(filename).read()
     title = lookForTitle(d)
     # You can also look for other metadata (META tags?)
     body = html[html.find('<body>') + 6:html.find('</body>')]
     # Something like the above can be extracted with sgmlparser as well.
     entryData = {'title': title,
                  'body': body}
     # Call the postformat callbacks
     tools.run_callback('postformat',
             {'request': request,
              'entry_data': entryData})

     return entryData
-----------------------------------

If you're not sure what to do, maybe someone can voluteer on doing this 
plugin.

-- 
Regards: Wari Wahab
RoughingIT - http://roughingit.subtlehints.net
PyBlosxom  - http://roughingit.subtlehints.net/pyblosxom



-------------------------------------------------------
This SF.net email is sponsored by: ObjectStore.
If flattening out C++ or Java code to make your application fit in a
relational database is painful, don't do it! Check out ObjectStore.
Now part of Progress Software. http://www.objectstore.net/sourceforge
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.