Blogger Backend for AsciiDoc

Tue Sep 11, 2012

The AsciiDoc backend plugin for Google’s Blogger blog hosting service is hosted on Github, it generates Blogger friendly HTML markup from AsciiDoc source.

The backend consists of a single blogger.conf configuration file.

To install the Blogger plugin download blogger.zip and install it with asciidoc (you will need AsciiDoc version 8.6.6 or newer):

asciidoc --backend install blogger.zip

HTML generated by the blogger backend can be pasted directly into your Blogger post’s HTML edit box:

  1. Login and create a new post or edit an existing one.
  2. Select the HTML edit option.
  3. Convert your post’s AsciiDoc source to Blogger friendly HTML. For example, this command converts the article.txt source file to article.html:

    asciidoc -b blogger -a iconsdir=./icons article.txt
    
  4. Open the generated HTML file in a text editor then select and copy all the text (typically with Ctrl+A then Ctrl+C).

  5. Paste the copied text into the Blogger edit window in the browser:

NOTE: Specifying the location of the admonition icons by setting the iconsdir attribute has been rendered unnecessary by a commit made on 11-September-2012.

asciidoc-blogger-backend-1.png

Here’s a partial screenshot of the post (you can view the example post here):

asciidoc-blogger-backend-2.png

NOTE:

  • By default linked images and admonition icons will be embedded in the generated HTML using the data URI scheme (AsciiDoc data-uri and icons attributes are set in the plugin’s blogger.conf file).
  • Older browsers (notably IE8) limit the size of data URIs.
  • You will need AsciiDoc version 8.6.6 or newer to use the Blogger backend.
  • Defining the backend atom attribute will envelope the post in an Atom <entry> element for the Blogger 2.0 API‚ÄČ–‚ÄČthis feature is experimental and I never got round to trying it. See also Post on Blogger using curl.


  « Previous: Next: »