gitdoc 3.2.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/gitdoc.rb +20 -2
  3. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.2.0
1
+ 3.3.0
data/gitdoc.rb CHANGED
@@ -94,13 +94,24 @@ helpers do
94
94
 
95
95
  ### Coffee Compiler
96
96
 
97
- require 'v8'
98
97
  require 'coffee-script'
99
98
 
100
99
  def coffee source
101
100
  CoffeeScript.compile source
102
101
  end
103
102
 
103
+ ### HTML Extensions
104
+
105
+ def html source
106
+ compile_sass_tags source
107
+ end
108
+
109
+ def compile_sass_tags source
110
+ source.gsub(/^<style type=['"]?text\/sass['"]?>\r?\n(.+?)<\/style>?$/m) do |match|
111
+ "<style type='text/css'>\n#{sass $1}</style>"
112
+ end
113
+ end
114
+
104
115
  end
105
116
 
106
117
  # If the path doesn't have a file extension and a matching GitDoc document
@@ -128,7 +139,14 @@ end
128
139
  get '*.coffee.js' do |name|
129
140
  file = settings.dir + '/' + name + '.coffee'
130
141
  pass unless File.exist? file
131
- coffee File.read file
142
+ coffee File.read(file)
143
+ end
144
+
145
+ # Extends html to support sass
146
+ get '*.html' do |name|
147
+ file = settings.dir + '/' + name + '.html'
148
+ pass unless File.exist? file
149
+ html File.read(file)
132
150
  end
133
151
 
134
152
  # If the path matches any file in the directory then send that down
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: 15
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 3
8
- - 2
8
+ - 3
9
9
  - 0
10
- version: 3.2.0
10
+ version: 3.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Myles Byrne