Skip to content

vadimgu/restedblogger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 

Repository files navigation

RestedBlogger

RestedBlogger is a command line application that can publish a reStructuredText to Blogger. It will also upload images that are included in your document.

To install from sources

$ git clone git://github.com/vadimgu/restedblogger
$ cd restedblogger
$ python setup.py install
  • Create or Update a post
  • Publish a post.
  • Preview a post.
  • Automatically upload images in a post to Picasa Web
  • Set the labels.

First you have to make a folder where you will be editing your posts.

$ mkdir myblog
$ cd myblog
$ reb init

The init command will ask you your google email, your password and will also ask you to choose a blog, if you have more then one. Then, that information is saved in reb.conf file. The password IS NOT stored and will be prompted on each interaction with the Blogger site.

The next step, is to write a blog post by editing a text file myPost.rst

My ReStructuredText Post
========================

Text is power. I'm using this image to prove it:

.. image:: proof.jpg

You can preview the post with the reb view command

$ reb view myPost.rst

This will open the default browser with the generated html. It will NOT post to Blogger.

RestedBlogger can fetch your last post and make it into a template for preview

$ reb template

Once you're satisfied with the results you can send the piece

$ reb draft myPost.rst

This will create a new post in draft mode or update an existing one. It can be executed many times.

Attention!

The posts are identified by their titles. If the title of a post is changed it will be considered as a new post.

To publish the post:

$ reb publish myPost.rst

This will create or update the post and set off the draft mode. Setting the draft mode back to on is not implemented.

All the features of reStructuredText an more...

Highlight source code using Pygments

.. sourcecode:: python

  def count(start=0):
    yield start
    while 1:
      start += 1
      yield start

The css styles are inlined.

You can reference Wikipedia articles like this:

I played a game of :wkp:`chess` yesterday.

To include plots in a post you must install gnuplot and make it available on your PATH.

.. gnuplot:: sincos.png

  set yrange [-2:2]
  plot sin(x), cos(x)

This will write the plot to sincos.png file and include it in the post.

To set the post labels use the meta directive:

.. meta::
  :keywords: Text, Power

Note

The meta directive is a standard reStructuredText directive.

You can write your own plugins. Plugins are python modules extending the reStructuredText functionality. To enable a plugin put it into ~/.restedblogger/plugins/. There is an example in the sources plugins/lilypond-directive.py. It allows to write music using Lilypond.

$ mkdir -p ~/.restedblogger/plugins
$ cp restedblogger/plugins/lilypond_directive.py ~/.restedblogger/plugins

This will enable the lilypond directive. The dependencies for plugins are not managed and any additional package used by a plugin must be installed manually.

About

Edit blogger.com posts in reStructuredText

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages