Sha256: 13b3b776482dd51dfd2beb69be44aa4c4fcd69bdf47787d1d32474b207102340

Contents?: true

Size: 1.73 KB

Versions: 3

Compression:

Stored size: 1.73 KB

Contents

# Sinatra Maruku Extension for Sinatra v0.9.4

The *sinatra-maruku* extension provides `maruku` helper method
for rendering Maruku templates.

To install it, run: 

    sudo gem install -v0.9.4.0 sinatra-maruku

To test it, create a simple Sinatra application:

    # app.rb
    require 'rubygems'
    require 'sinatra'
      
    require 'sinatra/maruku'
    
    get "/" do
      maruku "# Hello Maruku"
    end

and run it with:

    ruby app.rb

The result could be seen at *http://localhost:4567*.

Another example could be find in the *examples* directory. 
Run it with:

    rackup -p 4567 config.ru

and visit *http://localhost:4567* to contemplate the sheer 
beauty of rendered text written in Maruku notation.


## Two links to Maruku related material

* [Maruku features](http://maruku.rubyforge.org/maruku.html)
* [Literate Maruku](http://www.slideshare.net/schmidt/literate-maruku)


## Template Languages (*update to The Sinatra Book*) 

### Maruku Templates

This helper method:

    get '/' do
      maruku :index
    end

renders template *./views/index.maruku*.

If a layout named *layout.maruku* exists, it will be used each time
a template is rendered.

You can disable layouts by passing `:layout => false` 
to *maruku* helper. For example

    get '/' do
      maruku :index, :layout => false
    end

You can set a different layout from the default one with:

    get '/' do
      maruku :index, :layout => :application
    end

This renders *./views/index.maruku* template
within *./views/application.maruku* layout.


## Sample layout for Maruku templates

    CSS: /stylesheets/application.css /stylesheets/print.css
    Lang: pl
    Title: Hello Maruku 
    LaTeX preamble: preamble.tex
    
    # Hello Maruku  {.header}
    
    <%= yield %>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sinatra-maruku-1.0.0.2 README.markdown
sinatra-maruku-0.9.4.1 README.markdown
sinatra-maruku-0.9.4.0 README.markdown