Re: Hello World plug-in
will <[email protected]>
| Newsgroups | gmane.comp.web.pyblosxom.user |
|---|---|
| Message-ID | <[email protected]> |
On Tue, 25 Feb 2003, Lee Joramo wrote: > > I am looking for a well documented "Hello World" plug in for pyblosxom. > Over the weekend, I tried to modify several of the current plug-ins > without success. So how would you create a plug in that would replace > $HelloWorld in a flavor file with the phrase "Hello, World". > > For extra credit, how would you get it to return your name "Hello, YOU > NAME". The pycalendar.py, pyarchives.py and pycategories.py plugins all do this so I'm puzzled as to what you find so confusing. Basically a PyBlosxom plugin is a Python module with a function "initialize" which takes no arguments. When the plugin is placed in the libs/plugins directory, it will get imported and the initialize function will be called. The plugin then can register itself with various callbacks in the api module. The functions that you register with those callbacks do all the work. I have no clue what version of PyBlosxom you're using, nor do I recall what the api looked like in the last version. However, I wrote this code in January and that was prior to PyBlosxom 0.6 release, so this code should/might work: http://www.bluesock.org/~willg/cgi-bin/pyblosxom.cgi/dev/pyblosxom/api.html Hope that helps. Documentation will come when things stabalize in the code-base. /will -- whatever it is, you can find it at http://www.bluesock.org/~willg/ except Will--you can only see him in real life. ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf