octopress-render-code 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/octopress-render-code.rb +11 -5
- data/lib/octopress-render-code/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d559663f30dbd449ed0d0793aff868feebf75ea6
|
4
|
+
data.tar.gz: 95a6eb33f7bdd56d9f0f29b82d7ad74f1663cd3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b94c0cf704afa787d5c621f63cdf23d5486c2f9607ecb9eb25229a6b9e574b062ae528be0f0722e3c5cebac324590eb2a8afb9dff407b43428c8ff464a3d0184
|
7
|
+
data.tar.gz: 5feb30bddd3c6e1c717de49fe71f3b45b64a455234a905f9609cdf24207c90b2b0cfa3f116d06f564f49bd1c2fd777ee10861609839c68b4c397620a896d2fdd
|
data/CHANGELOG.md
CHANGED
@@ -17,7 +17,9 @@ module Octopress
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def render(context)
|
20
|
-
|
20
|
+
if page = context.environments.first['page']
|
21
|
+
@page_path = page['path']
|
22
|
+
end
|
21
23
|
site = context.registers[:site]
|
22
24
|
config_dir = (site.config['code_dir'] || 'downloads/code').sub(/^\//,'')
|
23
25
|
@code_dir = File.join(site.source, config_dir)
|
@@ -60,9 +62,11 @@ module Octopress
|
|
60
62
|
elsif clean_markup =~ TitleFile
|
61
63
|
defaults[:title] = $1
|
62
64
|
@file = get_path($2)
|
63
|
-
|
64
|
-
|
65
|
-
|
65
|
+
if @page_path
|
66
|
+
puts "\nRenderCode Warning:".red
|
67
|
+
puts " Passing title before path has been deprecated and will be removed in RenderCode 2.0".red
|
68
|
+
puts " Update #{@page_path} with {% render_code #{$2} #{$1} ... %}.".yellow
|
69
|
+
end
|
66
70
|
end
|
67
71
|
end
|
68
72
|
|
@@ -80,7 +84,9 @@ module Octopress
|
|
80
84
|
def highlight(code, options)
|
81
85
|
options[:aliases] = @aliases || {}
|
82
86
|
code = CodeHighlighter.highlight(code, options)
|
83
|
-
|
87
|
+
if @page_path
|
88
|
+
code = "<notextile>#{code}</notextile>" if File.extname(@page_path).match(/textile/)
|
89
|
+
end
|
84
90
|
code
|
85
91
|
end
|
86
92
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octopress-render-code
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Mathis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|