forem-markdown_formatter 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/Gemfile +4 -0
- data/README.md +9 -0
- data/Rakefile +1 -0
- data/forem-markdown_formatter.gemspec +25 -0
- data/lib/forem-markdown_formatter.rb +12 -0
- data/lib/forem-markdown_formatter/version.rb +5 -0
- metadata +117 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
# Forem - Markdown Formatter #
|
2
|
+
|
3
|
+
Plugin gem enabling [Markdown](http://daringfireball.net/projects/markdown/syntax) formatting in [Forem](https://github.com/radar/forem) posts, and wherever else forem_format is used.
|
4
|
+
|
5
|
+
## Installation ##
|
6
|
+
|
7
|
+
add to your Bundler Gemfile:
|
8
|
+
|
9
|
+
gem 'forem-markdown_formatter'
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "forem-markdown_formatter/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "forem-markdown_formatter"
|
7
|
+
s.version = Forem::MarkdownFormatter::VERSION
|
8
|
+
s.authors = ["Nicholas Rutherford"]
|
9
|
+
s.email = ["nick.rutherford@gmail.com"]
|
10
|
+
s.homepage = "https://github.com/nruth/forem-markdown_formatter"
|
11
|
+
s.summary = %q{Markdown formatting for forem posts}
|
12
|
+
s.description = %q{Replaces the forem Rails engine's default formatting with Markdown}
|
13
|
+
|
14
|
+
s.rubyforge_project = "forem-markdown_formatter"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
|
21
|
+
# specify any dependencies here; for example:
|
22
|
+
s.add_development_dependency "rspec"
|
23
|
+
s.add_runtime_dependency 'redcarpet', '>= 2.0.0b4'
|
24
|
+
s.add_runtime_dependency "forem"
|
25
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require "forem-markdown_formatter/version"
|
2
|
+
require 'redcarpet'
|
3
|
+
|
4
|
+
module Forem
|
5
|
+
module FormattingHelper
|
6
|
+
def as_formatted_html(text)
|
7
|
+
return text if text.blank?
|
8
|
+
formatter = ::Redcarpet::Markdown.new(Redcarpet::Render::HTML)
|
9
|
+
formatter.render(text).html_safe
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
metadata
ADDED
@@ -0,0 +1,117 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: forem-markdown_formatter
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 0.0.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Nicholas Rutherford
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-10-14 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: rspec
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 3
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
version: "0"
|
32
|
+
type: :development
|
33
|
+
version_requirements: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: redcarpet
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
38
|
+
none: false
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
hash: 63
|
43
|
+
segments:
|
44
|
+
- 2
|
45
|
+
- 0
|
46
|
+
- 0
|
47
|
+
- b
|
48
|
+
- 4
|
49
|
+
version: 2.0.0b4
|
50
|
+
type: :runtime
|
51
|
+
version_requirements: *id002
|
52
|
+
- !ruby/object:Gem::Dependency
|
53
|
+
name: forem
|
54
|
+
prerelease: false
|
55
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
hash: 3
|
61
|
+
segments:
|
62
|
+
- 0
|
63
|
+
version: "0"
|
64
|
+
type: :runtime
|
65
|
+
version_requirements: *id003
|
66
|
+
description: Replaces the forem Rails engine's default formatting with Markdown
|
67
|
+
email:
|
68
|
+
- nick.rutherford@gmail.com
|
69
|
+
executables: []
|
70
|
+
|
71
|
+
extensions: []
|
72
|
+
|
73
|
+
extra_rdoc_files: []
|
74
|
+
|
75
|
+
files:
|
76
|
+
- .gitignore
|
77
|
+
- Gemfile
|
78
|
+
- README.md
|
79
|
+
- Rakefile
|
80
|
+
- forem-markdown_formatter.gemspec
|
81
|
+
- lib/forem-markdown_formatter.rb
|
82
|
+
- lib/forem-markdown_formatter/version.rb
|
83
|
+
homepage: https://github.com/nruth/forem-markdown_formatter
|
84
|
+
licenses: []
|
85
|
+
|
86
|
+
post_install_message:
|
87
|
+
rdoc_options: []
|
88
|
+
|
89
|
+
require_paths:
|
90
|
+
- lib
|
91
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
92
|
+
none: false
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
hash: 3
|
97
|
+
segments:
|
98
|
+
- 0
|
99
|
+
version: "0"
|
100
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
|
+
none: false
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
hash: 3
|
106
|
+
segments:
|
107
|
+
- 0
|
108
|
+
version: "0"
|
109
|
+
requirements: []
|
110
|
+
|
111
|
+
rubyforge_project: forem-markdown_formatter
|
112
|
+
rubygems_version: 1.8.10
|
113
|
+
signing_key:
|
114
|
+
specification_version: 3
|
115
|
+
summary: Markdown formatting for forem posts
|
116
|
+
test_files: []
|
117
|
+
|