RE: image plugin
"Blake Winton" <blake-dlUKtbW3TlBcVw/[email protected]>
| Newsgroups | gmane.comp.web.pyblosxom.user |
|---|---|
| Message-ID | <[email protected]> |
> I'm tossing around writing an image plugin. I want it to do
> the following
> things:
>
> # image_name::directory::image_file
> s4_no_headlights::photos2/events/2003/s4::no_headlights.jpg>
> And then I would reference it in my blog like this:
> $image('image_name')
>
> Then I'd have in the config file an entry for the image template:
> py['image_template'] = '<a href="$directory/$file"><img' +
> 'src="$directory/$file"></a>'
>
> I could make it looser in that you could specify which
> columns hold what information. So then the template could be
> something like this:
> py['image_template'] = '<a href="$1/$2"><img src="$1/$2"></a>'
> Any thoughts on this? Anyone else have an image plugin or ideas for a
> better design?
My first thought is that it looks very similar to the Acronym plugin,
and the Userland glossary feature. Perhaps the functionality could
be bundled into one plugin.
My second thought is that naming things is a little nicer than
numbering them, for readability as well as maintainability. Could
you give names to the columns as the first line of any given file?
--image.glossary--
name::dir::thumb::file
image_one::photos2/events/2003/s4::small.jpg::no_headlights.jpg
--/image.glossary--
--acronym.glossary--
abbr::expansion::url
html::HyperText Markup Language::http://www.w3c.org/MarkUp/
--/acronym.glossary--
--config--
py['image_template'] = '<a href="$dir/$file"><img src="$dir/$thumb"></a>'
py['acronym_template'] = '<a href="$url"><abbr
desc="$expansion">$abbr</abbr></a>'
--/config--
--blog--
This is my blog with an $image(image_one) and an $acronym(html).
--/blog--
The first column is always the key, and whatever else you want to throw
in goes after that. (If you leave it as names, then people can re-order
the columns, or insert columns anywhere they want, and only have to
update the first line of the file...)
Later,
Blake.
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click