patch to extract license data
Nathan Kinkade
nkinkade at creativecommons.org
Sun Nov 11 07:38:31 EST 2007
2007/11/10, Sam Ruby <rubys at intertwingly.net>:
> Asheesh Laroia wrote:
> > On Wed, 7 Nov 2007, Nathan Kinkade wrote:
> >
> >> I've put together a small patch that will extract license data from
> >> feeds and then make that data available to the templates.
> >
> > Hey, planet folks - any comments on this patch? It's been a few days
> > with no response, so I figured I'd reping the list on N. Kinkade's behalf.
> >
> > It's pretty simple; I'm attaching it in case that's a preferred format.
> > Do let us at CC know if it needs some changes or improvement.
> >
> > It takes advantage of feedparser's license extraction from feeds and
> > lets you display that data in the template.
>
> I'm not sure why I never saw the original post, but I do have a few
> comments:
>
> Per contributing[1], I would like to see some documentation, and a test.
> That could be as simple as a single file in tests/data/filter/tmpl
> [2], and a table row in docs/templates.html [3].
>
> I'd gladly include a new theme that shows off cc, but I would rather the
> classic fancy theme itself be left unchanged.
>
> Finally, I'd rather that the fetching and styling of the license
> information be moved into a plugin, and not placed inside the venus code
> itself. Ideally, the fetching would cache the results, but if it is in
> an optional plugin, I'm not overly concerned. You can look at
> mememe.plugin[4] for examples on how to do all this.
>
> - Sam Ruby
>
> [1] http://intertwingly.net/code/venus/docs/contributing.html
> [2] http://intertwingly.net/code/venus/tests/data/filter/tmpl/
> [3] http://intertwingly.net/code/venus/docs/templates.html
> [4] http://intertwingly.net/code/venus/filters/mememe.plugin
I don't think the original email ever made it to the list. It was
(is?) stuck waiting for moderator approval, at least that's what an
email I received told me, but I'm subscribed to the list now.
I'll be happy to move the changes into a plugin, and I'll take a look
at the mememe.plugin example you gave.
Sorry about the lack of documentation. Submitting these changes back
to Venus was an after-thought (given to me by Asheesh), so I hadn't
given much thought to formal documentation, outside of comments inline
with my changes.
As far as changes to the templates and/or showcasing a special CC
template, I believe our custom template is most likely way too CC
specific to be of much use to anyone else.
http://planet.creativecommons.org, rather mimics the main
http://creativecommons.org site. But maybe I'm wrong about the
utility of that theme. I only made the change to classic_fancy theme
as a simple demonstration of how to insert the license data, which is
really nothing more than putting <TMPL_VAR license> wherever one
wants, provided it's inside of the an "Items" loop. I had initially
been putting the license data in the "Channels" list as well, but
later took it out, deeming it unnecessary.
Let me take a look at moving the small amount of code out of Venus and
into a plugin, caching CC license name lookups to a local file, and
also putting together a little more documentation.
Thanks,
Nathan
More information about the devel
mailing list