<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:html="http://www.w3.org/1999/html" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>Random notes from mg</title><link>http://mg.pov.lt/blog</link><description>a blog by Marius Gedminas</description><language>en</language><ttl>60</ttl><dc:creator>Marius Gedminas</dc:creator><admin:generatorAgent rdf:resource="http://pyblosxom.sourceforge.net/"/><admin:errorReportsTo rdf:resource="mailto:marius@gedmin.as"/><item><title>Enabling comments in PyBlosxom</title><guid isPermaLink="false">blog-comments</guid><link>http://mg.pov.lt/blog/blog-comments</link><description>I've just spent the whole night setting up blog comments. PyBlosxom doesn't make it painless, sadly, more like the opposite. ...</description><content:encoded><![CDATA[
<p>I've just spent the whole night setting up blog comments.  PyBlosxom doesn't
make it painless, sadly, more like the opposite.</p>

<p>First: don't be scared by the list of comment-related plugins on the
PyBlosxom site.  There's only one important plugin: comments.  All others
depend on it and enhance its functionality. The last three or four times I was
about to add comments to my blog I got scared at step one: evaluate the
available plugins.  Don't repeat my mistake!</p>

<p>Second, follow the instructions carefully.  There's no shortcut.</p>

<p>Third, fix what's broken.  Be prepared to debug the source code.  <tt>print
  &gt;&gt; sys.stderr, "message"</tt> is your friend.</p>

<p>Fourth, fiddle with the look (CSS and HTML).</p>

<p>Fifth, write a blog post and eagerly await your first comments.</p>

<p>Step 3 screams for an explanation, doesn't it?  Problem 1: the comments
plugin requires that you use categories in your blog.  I'm not (I'm holding out
for tags).  Workaround: comment out <tt>if entry['absolute_path']</tt> check in
cb_story and cb_story_end.</p>

<p>Problem 2: the AJAX post returns "Empty response from server".  Workaround:
modify cb_story_end to call readComments directly if <tt>entry['num_comments']
  is
  None</tt>, since cb_story, which usually does the read, is not called during
the AJAX post.</p>

<p>Problem 3: if you enable comment moderation (by setting comment_draft_ext to
a different value from comment_ext), the AJAX post returns "Empty response from
server" once more.  Workaround: modify cb_prepare to notice this case and set
<tt>data['moderated'] = True</tt>, create a new template comment-moderated and
render it in cb_story_end just like the preview template is rendered; also modify
__shouldOutput to return True when rendering comment-moderated.</p>

<p>I'll post patches to the pyblosxom mailing tomorrow, unless I forget.  It's
6 am already, and I'm kind of sleepy.  I just hope I haven't inadvertently
broken my RSS feed or flooded any planets.</p>

<p>Oh, and a helpful hint: don't name the post you're writing
<tt>comments.txt</tt>, or the #comments anchor will point to the start of the
story instead of the comments.</p>
]]></content:encoded><category domain="http://mg.pov.lt">/home/mg/blog/data</category><dc:date>2009-05-16T03:13:33Z</dc:date></item><item><title>Baking CSS into RSS</title><guid isPermaLink="false">baking-css-into-rss</guid><link>http://mg.pov.lt/blog/baking-css-into-rss</link><description>Wanted: PyBlosxom plugin to bake CSS styles into the RSS feed, i.e. replace things like &lt;span style=&quot;keyword&quot;&gt; in the main ...</description><content:encoded><![CDATA[
<p>Wanted: PyBlosxom plugin to bake CSS styles into the RSS feed, i.e.
replace things like &lt;span style="keyword"&gt; in the main blog pages with
things like &lt;span style="color: #ff7700"&gt; in the RSS.</p>

<p>Also wanted: a spam-resistant comments plugin.  (Maybe some/all of them are?
I was always afraid to try.)   And a tags plugin (categories are too limiting).
And useful page titles.  And a pony.</p>

<p><strong>Update:</strong> Laurence Rowe and Alexander Artemenko suggested I
check out <a href="http://code.google.com/p/cssutils/">cssutils</a>.  Alexander
also pointed out that <a
  href="http://stackoverflow.com/questions/118685/how-can-i-apply-my-css-stylesheet-to-an-rss-feed">a
  similar question was asked on stackoverflow</a>.  <!-- Sadly, most of the answers
