0.0
No commit activity in last 3 years
No release in over 3 years
Markdown (GFM) view helper with redis-backed cache
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.11
~> 5.0
~> 10.0

Runtime

>= 1.0
>= 3.0
>= 1.0
 Project Readme

Build Status

MarkdownCache

Simple and zero-configuration gem to quickly add Markdown rendering to your Rails views. Once installed, just use in any view:

<%= markdown "**Hello** _world_" %>

Dependencies & Defaults

This gem uses kramdown and rouge and will require them automatically. You also need a Redis server running both locally and in production as this gem uses a redis-back cached.

The selected input format is GitHub Flavored Markdown.

Setup

Add this to your Gemfile, then run bundle install :

gem "markdown_cache", "~> 0.1"

You may use the provided CSS file for syntax highlighting (GitHub style) or download any pygments-compatible CSS stylesheet (.highlight CSS class):

/*
 *= require markdown_cache
 */

By default, the gem will pick up the local Redis instance or the one defined with REDIS_URL but if you need to be specific, add an initializer to your Rails app, for instance:

# config/initializers/markdown_cache.rb
if Rails.env.production?
  MarkdownCache.configure do |config|
    config.redis = { url: ENV['REDISCLOUD_URL'] }
  end
end