Porting Scribbish to Radiant: Version 0.1  

Monday, September 08 2008

I had been meaning to create a port of Scribbish to Radiant as a theme for my blog. As you can seen I’m using now. It was Sean Cribb’s post on the Radiant Dev mailing list that finally galvanized me into doing it. The Scribbish theme has some really well put together HTML/CSS/Javascript and I was able to make the port in one evening. You can download it here. It also supports the code formatting javascript that is available on the Mephisto version of Scribbish.

Here’s some sample ruby code:


  def to_xml(options = {})
    options[:indent] ||= 2
    xml = options[:builder] ||= Builder::XmlMarkup.new(:indent => options[:indent])
    xml.instruct! unless options[:skip_instruct]
    xml.tag!("form-response", :id => id) do
      xml.tag!("created-at", created_at.strftime("%Y-%m-%d %H:%M")) if options[:show_timestamps]
      content.each do |name, value|
        if(!options[:fields].nil? && options[:fields].include?(name))
          xml.tag!(name.dasherize, value)
        end
      end
    end
  end

To use this theme you will need the import export extension and the settings extension. I neglected to include a README, but I will soon. For now you can install it as follows:

  1. Create your Radiant installation. Bootstrap the database and make sure to choose the option “Empty” for content when going through the prompts.
  2. Install the import_export extension
  3. From your radiant installations directory run:
    rake db:import THEME=/path/to/scribbish.yml
    
  4. Copy /images/scribbish into /public/images
  5. Copy /stylesheets/scribbish into /public/stylesheets
  6. Copy /javascripts/site into /public/site

And you’re done! When I was creating it, I was having an issue with getting the tag to display correctly and in the effort of a swift release I simply hard coded my name in there. It’s simple to override:

  1. From the admin interface, edit the “article” and “article-extended” snippet.

The rest of the usage is pretty straight forward when you check out the sample post. I will be beefing up some of the importation documentation for v0.2 and also checking out the Radiant template extension for possible integration. You can find a vanilla demo of Radiant 0.6.9 with Scribbish on the Level G Labs demo site. Happy Theming!


  • Posted by Charlie Robbins