gitdoc 3.7.0 → 3.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/TODO +1 -0
- data/VERSION +1 -1
- data/gitdoc.rb +22 -3
- metadata +4 -4
data/TODO
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.8.0
|
data/gitdoc.rb
CHANGED
@@ -102,9 +102,10 @@ helpers do
|
|
102
102
|
|
103
103
|
### HTML Extensions
|
104
104
|
|
105
|
-
def html
|
106
|
-
html = compile_sass_tags
|
107
|
-
compile_scss_tags html
|
105
|
+
def html html
|
106
|
+
html = compile_sass_tags html
|
107
|
+
html = compile_scss_tags html
|
108
|
+
compile_stylus_tags html
|
108
109
|
end
|
109
110
|
|
110
111
|
def compile_scss_tags source
|
@@ -119,6 +120,24 @@ helpers do
|
|
119
120
|
end
|
120
121
|
end
|
121
122
|
|
123
|
+
def compile_stylus_tags source
|
124
|
+
source.gsub(/^<style type=['"]?text\/stylus['"]?>\r?\n(.+?)<\/style>?$/m) do |match|
|
125
|
+
"<style type='text/css'>\n#{stylus $1}</style>"
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
require 'shellwords'
|
130
|
+
|
131
|
+
# Hacked in. Requires node and the coffee and stylus npm packages installed
|
132
|
+
def stylus src
|
133
|
+
stylus_compiler = <<-COFFEE
|
134
|
+
sys = require 'sys' ; stylus = require 'stylus'
|
135
|
+
str = """\n#{src}\n"""
|
136
|
+
stylus.render str, {}, (err,css) -> sys.puts css
|
137
|
+
COFFEE
|
138
|
+
`coffee --eval #{Shellwords.escape stylus_compiler}`.chomp
|
139
|
+
end
|
140
|
+
|
122
141
|
end
|
123
142
|
|
124
143
|
# If the path doesn't have a file extension and a matching GitDoc document
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitdoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 39
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 3
|
8
|
-
-
|
8
|
+
- 8
|
9
9
|
- 0
|
10
|
-
version: 3.
|
10
|
+
version: 3.8.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Myles Byrne
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-02-
|
18
|
+
date: 2011-02-25 00:00:00 +11:00
|
19
19
|
default_executable: gitdoc
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|