Skip to content

thomascullen/markdown_handler

Repository files navigation

Rails Markdown Handler

Adds markdown template handling to rails using the Redcarpet gem.

RailsMarkdownHandler will also parses ERB and embeded HTML.

Installation

gem "markdown_handler"
$ bundle install

Usage

app/config/routes.rb

get "/example", to: "pages#example"

app/controllers/pages_controller.rb

class PagesController < ApplicationController
  def example
  end
end

app/views/pages/example.md

# Posts

<% @posts.each do |post| %>
  ## <%= post.title %>
  <%= post.body %>
<% end %>

Configuration

You can configure the redcarpet renderer using an initializer.

# app/config/initializers/markdown.rb
MarkdownHandler.configure do |config|
  config[:autolink] = false
end

About

A markdown template handler for rails

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published