there are variations "you shouldn't do that you impurely-thinking person", with
some exceptions that allow as to how this may sometimes be a valid need, but
don't point to any tools achieving that.-->  Peter Bengtsson recently posted <a
  href="http://www.peterbe.com/plog/premailer.py">a similar tool</a> built with
lxml and regexps.  Meanwhile, I took the plunge and installed a comments
plugin, and even somehow managed not to get drowned in spam.</p>
]]></content:encoded><category domain="http://mg.pov.lt">/home/mg/blog/data</category><dc:date>2009-04-03T06:37:40Z</dc:date></item><item><title>More on PyBlosxom</title><guid isPermaLink="false">pyblosxom-setup</guid><link>http://mg.pov.lt/blog/pyblosxom-setup</link><description>I want to store my blog in Subversion. Problem: Subversion does not preserve mtimes of files . Solution: a plugin ...</description><content:encoded><![CDATA[
<p>I want to store my blog in Subversion.  Problem: <a
href="http://subversion.tigris.org/issues/show_bug.cgi?id=1256">Subversion does
not preserve mtimes of files</a>.  Solution: a plugin like <a
href="http://pyblosxom.sourceforge.net/blog/registry/files/pyfilenamemtime">pyfilenamemtime</a>,
but different (I do not want to rename existing blog entries).  Since I want to
import my existing blog entries without renaming them, I wrote a <a
href="http://mg.pov.lt/timestamps.py">plugin that reads timestamps from a
separate text file</a>.  This should suffice, in addition to adding</p>
<pre>
[miscellany]
### Set use-commit-times to make checkout/update/switch/revert
### put last-committed timestamps on every file touched.
use-commit-times = yes
</pre>
<p>to <tt>~/.subversion/config</tt>.</p>

<p>Now I want to have an RSS or Atom feed that <a
href="http://feedvalidator.org/">validates</a>.  Answer: <a
href="http://pyblosxom.sourceforge.net/blog/registry/syndication/rss2renderer">rss2renderer</a>.</p>

<p>I'd like to have browsable archives for entries that do not fit on the front
page (and then make the front page contain fewer entries).  There are plugins
in the <a
href="http://pyblosxom.sourceforge.net/blog/registry?sortby=path">PyBlosxom
plugin registry</a> that look promising: pyarchives, wbgpager.</p>

<p>More wishes: I want to be able to post blog entries with images.  I'd like
to be able to be able to add new blog entries with gnome-blogger and via a web
form.  And I want to have drafts that I can look at until I become satisfied
and publish.  </p>

<p>Stay tuned, if I figure out how to accomplish what I want, I'll blog about
it.</p>
]]></content:encoded><category domain="http://mg.pov.lt">/home/mg/blog/data</category><dc:date>2005-01-16T19:38:25Z</dc:date></item><item><title>Pyblosxom badness</title><guid isPermaLink="false">pyblosxom-badness</guid><link>http://mg.pov.lt/blog/pyblosxom-badness</link><description>I've just discovered that Pyblosxom's default (i.e. builtin) RSS template does not include dates nor IDs. I'm disappointed. This kind ...</description><content:encoded><![CDATA[
<p>I've just discovered that Pyblosxom's default (i.e. builtin) RSS template
does not include dates nor IDs.  I'm disappointed.  This kind of breaks
the whole "usable out of the box" feeling.</p>

<p>Google to the rescue: after a brief look at <a
href="http://www.lychnis.net/blosxom/debian/blosxom-pubDate.lychnis">Blosxom
and RSS</a> and <a href="http://fooishbar.org/~daniel/pyblosxom-rss/">Daniel's
pyblosxom RSS templates</a> I've borrowed Daniel's <a
href="http://fooishbar.org/~daniel/pyblosxom-rss/story.rss">story.rss</a>
with a different timezone substituted.  Doesn't pyblosxom have a variable
that would expand into the server's time zone?  What about daylight savings
time -- do I have to edit story.rss twice a year, or what?</p>

<p>I'm disappointed.</p>
]]></content:encoded><category domain="http://mg.pov.lt">/home/mg/blog/data</category><dc:date>2004-09-29T22:29:24Z</dc:date></item></channel></rss>
