Sha256: dd3bf3a99a3ea4c46ce3f37dc05542449e6c257e43363a7ee3c68276c3189133

Contents?: true

Size: 1.76 KB

Versions: 49

Compression:

Stored size: 1.76 KB

Contents

# Sinatra Maruku Extension

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

To install it, run: 

    sudo gem install wbzyl-sinatra-maruku -s http://gems.github.com

To test it, create a simple Sinatra application:

    # app.rb
    require 'rubygems'
    require 'sinatra'
      
    gem 'wbzyl-sinatra-maruku'
    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

49 entries across 49 versions & 3 rubygems

Version Path
tdreyno-middleman-0.2.4 vendor/sinatra-maruku/README.markdown
tdreyno-middleman-0.2.5 vendor/sinatra-maruku/README.markdown
tdreyno-middleman-0.2.6 vendor/sinatra-maruku/README.markdown
tdreyno-middleman-0.2.7 vendor/sinatra-maruku/README.markdown
tdreyno-middleman-0.2.8 vendor/sinatra-maruku/README.markdown
tdreyno-middleman-0.2.9 vendor/sinatra-maruku/README.markdown
tdreyno-middleman-0.3.0 vendor/sinatra-maruku/README.markdown
tdreyno-middleman-0.3.1 vendor/sinatra-maruku/README.markdown
tdreyno-middleman-0.3.10 vendor/sinatra-maruku/README.markdown
tdreyno-middleman-0.3.2 vendor/sinatra-maruku/README.markdown
tdreyno-middleman-0.3.3 vendor/sinatra-maruku/README.markdown
tdreyno-middleman-0.3.4 vendor/sinatra-maruku/README.markdown
tdreyno-middleman-0.3.7 vendor/sinatra-maruku/README.markdown
tdreyno-middleman-0.3.8 vendor/sinatra-maruku/README.markdown
tdreyno-middleman-0.4.1 vendor/sinatra-maruku/README.markdown
tdreyno-middleman-0.5.0 vendor/sinatra-maruku/README.markdown
tdreyno-middleman-0.5.2 vendor/sinatra-maruku/README.markdown
tdreyno-middleman-0.5.3 vendor/sinatra-maruku/README.markdown
tdreyno-middleman-0.5.4 vendor/sinatra-maruku/README.markdown
tdreyno-middleman-0.5.5 vendor/sinatra-maruku/README.markdown