Saturday, October 3, 2009

User Guide

If you can get a hold of this project, this is how you use it. It is not polished in every aspect quite yet, but it is indeed usable.

Installation

sudo apt-get install \
    mercurial \
    python \
    python-gdata \
    markdown

hg clone <source> blog
ln -s `pwd`/blog/blog.py <dir-in-path>/blog

Adding a blog to a project

cd <path-of-project>
blog init

Adding a blog-post

From anywhere inside the project:

EDITOR=<editor> blog add

Publishing to blogger.com

First, create a new blog via the web interface at blogger.com. Go to "Settings", "Formatting" and set "Convert line breaks" to "No".

Then execute

blog publish

You will be asked for all required details, including your Google-password. The details will be remembered, except for the password. Instead, a login will be performed and the login-token will be kept.

User-specific details will be written to ~/.blog.user, while project-specific details go to .blog in the project directory. You will want to add this last file to source control.

4 comments:

  1. File "/home/layer/src/import/blog/blogger/update.py", line 12, in generate_automatic_links
    links += "[%02i]: %s\n" % (i, entry.GetAlternateLink().href)
    AttributeError: 'NoneType' object has no attribute 'href'

    On Fedora, without apt-get, but I was able to install everything with yum. Though, markdown was from python-markdown. "blog add" works OK, too.

    ReplyDelete
  2. I forgot to say the above was on a "blog publish".

    ReplyDelete
  3. The reason I prefer perl-md to python-md is for nesting links and code. This snippet of Markdown will produce two different outputs:

    [Link `code`](http://example.com)

    Through perl-md (this is the desired result):

    <p><a href="http://example.com">Link <code>code</code></a></p>

    Through python-md:

    <p>[Link <code>code</code>](http://example.com)\n</p>

    ----

    For the exception you experience: Which versions of Python and python-gdata do you use? I have Python 2.6.2 and python-gdata 1.2.4.

    ReplyDelete
  4. @e40: I see you have a rather well-established blog. Unfortunately bftrou can not yet give you a way to continue this blog. I see three options:

    * You can start a new bftrou-blog
    * Implement a feature to ignore the first n blog posts, such that everything you blog from now on will be in bftrou, without touching the old stuff
    * Implement a feature to scrape the blogger.com-blog and put it in files for bftrou to handle

    Hope you can find this tool useful even without these features :)

    ReplyDelete