makers-mark 0.0.4 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/makers-mark.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  $LOAD_PATH << File.dirname(__FILE__)
2
2
 
3
3
  require 'rubygems'
4
- require 'rdiscount'
4
+ require 'bluecloth'
5
5
  require 'nokogiri'
6
6
  require File.join(File.dirname(__FILE__), *%w[.. vendor albino])
7
7
  require 'makers-mark/generator'
@@ -18,9 +18,9 @@ module MakersMark
18
18
  def highlight!
19
19
  doc.search('div.code').each do |div|
20
20
  lexer = div['rel'] || :ruby
21
-
21
+
22
22
  lexted_text = Albino.new(div.text, lexer).to_s
23
-
23
+
24
24
  highlighted = Nokogiri::HTML(lexted_text).at('div')
25
25
 
26
26
  klasses = highlighted['class'].split(/\s+/)
@@ -36,7 +36,7 @@ module MakersMark
36
36
  def markup
37
37
  @markup ||= begin
38
38
  logger.info "WRITING!"
39
- t = RDiscount.new(@markdown.dup).to_html
39
+ t = BlueCloth.new(@markdown.dup).to_html
40
40
  t.gsub!(/^(?:<p>)?@@@(?:<\/p>)?$/, '</div>')
41
41
  t.gsub!(/^(?:<p>)?@@@\s*(\w+)(?:<\/p>)?$/, '<div class="code" rel="\1">')
42
42
  t
data/vendor/albino.rb CHANGED
@@ -44,7 +44,7 @@
44
44
  require 'open4'
45
45
 
46
46
  class Albino
47
- @@bin = '/usr/local/bin/pygmentize'
47
+ @@bin = ENV['PYGMENTIZE_BIN'] || '/usr/local/bin/pygmentize'
48
48
 
49
49
  def self.bin=(path)
50
50
  @@bin = path
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: makers-mark
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pat Nakajima
@@ -13,14 +13,14 @@ date: 2009-04-05 00:00:00 -04:00
13
13
  default_executable: mark
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
- name: rtomayko-rdiscount
16
+ name: bluecloth
17
17
  type: :runtime
18
18
  version_requirement:
19
19
  version_requirements: !ruby/object:Gem::Requirement
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: "0"
23
+ version: 2.0.0
24
24
  version:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: nokogiri