Skip to content

Commit

Permalink
Adding a section about module usage in the README (ref #2)
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Courtois committed Jul 30, 2013
1 parent 5b08241 commit a46ed0b
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Add the gem to your `Gemfile` :

Then call `bundle install` to install it for your application.

## Provided helpers
## Usage in Rails

### markdown

Expand Down Expand Up @@ -54,6 +54,37 @@ Output:
<h1>Hello World</h1>
```

## Usage outside of Rails

If you're not using Rails, it's possible to use the Mustdown module directly.

### markdown

This will render the given text through Markdown.

``` ruby
Mustdown.markdown("# Hello World")
# => "<h1>Hello World</h1>"
```

### mustache

The `mustache` method renders a mustache template with the given binding object.

``` ruby
Mustdown.mustache("Hello {{name}}", name: 'John')
# => "Hello John"
```

### mustdown

This method is more complex since it provides the two previous methods in one.

``` ruby
Mustdown.mustdown("# {{title}}", title: 'Hello World')
# => "<h1>Hello World</h1>"
```

## Mustdown configuration

You can generate a default initializer by calling:
Expand Down

0 comments on commit a46ed0b

Please sign in to comment.