octopress-ink 1.0.0.alpha.35 → 1.0.0.alpha.36
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/octopress-ink/assets/doc_page.rb +6 -2
- data/lib/octopress-ink/jekyll/hooks.rb +3 -0
- data/lib/octopress-ink/plugin.rb +28 -6
- data/lib/octopress-ink/plugins/asset_pipeline.rb +5 -0
- data/lib/octopress-ink/plugins.rb +22 -5
- data/lib/octopress-ink/version.rb +1 -1
- data/octopress-ink.gemspec +2 -1
- data/test/Gemfile +1 -0
- data/test/plugins/test-theme/plugin.rb +1 -0
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba0cc24dea9dd480491670843df791c946c80b03
|
4
|
+
data.tar.gz: 1ee711e4557cbb1b1fd2189f3a6865a099bd02b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47b839782bcf26f6582d72a49ba29ef59c510f0a625aa633e71ec802246b8f3ac8f954cd3b7b035e88b3cec5aa5e5234dfb0dc703eceabbe719af184455de6c0
|
7
|
+
data.tar.gz: a69ece94caf2e6eb8deabc429256e36f0bd7f4c13bfe00d086f2d154e829751e45928b96e65c0f578f80bdbfae896f6d2ba9b068f7bbecbb8162e14ee7bc30ec
|
@@ -35,14 +35,18 @@ module Octopress
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def page
|
38
|
-
@page
|
38
|
+
return @page if @page
|
39
|
+
@page = Page.new(Plugins.site, source_dir, page_dir, file, {'path'=>plugin.docs_base_path})
|
40
|
+
@page.data['layout'] = 'docs'
|
41
|
+
@page.data['plugin'] = @plugin.slug
|
42
|
+
@page.data['docs_pages'] = @plugin.doc_pages
|
43
|
+
@page
|
39
44
|
end
|
40
45
|
|
41
46
|
# Add doc page to Jekyll pages
|
42
47
|
#
|
43
48
|
def add
|
44
49
|
if Ink.config['docs_mode']
|
45
|
-
page.data['layout'] = 'docs'
|
46
50
|
Plugins.site.pages << page
|
47
51
|
end
|
48
52
|
end
|
@@ -10,6 +10,9 @@ module Jekyll
|
|
10
10
|
payload['converter'] = self.converter
|
11
11
|
payload['octopress'] = {}
|
12
12
|
payload['octopress']['version'] = Octopress::Ink.version
|
13
|
+
if Octopress::Ink.config['docs_mode']
|
14
|
+
payload['doc_pages'] = Octopress::Ink::Plugins.doc_pages
|
15
|
+
end
|
13
16
|
do_layout_orig(payload, layouts)
|
14
17
|
end
|
15
18
|
end
|
data/lib/octopress-ink/plugin.rb
CHANGED
@@ -3,12 +3,12 @@ require 'find'
|
|
3
3
|
module Octopress
|
4
4
|
module Ink
|
5
5
|
class Plugin
|
6
|
-
|
6
|
+
attr_reader :name, :type, :assets_path,
|
7
7
|
:layouts_dir, :css_dir, :javascripts_dir, :files_dir, :includes_dir, :images_dir,
|
8
8
|
:layouts, :includes, :images, :fonts, :files, :pages, :docs,
|
9
9
|
:website, :description, :version, :config
|
10
10
|
|
11
|
-
def initialize(
|
11
|
+
def initialize(slug, type)
|
12
12
|
@layouts_dir = 'layouts'
|
13
13
|
@files_dir = 'files'
|
14
14
|
@pages_dir = 'pages'
|
@@ -20,8 +20,6 @@ module Octopress
|
|
20
20
|
@css_dir = 'stylesheets'
|
21
21
|
@sass_dir = 'stylesheets'
|
22
22
|
@config_file = 'config.yml'
|
23
|
-
@name = name
|
24
|
-
@type = type
|
25
23
|
@layouts = []
|
26
24
|
@includes = []
|
27
25
|
@css = []
|
@@ -32,6 +30,9 @@ module Octopress
|
|
32
30
|
@fonts = []
|
33
31
|
@files = []
|
34
32
|
@pages = []
|
33
|
+
@type = type
|
34
|
+
@slug = slug
|
35
|
+
@name ||= slug
|
35
36
|
@version ||= false
|
36
37
|
@description ||= false
|
37
38
|
@website ||= false
|
@@ -84,12 +85,32 @@ module Octopress
|
|
84
85
|
end
|
85
86
|
|
86
87
|
def slug
|
87
|
-
@type == 'theme' ? @type : @
|
88
|
+
@type == 'theme' ? @type : @slug
|
88
89
|
end
|
89
90
|
|
90
91
|
def docs_base_path
|
91
92
|
type = @type == 'plugin' ? 'plugins' : @type
|
92
|
-
File.join('docs', type,
|
93
|
+
File.join('docs', type, slug)
|
94
|
+
end
|
95
|
+
|
96
|
+
# Docs pages for easy listing in an index
|
97
|
+
#
|
98
|
+
# returns: Array of hashes including doc page title and url
|
99
|
+
#
|
100
|
+
def doc_pages
|
101
|
+
if !@docs.empty?
|
102
|
+
@docs.clone.map do |d|
|
103
|
+
page_data = d.page.data
|
104
|
+
title = page_data['link_title'] || page_data['title']
|
105
|
+
title ||= File.basename(d.file, '.*')
|
106
|
+
path = File.join(docs_base_path, d.file)
|
107
|
+
|
108
|
+
{
|
109
|
+
'title' => title,
|
110
|
+
'path' => path
|
111
|
+
}
|
112
|
+
end
|
113
|
+
end
|
93
114
|
end
|
94
115
|
|
95
116
|
def can_disable
|
@@ -138,6 +159,7 @@ module Octopress
|
|
138
159
|
name += " - v#{@version}" if @version
|
139
160
|
name = name
|
140
161
|
message = name
|
162
|
+
message += "\nSlug: #{slug}"
|
141
163
|
|
142
164
|
if @description
|
143
165
|
message += "\n#{@description}"
|
@@ -17,13 +17,13 @@ module Octopress
|
|
17
17
|
plugins.size
|
18
18
|
end
|
19
19
|
|
20
|
-
def self.plugin(
|
21
|
-
if
|
20
|
+
def self.plugin(slug)
|
21
|
+
if slug == 'theme'
|
22
22
|
@theme
|
23
23
|
else
|
24
|
-
found = plugins.reject { |p| p.
|
24
|
+
found = plugins.reject { |p| p.slug != slug }
|
25
25
|
if found.empty?
|
26
|
-
raise IOError.new "No Theme or Plugin with the
|
26
|
+
raise IOError.new "No Theme or Plugin with the slug '#{slug}' was found."
|
27
27
|
end
|
28
28
|
found.first
|
29
29
|
end
|
@@ -84,7 +84,7 @@ module Octopress
|
|
84
84
|
|
85
85
|
plugins.each do |p|
|
86
86
|
unless p == @theme
|
87
|
-
@config['plugins'][p.
|
87
|
+
@config['plugins'][p.slug] = p.config
|
88
88
|
end
|
89
89
|
end
|
90
90
|
|
@@ -92,6 +92,23 @@ module Octopress
|
|
92
92
|
end
|
93
93
|
end
|
94
94
|
|
95
|
+
# Docs pages for each plugin
|
96
|
+
#
|
97
|
+
# returns: Array of plugin doc pages
|
98
|
+
#
|
99
|
+
def self.doc_pages
|
100
|
+
plugins.clone.map { |p|
|
101
|
+
if pages = p.doc_pages
|
102
|
+
{
|
103
|
+
"name" => p.name,
|
104
|
+
"pages" => pages
|
105
|
+
}
|
106
|
+
else
|
107
|
+
nil
|
108
|
+
end
|
109
|
+
}.compact
|
110
|
+
end
|
111
|
+
|
95
112
|
def self.include(name, file)
|
96
113
|
p = plugin(name)
|
97
114
|
p.include(file)
|
data/octopress-ink.gemspec
CHANGED
@@ -19,8 +19,9 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_runtime_dependency "jekyll", "~> 1.4.3"
|
22
|
-
spec.add_runtime_dependency "sass", "~> 3.
|
22
|
+
spec.add_runtime_dependency "sass", "~> 3.3.0"
|
23
23
|
|
24
|
+
spec.add_development_dependency "octopress", "~> 1.0.0.alpha.8"
|
24
25
|
spec.add_development_dependency "bundler", "~> 1.3"
|
25
26
|
spec.add_development_dependency "rake"
|
26
27
|
spec.add_development_dependency "pry-debugger"
|
data/test/Gemfile
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octopress-ink
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.alpha.
|
4
|
+
version: 1.0.0.alpha.36
|
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-03-
|
11
|
+
date: 2014-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -30,14 +30,28 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.
|
33
|
+
version: 3.3.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 3.
|
40
|
+
version: 3.3.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: octopress
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 1.0.0.alpha.8
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.0.0.alpha.8
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: bundler
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|