jekyll-terminal 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jekyll-terminal/jekyll-terminal.rb +11 -11
- data/lib/jekyll-terminal/terminal.scss +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d21edf92df436cb88c2e9aee44feba3fab3e5d7
|
4
|
+
data.tar.gz: 985e3203aaca5ea72b39b8ebf9ae0098c5ca3239
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d3b9abdbb47b745f4b97ed990c4e8369e4ca2928c16a1f6b1b26ce35081c4d05be0fdfbce9ae10a5cc57328b506e0759117c91c4ec75de8846d1e086c6a17b7
|
7
|
+
data.tar.gz: 8bf3957afd510c56a0f628b4b12172e7f7a335f1b46d48ebd0dad5a93a1038f0e4b037bc19bb0e0f1a4b715337fcf585ad8672ab82979b2250ffd64332dad104
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'jekyll'
|
2
|
+
require 'cgi'
|
2
3
|
|
3
4
|
module Jekyll
|
4
5
|
module Terminal
|
@@ -91,24 +92,23 @@ module Jekyll
|
|
91
92
|
end
|
92
93
|
|
93
94
|
def gutter(line)
|
94
|
-
gutter_value = line.start_with?(
|
95
|
+
gutter_value = line.start_with?("$") ? "$" : " "
|
95
96
|
"<span>#{gutter_value}</span><br>"
|
96
97
|
end
|
97
98
|
|
99
|
+
def esc(line)
|
100
|
+
CGI.escapeHTML(line.strip)
|
101
|
+
end
|
102
|
+
|
98
103
|
def line_of_code(line)
|
99
|
-
if line.start_with?(
|
100
|
-
|
101
|
-
|
104
|
+
if line.start_with?("$")
|
105
|
+
%{<span class='command'>#{esc line[1..-1]}</span><br>}
|
106
|
+
elsif line.start_with?("/")
|
107
|
+
%{<span class='continuation'>#{esc line[1..-1]}</span><br>}
|
102
108
|
else
|
103
|
-
|
109
|
+
%{<span class='output'>#{esc line}</span><br>}
|
104
110
|
end
|
105
|
-
%{<span class='#{line_class}'>#{line.strip}</span><br>}
|
106
111
|
end
|
107
|
-
|
108
|
-
def command_character
|
109
|
-
"$"
|
110
|
-
end
|
111
|
-
|
112
112
|
end
|
113
113
|
end
|
114
114
|
end
|