awestruct 0.2.13 → 0.2.14
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/awestruct +1 -1
- data/lib/awestruct/asciidoc_file.rb +24 -0
- data/lib/awestruct/asciidocable.rb +35 -0
- data/lib/awestruct/commands/frameworks/bootstrap/base_index.html.haml +27 -0
- data/lib/awestruct/commands/frameworks/bootstrap/base_layout.html.haml +29 -0
- data/lib/awestruct/commands/init.rb +5 -1
- data/lib/awestruct/engine.rb +29 -5
- data/lib/awestruct/extensions/minify.rb +65 -4
- data/lib/awestruct/extensions/paginator.rb +1 -1
- data/lib/awestruct/haml/filters/asciidoc.rb +8 -0
- data/lib/awestruct/haml_file.rb +4 -1
- data/lib/awestruct/hamlable.rb +5 -9
- data/lib/awestruct/markdownable.rb +2 -8
- data/lib/awestruct/{org_mode_file.rb → orgmode_file.rb} +3 -4
- data/lib/awestruct/{org_modeable.rb → orgmodeable.rb} +1 -2
- data/lib/awestruct/restructuredtext_file.rb +23 -0
- data/lib/awestruct/restructuredtextable.rb +38 -0
- data/lib/awestruct/textilable.rb +8 -11
- data/lib/awestruct/version.rb +1 -1
- metadata +50 -43
data/bin/awestruct
CHANGED
@@ -34,7 +34,7 @@ def parse(args)
|
|
34
34
|
options.init = init
|
35
35
|
options.generate = false
|
36
36
|
end
|
37
|
-
opts.on( '-f', '--framework FRAMEWORK', 'Specify a compass framework during initialization (blueprint, 960)' ) do |framework|
|
37
|
+
opts.on( '-f', '--framework FRAMEWORK', 'Specify a compass framework during initialization (bootstrap, blueprint, 960)' ) do |framework|
|
38
38
|
options.framework = framework
|
39
39
|
end
|
40
40
|
opts.on( '--[no-]scaffold', 'Create scaffolding during initialization (default: true)' ) do |s|
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'open3'
|
2
|
+
require 'pathname'
|
3
|
+
require 'awestruct/front_matter_file'
|
4
|
+
require 'awestruct/asciidocable'
|
5
|
+
|
6
|
+
module Awestruct
|
7
|
+
class AsciiDocFile < FrontMatterFile
|
8
|
+
|
9
|
+
include AsciiDocable
|
10
|
+
|
11
|
+
def initialize(site, source_path, relative_source_path, options = {})
|
12
|
+
super(site, source_path, relative_source_path, options)
|
13
|
+
end
|
14
|
+
|
15
|
+
def output_filename
|
16
|
+
File.basename(self.source_path.gsub(/\.(asciidoc|adoc)$/, output_extension))
|
17
|
+
end
|
18
|
+
|
19
|
+
def output_extension
|
20
|
+
'.html'
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module Awestruct
|
2
|
+
module AsciiDocable
|
3
|
+
|
4
|
+
def render(context)
|
5
|
+
_render(context.interpolate_string(raw_page_content), context.page.relative_source_path, site)
|
6
|
+
end
|
7
|
+
|
8
|
+
def content
|
9
|
+
context = site.engine.create_context( self )
|
10
|
+
render( context )
|
11
|
+
end
|
12
|
+
|
13
|
+
def _render(content, relative_source_path, site)
|
14
|
+
# TODO replace with site.engine.config.images_dir once available
|
15
|
+
imagesdir = Pathname.new('/images').relative_path_from(Pathname.new(File.dirname(relative_source_path)))
|
16
|
+
iconsdir = File.join(imagesdir, 'icons')
|
17
|
+
conffile = File.join(site.engine.config.config_dir, 'asciidoc.conf')
|
18
|
+
confopt = File.exist?(conffile) ? '-f ' + conffile : ''
|
19
|
+
execute("asciidoc -s -b html5 -a pygments -a icons -a iconsdir='#{iconsdir}' -a imagesdir='#{imagesdir}' #{confopt} -o - -", content)
|
20
|
+
end
|
21
|
+
|
22
|
+
def execute(command, target)
|
23
|
+
out = ''
|
24
|
+
Open3.popen3(command) do |stdin, stdout, _|
|
25
|
+
stdin.puts target
|
26
|
+
stdin.close
|
27
|
+
out = stdout.read
|
28
|
+
end
|
29
|
+
out.gsub("\r", '')
|
30
|
+
rescue Errno::EPIPE
|
31
|
+
""
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
---
|
2
|
+
layout: base
|
3
|
+
---
|
4
|
+
.hero-unit
|
5
|
+
%h1 You're awestruct!
|
6
|
+
%p Your site is all setup to use Twitter Bootstrap with Awestruct.
|
7
|
+
%p
|
8
|
+
%a.btn.btn-primary.btn-large{ :href=>'http://awestruct.org' }
|
9
|
+
%i.icon-info-sign.icon-white
|
10
|
+
Learn more »
|
11
|
+
.row
|
12
|
+
.span4
|
13
|
+
%h2 About
|
14
|
+
%p Awestruct is a framework for creating static HTML sites. It's inspired by the awesome Jekyll utility in the same genre.
|
15
|
+
%p Additionally, Awestruct integrates technologies such as Compass, Markdown and Haml.
|
16
|
+
%p
|
17
|
+
%a.btn{ :href=>'http://awestruct.org' } View details »
|
18
|
+
.span4
|
19
|
+
%h2 Goal
|
20
|
+
%p The goal of Awestruct is to make it trivially easy to bake out non-trivial static websites. In addition to providing template-driven site creation (using Haml), Awestruct provides facilities for easily priming the site creation with additional non-page data.
|
21
|
+
%p
|
22
|
+
%a.btn{ :href=>'http://awestruct.org' } View details »
|
23
|
+
.span4
|
24
|
+
%h2 Concept
|
25
|
+
%p The core concept of Awestruct is that of structures, specifically Ruby OpenStruct structures. The struct aspect allows arbitrary, schema-less data to be associated with a specific page or the entire site.
|
26
|
+
%p
|
27
|
+
%a.btn{ :href=>'http://awestruct.org' } View details »
|
@@ -0,0 +1,29 @@
|
|
1
|
+
!!!5
|
2
|
+
%html
|
3
|
+
%head
|
4
|
+
%meta{ :charset=>'utf-8' }
|
5
|
+
%title An awesome site
|
6
|
+
%meta{ :name=>'viewport', :content=>'width=device-width, initial-scale=1.0' }
|
7
|
+
:css
|
8
|
+
body {
|
9
|
+
padding-top: 60px;
|
10
|
+
}
|
11
|
+
%link{ :rel=>'stylesheet', :type=>'text/css', :href=>'/stylesheets/styles.css' }
|
12
|
+
/[if lt IE 9]
|
13
|
+
%script{ :type=>'text/javascript', :src=>'//html5shim.googlecode.com/svn/trunk/html5.js' }
|
14
|
+
%body
|
15
|
+
.navbar.navbar-fixed-top
|
16
|
+
.navbar-inner
|
17
|
+
.container
|
18
|
+
%a.brand{ :href=>'/' } Project Name
|
19
|
+
%ul.nav
|
20
|
+
%li
|
21
|
+
%a{ :href=>'/' } Home
|
22
|
+
.container
|
23
|
+
~ content
|
24
|
+
%hr
|
25
|
+
%footer
|
26
|
+
%p © Organization #{Date.today.year}
|
27
|
+
-# Uncomment script tags (remove leading -#) when you're ready to use behaviors
|
28
|
+
-# %script{ :type=>'text/javascript', :src=>'//cdnjs.cloudflare.com/ajax/libs/jquery/1.7.1/jquery.min.js' }
|
29
|
+
-# %script{ :type=>'text/javascript', :src=>'/javascripts/bootstrap-collapse.js' }
|
@@ -25,7 +25,11 @@ module Awestruct
|
|
25
25
|
scaffold_name = ( @framework == 'compass' ? 'blueprint' : @framework )
|
26
26
|
if ( @scaffold )
|
27
27
|
manifest.copy_file( '_layouts/base.html.haml', File.join( File.dirname(__FILE__), "/frameworks/#{scaffold_name}/base_layout.html.haml" ) )
|
28
|
-
|
28
|
+
if ( File.file? File.join( File.dirname(__FILE__), "/frameworks/#{scaffold_name}/base_index.html.haml" ) )
|
29
|
+
manifest.copy_file( 'index.html.haml', File.join( File.dirname(__FILE__), "/frameworks/#{scaffold_name}/base_index.html.haml" ) )
|
30
|
+
else
|
31
|
+
manifest.copy_file( 'index.html.haml', File.join( File.dirname(__FILE__), "/frameworks/base_index.html.haml" ) )
|
32
|
+
end
|
29
33
|
manifest.touch_file( '_config/site.yml' )
|
30
34
|
end
|
31
35
|
manifest.perform( @dir )
|
data/lib/awestruct/engine.rb
CHANGED
@@ -2,7 +2,9 @@ require 'ostruct'
|
|
2
2
|
require 'find'
|
3
3
|
require 'compass'
|
4
4
|
require 'ninesixty'
|
5
|
+
require 'bootstrap-sass'
|
5
6
|
require 'time'
|
7
|
+
require 'notifier'
|
6
8
|
|
7
9
|
require 'hashery/opencascade'
|
8
10
|
|
@@ -12,10 +14,12 @@ require 'awestruct/haml_file'
|
|
12
14
|
require 'awestruct/erb_file'
|
13
15
|
require 'awestruct/textile_file'
|
14
16
|
require 'awestruct/markdown_file'
|
17
|
+
require 'awestruct/asciidoc_file'
|
15
18
|
require 'awestruct/sass_file'
|
16
19
|
require 'awestruct/scss_file'
|
17
|
-
require 'awestruct/
|
20
|
+
require 'awestruct/orgmode_file'
|
18
21
|
require 'awestruct/verbatim_file'
|
22
|
+
require 'awestruct/restructuredtext_file'
|
19
23
|
|
20
24
|
require 'awestruct/context_helper'
|
21
25
|
|
@@ -37,6 +41,7 @@ require 'awestruct/extensions/cachebuster'
|
|
37
41
|
require 'awestruct/extensions/obfuscate'
|
38
42
|
require 'awestruct/extensions/relative'
|
39
43
|
require 'awestruct/extensions/assets'
|
44
|
+
require 'awestruct/extensions/minify'
|
40
45
|
|
41
46
|
require 'awestruct/util/inflector'
|
42
47
|
require 'awestruct/util/default_inflections'
|
@@ -65,6 +70,10 @@ module Awestruct
|
|
65
70
|
@site.skin_dir
|
66
71
|
end
|
67
72
|
|
73
|
+
def config
|
74
|
+
@config
|
75
|
+
end
|
76
|
+
|
68
77
|
def generate(profile=nil, base_url=nil, default_base_url=nil, force=false)
|
69
78
|
@base_url = base_url
|
70
79
|
@default_base_url = default_base_url
|
@@ -113,12 +122,16 @@ module Awestruct
|
|
113
122
|
page = TextileFile.new( site, path, fixed_relative_path, options )
|
114
123
|
elsif ( path =~ /\.md$/ )
|
115
124
|
page = MarkdownFile.new( site, path, fixed_relative_path, options )
|
125
|
+
elsif ( path =~ /\.(asciidoc|adoc)$/ )
|
126
|
+
page = AsciiDocFile.new( site, path, fixed_relative_path, options )
|
116
127
|
elsif ( path =~ /\.sass$/ )
|
117
128
|
page = SassFile.new( site, path, fixed_relative_path, options )
|
118
129
|
elsif ( path =~ /\.scss$/ )
|
119
130
|
page = ScssFile.new( site, path, fixed_relative_path, options )
|
120
131
|
elsif ( path =~ /\.org$/ )
|
121
|
-
page =
|
132
|
+
page = OrgmodeFile.new( site, path, fixed_relative_path, options )
|
133
|
+
elsif ( path =~ /\.rst$/ )
|
134
|
+
page = ReStructuredTextFile.new( site, path, fixed_relative_path, options )
|
122
135
|
elsif ( File.file?( path ) )
|
123
136
|
page = VerbatimFile.new( site, path, fixed_relative_path, options )
|
124
137
|
end
|
@@ -185,10 +198,16 @@ module Awestruct
|
|
185
198
|
def configure_compass
|
186
199
|
Compass.configuration.project_type = :standalone
|
187
200
|
Compass.configuration.project_path = dir
|
188
|
-
Compass.configuration.css_dir = File.join( config.output_dir, 'stylesheets' )
|
189
201
|
Compass.configuration.sass_dir = 'stylesheets'
|
190
|
-
|
202
|
+
|
203
|
+
site.images_dir = File.join( config.output_dir, 'images' )
|
204
|
+
site.stylesheets_dir = File.join( config.output_dir, 'stylesheets' )
|
205
|
+
site.javascripts_dir = File.join( config.output_dir, 'javascripts' )
|
206
|
+
|
207
|
+
Compass.configuration.css_dir = site.css_dir
|
191
208
|
Compass.configuration.javascripts_dir = 'javascripts'
|
209
|
+
Compass.configuration.images_dir = 'images'
|
210
|
+
|
192
211
|
end
|
193
212
|
|
194
213
|
def set_base_url
|
@@ -209,7 +228,12 @@ module Awestruct
|
|
209
228
|
|
210
229
|
def generate_files(force)
|
211
230
|
site.pages.each do |page|
|
212
|
-
|
231
|
+
begin
|
232
|
+
generate_page( page, force )
|
233
|
+
rescue Exception => e
|
234
|
+
Notifier.notify(:title=>"Error generating page #{page.name}", :message=>e.to_s)
|
235
|
+
puts "Cannot render page #{page.source_path}. #{e.to_s}"
|
236
|
+
end
|
213
237
|
end
|
214
238
|
end
|
215
239
|
|
@@ -1,5 +1,52 @@
|
|
1
1
|
require 'fileutils'
|
2
2
|
|
3
|
+
##
|
4
|
+
# Awestruct:Extensions:Minify is a transformer that minimizes JavaScript, CSS and HTML files.
|
5
|
+
# The transform runs on the rendered stream before it's written to the output path.
|
6
|
+
#
|
7
|
+
# Minification is performed by the following three libraries:
|
8
|
+
#
|
9
|
+
# htmlcompressor (minifies HTML): http://code.google.com/p/htmlcompressor/
|
10
|
+
# yuicompressor (minifies JavaScript and CSS): http://developer.yahoo.com/yui/compressor/
|
11
|
+
# pngcrush (minifies PNG): http://pmt.sourceforge.net/pngcrush/
|
12
|
+
#
|
13
|
+
# These commands must be available on your PATH in order to use them.
|
14
|
+
#
|
15
|
+
# This class is loaded as a transformer in the Awestruct pipeline. The
|
16
|
+
# constructor accepts an array of symbols representing the file types to minimize.
|
17
|
+
#
|
18
|
+
# extension Awestruct::Extensions::Minify.new
|
19
|
+
#
|
20
|
+
# This transform recognizes the following symbols:
|
21
|
+
#
|
22
|
+
# :css - CSS files with extension .css
|
23
|
+
# :js - JavaScript files with extension .js
|
24
|
+
# :html - HTML files with extension .html
|
25
|
+
# :png - PNG files with extension .png
|
26
|
+
#
|
27
|
+
# If no types are specified, the default value [:css, :js] is used.
|
28
|
+
#
|
29
|
+
# In addition to registering the transformer in the pipeline, it must be enabled
|
30
|
+
# by setting the following site property in _ext/config.yml:
|
31
|
+
#
|
32
|
+
# minify: true
|
33
|
+
#
|
34
|
+
# You can limit activation to one or more profiles:
|
35
|
+
#
|
36
|
+
# profiles:
|
37
|
+
# production:
|
38
|
+
# minify: true
|
39
|
+
#
|
40
|
+
# You can also configure the option arguments passed to the compressor programs. Here's
|
41
|
+
# how you specify options arguments for the htmlcompressor command:
|
42
|
+
#
|
43
|
+
# minify_html_opts:
|
44
|
+
# remove_intertag_spaces: true
|
45
|
+
# compress_js: true
|
46
|
+
# compress_css: true
|
47
|
+
#
|
48
|
+
# Note that any hypen (-) must be represented as an underscore (_) in the configuration.
|
49
|
+
|
3
50
|
module Awestruct
|
4
51
|
module Extensions
|
5
52
|
class Minify
|
@@ -15,7 +62,7 @@ module Awestruct
|
|
15
62
|
case ext
|
16
63
|
when :html
|
17
64
|
print "minifying html #{page.output_path}"
|
18
|
-
htmlcompressor(page, input)
|
65
|
+
htmlcompressor(page, input, site.minify_html_opts)
|
19
66
|
when :css
|
20
67
|
print "minifying css #{page.output_path}"
|
21
68
|
yuicompressor(page, input, :css)
|
@@ -28,16 +75,30 @@ module Awestruct
|
|
28
75
|
else
|
29
76
|
input
|
30
77
|
end
|
78
|
+
else
|
79
|
+
input
|
31
80
|
end
|
81
|
+
else
|
82
|
+
input
|
32
83
|
end
|
33
|
-
input
|
34
84
|
end
|
35
85
|
|
36
86
|
private
|
37
87
|
|
38
|
-
def htmlcompressor(page, input)
|
88
|
+
def htmlcompressor(page, input, minify_html_opts)
|
39
89
|
output = ''
|
40
|
-
|
90
|
+
cmd = "htmlcompressor"
|
91
|
+
if minify_html_opts
|
92
|
+
minify_html_opts.each do |p, v|
|
93
|
+
# boolean options are simple flags (i.e., do not accept values)
|
94
|
+
if v === true
|
95
|
+
cmd += " --#{p.gsub('_', '-')}"
|
96
|
+
elsif not v === false
|
97
|
+
cmd += " --#{p.gsub('_', '-')}=#{v}"
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
Open3.popen3(cmd) do |stdin, stdout, stderr|
|
41
102
|
threads = []
|
42
103
|
threads << Thread.new(stdout) do |o|
|
43
104
|
while ( ! o.eof? )
|
@@ -66,7 +66,7 @@ module Awestruct
|
|
66
66
|
if ( i == 1 )
|
67
67
|
page.output_path = File.join( @output_prefix, File.basename( @input_path ) + ".html" )
|
68
68
|
else
|
69
|
-
page.output_path = File.join( @output_prefix, "page
|
69
|
+
page.output_path = File.join( @output_prefix, "page/#{i}.html" )
|
70
70
|
end
|
71
71
|
page.paginate_generated = true
|
72
72
|
site.pages << page
|
data/lib/awestruct/haml_file.rb
CHANGED
@@ -1,7 +1,10 @@
|
|
1
|
-
|
2
1
|
require 'haml'
|
2
|
+
require 'open3'
|
3
|
+
require 'pathname'
|
3
4
|
require 'awestruct/front_matter_file'
|
4
5
|
require 'awestruct/hamlable'
|
6
|
+
require 'awestruct/asciidocable'
|
7
|
+
require 'awestruct/haml/filters/asciidoc'
|
5
8
|
|
6
9
|
module Awestruct
|
7
10
|
class HamlFile < FrontMatterFile
|
data/lib/awestruct/hamlable.rb
CHANGED
@@ -3,15 +3,11 @@ module Awestruct
|
|
3
3
|
module Hamlable
|
4
4
|
def render(context)
|
5
5
|
rendered = ''
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
puts e
|
12
|
-
puts e.backtrace
|
13
|
-
end
|
14
|
-
rendered
|
6
|
+
options = (site.haml || {}).inject({}){|h,(k,v)| h[k.to_sym] = v; h }
|
7
|
+
options[:relative_source_path] = context.page.relative_source_path
|
8
|
+
options[:site] = site
|
9
|
+
haml_engine = Haml::Engine.new( raw_page_content, options )
|
10
|
+
haml_engine.render( context )
|
15
11
|
end
|
16
12
|
|
17
13
|
def content
|
@@ -5,14 +5,8 @@ module Awestruct
|
|
5
5
|
module Markdownable
|
6
6
|
def render(context)
|
7
7
|
rendered = ''
|
8
|
-
|
9
|
-
|
10
|
-
rendered = doc.to_html
|
11
|
-
rescue => e
|
12
|
-
puts e
|
13
|
-
puts e.backtrace
|
14
|
-
end
|
15
|
-
rendered
|
8
|
+
doc = RDiscount.new( context.interpolate_string( raw_page_content ) )
|
9
|
+
doc.to_html
|
16
10
|
end
|
17
11
|
|
18
12
|
def content
|
@@ -1,12 +1,11 @@
|
|
1
|
-
|
2
1
|
require 'sass'
|
3
2
|
require 'awestruct/front_matter_file'
|
4
|
-
require 'awestruct/
|
3
|
+
require 'awestruct/orgmodeable'
|
5
4
|
|
6
5
|
module Awestruct
|
7
|
-
class
|
6
|
+
class OrgmodeFile < FrontMatterFile
|
8
7
|
|
9
|
-
include
|
8
|
+
include Orgmodeable
|
10
9
|
|
11
10
|
def initialize(site, source_path, relative_source_path, options = {})
|
12
11
|
super( site, source_path, relative_source_path, options )
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'open3'
|
2
|
+
require 'awestruct/front_matter_file'
|
3
|
+
require 'awestruct/restructuredtextable'
|
4
|
+
|
5
|
+
module Awestruct
|
6
|
+
class ReStructuredTextFile < FrontMatterFile
|
7
|
+
|
8
|
+
include ReStructuredTextable
|
9
|
+
|
10
|
+
def initialize(site, source_path, relative_source_path, options = {})
|
11
|
+
super(site, source_path, relative_source_path, options)
|
12
|
+
end
|
13
|
+
|
14
|
+
def output_filename
|
15
|
+
File.basename( self.source_path, '.rst' ) + output_extension
|
16
|
+
end
|
17
|
+
|
18
|
+
def output_extension
|
19
|
+
'.html'
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module Awestruct
|
2
|
+
module ReStructuredTextable
|
3
|
+
|
4
|
+
def render(context)
|
5
|
+
hl = 1
|
6
|
+
if front_matter['initial_header_level'].to_s =~ /^[1-6]$/
|
7
|
+
hl = front_matter['initial_header_level']
|
8
|
+
end
|
9
|
+
rendered = ''
|
10
|
+
begin
|
11
|
+
doc = execute( "rst2html --strip-comments --no-doc-title --initial-header-level=#{hl}", context.interpolate_string( raw_page_content ) )
|
12
|
+
rendered = Hpricot( doc ).at( '/html/body/div[@class="document"]' ).inner_html.strip
|
13
|
+
rescue => e
|
14
|
+
puts e
|
15
|
+
puts e.backtrace
|
16
|
+
end
|
17
|
+
rendered
|
18
|
+
end
|
19
|
+
|
20
|
+
def content
|
21
|
+
context = site.engine.create_context( self )
|
22
|
+
render( context )
|
23
|
+
end
|
24
|
+
|
25
|
+
def execute(command, target)
|
26
|
+
out = ''
|
27
|
+
Open3.popen3(command) do |stdin, stdout, _|
|
28
|
+
stdin.puts target
|
29
|
+
stdin.close
|
30
|
+
out = stdout.read
|
31
|
+
end
|
32
|
+
out.gsub("\r", '')
|
33
|
+
rescue Errno::EPIPE
|
34
|
+
""
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
data/lib/awestruct/textilable.rb
CHANGED
@@ -3,17 +3,14 @@ module Awestruct
|
|
3
3
|
module Textilable
|
4
4
|
def render(context)
|
5
5
|
rendered = ''
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
puts e.backtrace
|
15
|
-
end
|
16
|
-
rendered
|
6
|
+
# security and rendering restrictions
|
7
|
+
# ex. site.textile = ['no_span_caps']
|
8
|
+
restrictions = (site.textile || []).map { |r| r.to_sym }
|
9
|
+
# a module of rule functions is included in RedCloth using RedCloth.send(:include, MyRules)
|
10
|
+
# rule functions on that module are activated by setting the property site.textile_rules
|
11
|
+
# ex. site.textile_rules = ['emoticons']
|
12
|
+
rules = context.site.textile_rules ? context.site.textile_rules.map { |r| r.to_sym } : []
|
13
|
+
RedCloth.new( context.interpolate_string( raw_page_content ), restrictions ).to_html(*rules)
|
17
14
|
end
|
18
15
|
|
19
16
|
def content
|
data/lib/awestruct/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awestruct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
4
|
+
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
7
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
8
|
+
- 14
|
9
|
+
version: 0.2.14
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Bob McWhirter
|
@@ -15,17 +14,16 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2012-
|
17
|
+
date: 2012-03-12 00:00:00 -04:00
|
18
|
+
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: hpricot
|
22
22
|
prerelease: false
|
23
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
-
none: false
|
25
24
|
requirements:
|
26
25
|
- - ~>
|
27
26
|
- !ruby/object:Gem::Version
|
28
|
-
hash: 51
|
29
27
|
segments:
|
30
28
|
- 0
|
31
29
|
- 8
|
@@ -37,11 +35,9 @@ dependencies:
|
|
37
35
|
name: versionomy
|
38
36
|
prerelease: false
|
39
37
|
requirement: &id002 !ruby/object:Gem::Requirement
|
40
|
-
none: false
|
41
38
|
requirements:
|
42
39
|
- - ~>
|
43
40
|
- !ruby/object:Gem::Version
|
44
|
-
hash: 13
|
45
41
|
segments:
|
46
42
|
- 0
|
47
43
|
- 4
|
@@ -53,11 +49,9 @@ dependencies:
|
|
53
49
|
name: haml
|
54
50
|
prerelease: false
|
55
51
|
requirement: &id003 !ruby/object:Gem::Requirement
|
56
|
-
none: false
|
57
52
|
requirements:
|
58
53
|
- - ~>
|
59
54
|
- !ruby/object:Gem::Version
|
60
|
-
hash: 3
|
61
55
|
segments:
|
62
56
|
- 3
|
63
57
|
- 1
|
@@ -69,11 +63,9 @@ dependencies:
|
|
69
63
|
name: sass
|
70
64
|
prerelease: false
|
71
65
|
requirement: &id004 !ruby/object:Gem::Requirement
|
72
|
-
none: false
|
73
66
|
requirements:
|
74
67
|
- - ~>
|
75
68
|
- !ruby/object:Gem::Version
|
76
|
-
hash: 3
|
77
69
|
segments:
|
78
70
|
- 3
|
79
71
|
- 1
|
@@ -85,11 +77,9 @@ dependencies:
|
|
85
77
|
name: hashery
|
86
78
|
prerelease: false
|
87
79
|
requirement: &id005 !ruby/object:Gem::Requirement
|
88
|
-
none: false
|
89
80
|
requirements:
|
90
81
|
- - ~>
|
91
82
|
- !ruby/object:Gem::Version
|
92
|
-
hash: 7
|
93
83
|
segments:
|
94
84
|
- 1
|
95
85
|
- 4
|
@@ -101,11 +91,9 @@ dependencies:
|
|
101
91
|
name: rdiscount
|
102
92
|
prerelease: false
|
103
93
|
requirement: &id006 !ruby/object:Gem::Requirement
|
104
|
-
none: false
|
105
94
|
requirements:
|
106
95
|
- - ~>
|
107
96
|
- !ruby/object:Gem::Version
|
108
|
-
hash: 31
|
109
97
|
segments:
|
110
98
|
- 1
|
111
99
|
- 6
|
@@ -117,11 +105,9 @@ dependencies:
|
|
117
105
|
name: RedCloth
|
118
106
|
prerelease: false
|
119
107
|
requirement: &id007 !ruby/object:Gem::Requirement
|
120
|
-
none: false
|
121
108
|
requirements:
|
122
109
|
- - ~>
|
123
110
|
- !ruby/object:Gem::Version
|
124
|
-
hash: 61
|
125
111
|
segments:
|
126
112
|
- 4
|
127
113
|
- 2
|
@@ -133,11 +119,9 @@ dependencies:
|
|
133
119
|
name: compass
|
134
120
|
prerelease: false
|
135
121
|
requirement: &id008 !ruby/object:Gem::Requirement
|
136
|
-
none: false
|
137
122
|
requirements:
|
138
123
|
- - ~>
|
139
124
|
- !ruby/object:Gem::Version
|
140
|
-
hash: 57
|
141
125
|
segments:
|
142
126
|
- 0
|
143
127
|
- 11
|
@@ -149,11 +133,9 @@ dependencies:
|
|
149
133
|
name: compass-960-plugin
|
150
134
|
prerelease: false
|
151
135
|
requirement: &id009 !ruby/object:Gem::Requirement
|
152
|
-
none: false
|
153
136
|
requirements:
|
154
137
|
- - ~>
|
155
138
|
- !ruby/object:Gem::Version
|
156
|
-
hash: 63
|
157
139
|
segments:
|
158
140
|
- 0
|
159
141
|
- 10
|
@@ -162,53 +144,75 @@ dependencies:
|
|
162
144
|
type: :runtime
|
163
145
|
version_requirements: *id009
|
164
146
|
- !ruby/object:Gem::Dependency
|
165
|
-
name:
|
147
|
+
name: bootstrap-sass
|
166
148
|
prerelease: false
|
167
149
|
requirement: &id010 !ruby/object:Gem::Requirement
|
168
|
-
none: false
|
169
150
|
requirements:
|
170
151
|
- - ~>
|
171
152
|
- !ruby/object:Gem::Version
|
172
|
-
|
153
|
+
segments:
|
154
|
+
- 2
|
155
|
+
- 0
|
156
|
+
- 1
|
157
|
+
version: 2.0.1
|
158
|
+
type: :runtime
|
159
|
+
version_requirements: *id010
|
160
|
+
- !ruby/object:Gem::Dependency
|
161
|
+
name: org-ruby
|
162
|
+
prerelease: false
|
163
|
+
requirement: &id011 !ruby/object:Gem::Requirement
|
164
|
+
requirements:
|
165
|
+
- - ~>
|
166
|
+
- !ruby/object:Gem::Version
|
173
167
|
segments:
|
174
168
|
- 0
|
175
169
|
- 5
|
176
170
|
- 3
|
177
171
|
version: 0.5.3
|
178
172
|
type: :runtime
|
179
|
-
version_requirements: *
|
173
|
+
version_requirements: *id011
|
180
174
|
- !ruby/object:Gem::Dependency
|
181
175
|
name: fssm
|
182
176
|
prerelease: false
|
183
|
-
requirement: &
|
184
|
-
none: false
|
177
|
+
requirement: &id012 !ruby/object:Gem::Requirement
|
185
178
|
requirements:
|
186
179
|
- - ~>
|
187
180
|
- !ruby/object:Gem::Version
|
188
|
-
hash: 25
|
189
181
|
segments:
|
190
182
|
- 0
|
191
183
|
- 2
|
192
184
|
- 7
|
193
185
|
version: 0.2.7
|
194
186
|
type: :runtime
|
195
|
-
version_requirements: *
|
187
|
+
version_requirements: *id012
|
196
188
|
- !ruby/object:Gem::Dependency
|
197
189
|
name: json
|
198
190
|
prerelease: false
|
199
|
-
requirement: &
|
200
|
-
none: false
|
191
|
+
requirement: &id013 !ruby/object:Gem::Requirement
|
201
192
|
requirements:
|
202
193
|
- - ~>
|
203
194
|
- !ruby/object:Gem::Version
|
204
|
-
hash: 5
|
205
195
|
segments:
|
206
196
|
- 1
|
207
197
|
- 6
|
208
198
|
- 5
|
209
199
|
version: 1.6.5
|
210
200
|
type: :runtime
|
211
|
-
version_requirements: *
|
201
|
+
version_requirements: *id013
|
202
|
+
- !ruby/object:Gem::Dependency
|
203
|
+
name: notifier
|
204
|
+
prerelease: false
|
205
|
+
requirement: &id014 !ruby/object:Gem::Requirement
|
206
|
+
requirements:
|
207
|
+
- - ~>
|
208
|
+
- !ruby/object:Gem::Version
|
209
|
+
segments:
|
210
|
+
- 0
|
211
|
+
- 1
|
212
|
+
- 4
|
213
|
+
version: 0.1.4
|
214
|
+
type: :runtime
|
215
|
+
version_requirements: *id014
|
212
216
|
description: Awestruct is a framework for creating static HTML sites.
|
213
217
|
email: bob@mcwhirter.org
|
214
218
|
executables:
|
@@ -218,6 +222,8 @@ extensions: []
|
|
218
222
|
extra_rdoc_files: []
|
219
223
|
|
220
224
|
files:
|
225
|
+
- lib/awestruct/asciidoc_file.rb
|
226
|
+
- lib/awestruct/asciidocable.rb
|
221
227
|
- lib/awestruct/commands/deploy.rb
|
222
228
|
- lib/awestruct/commands/frameworks/base_pipeline.rb
|
223
229
|
- lib/awestruct/commands/generate.rb
|
@@ -250,14 +256,17 @@ files:
|
|
250
256
|
- lib/awestruct/extensions/tag_cloud.rb
|
251
257
|
- lib/awestruct/extensions/tagger.rb
|
252
258
|
- lib/awestruct/front_matter_file.rb
|
259
|
+
- lib/awestruct/haml/filters/asciidoc.rb
|
253
260
|
- lib/awestruct/haml_file.rb
|
254
261
|
- lib/awestruct/hamlable.rb
|
255
262
|
- lib/awestruct/markdown_file.rb
|
256
263
|
- lib/awestruct/markdownable.rb
|
257
|
-
- lib/awestruct/
|
258
|
-
- lib/awestruct/
|
264
|
+
- lib/awestruct/orgmode_file.rb
|
265
|
+
- lib/awestruct/orgmodeable.rb
|
259
266
|
- lib/awestruct/renderable.rb
|
260
267
|
- lib/awestruct/renderable_file.rb
|
268
|
+
- lib/awestruct/restructuredtext_file.rb
|
269
|
+
- lib/awestruct/restructuredtextable.rb
|
261
270
|
- lib/awestruct/sass_file.rb
|
262
271
|
- lib/awestruct/sassable.rb
|
263
272
|
- lib/awestruct/scss_file.rb
|
@@ -272,10 +281,12 @@ files:
|
|
272
281
|
- lib/awestruct/commands/frameworks/960/base_layout.html.haml
|
273
282
|
- lib/awestruct/commands/frameworks/base_index.html.haml
|
274
283
|
- lib/awestruct/commands/frameworks/blueprint/base_layout.html.haml
|
284
|
+
- lib/awestruct/commands/frameworks/bootstrap/base_index.html.haml
|
285
|
+
- lib/awestruct/commands/frameworks/bootstrap/base_layout.html.haml
|
275
286
|
- lib/awestruct/extensions/sitemap.xml.haml
|
276
287
|
- lib/awestruct/extensions/tag_cloud.html.haml
|
277
288
|
- lib/awestruct/extensions/template.atom.haml
|
278
|
-
|
289
|
+
has_rdoc: true
|
279
290
|
homepage: http://awestruct.org
|
280
291
|
licenses: []
|
281
292
|
|
@@ -285,27 +296,23 @@ rdoc_options: []
|
|
285
296
|
require_paths:
|
286
297
|
- lib
|
287
298
|
required_ruby_version: !ruby/object:Gem::Requirement
|
288
|
-
none: false
|
289
299
|
requirements:
|
290
300
|
- - ">="
|
291
301
|
- !ruby/object:Gem::Version
|
292
|
-
hash: 3
|
293
302
|
segments:
|
294
303
|
- 0
|
295
304
|
version: "0"
|
296
305
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
297
|
-
none: false
|
298
306
|
requirements:
|
299
307
|
- - ">="
|
300
308
|
- !ruby/object:Gem::Version
|
301
|
-
hash: 3
|
302
309
|
segments:
|
303
310
|
- 0
|
304
311
|
version: "0"
|
305
312
|
requirements: []
|
306
313
|
|
307
314
|
rubyforge_project:
|
308
|
-
rubygems_version: 1.
|
315
|
+
rubygems_version: 1.3.6
|
309
316
|
signing_key:
|
310
317
|
specification_version: 3
|
311
318
|
summary: Static site-baking utility
|