Project

smooth

0.0
No commit activity in last 3 years
No release in over 3 years
Smooth provides a simple DSL building powerful JSON APIs on top of ActiveRecord.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Smooth

Smooth is a library, wrapped around the amazing haml-sass parser, to generate sexy html-slides from a haml file.

(README and documentation under heavy development)

Abstract

1. Create a template.haml in your working directory for your slides:

- layout :default

  - about do
    -title    "My first Slides"
    -subtitle "Generated with Smooth"
    -author   "Your Name"

  - slides do
    -title
    -slide "Title of the first Slide" do
      %p This is something I wan't to say here
    -section "Syntax highlighting", :desc => "Follows on the next slide"
    -slide "Syntax highlighting" do
      %p we use the blackboard TextMate theme here
      ~ code :ruby, :blackboard  do
        :plain
          class Slides
            def present
              "I present my slides, now!"
            end
          end

2. Call smooth build in the same directory

3. Watch the result of the File above

The helpers

Basically, it provides a bunch of useful and slide-related helpers and enhancements to haml.

Components mechanism

Smooth implements a component-helper, that generates dynamic methods in your template.

Example template: .my-template = header "my title", :subtitle => "something special" do %p content of the header

If the method header is not found in the render context, the component_resolver searches in configurable directories for component files. If such file is found ([gemdir]/share/components/header.haml or [your_project]/components/header.haml in this specific case) it is rendered.

The first argument is passed as an local variable called title, the block is accessible through yield.

The optional arguments hash creates variables identifyed by the key and set to the value. (Since these arguments are optional, they should only be used after checking their definition)

So, the header-component could look like this: .header %h1= title %h2= subtitle if defined? subtitle

  .content= yield

Note: Components are nestable.

Assets mechanism

Helpers

How to use it?

Installation

  • Not a gem yet, so only direct usage of the repo possible
  • for executing bundle, this lib is required: apt-get install libonig-dev
  • then type bundle
  • you can use bin/smooth with relative path in your slide dir:
    • cd ../my_slides
    • ../smooth/bin/smiith build