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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 768fa9c52f22622c7612a91b2b7361a9f6b00e6e
4
- data.tar.gz: e35a3eaab4d06c86ba3e114e08c240e593700047
3
+ metadata.gz: ba0cc24dea9dd480491670843df791c946c80b03
4
+ data.tar.gz: 1ee711e4557cbb1b1fd2189f3a6865a099bd02b1
5
5
  SHA512:
6
- metadata.gz: e07ec4b06d2b6ee24f78c7913d6b2a8aac6f62b9c0f50b83fa09362781fcad8e192e9e0bf51c4af28e4ae06bb37a16ebf251b584caa2978020f65b17046c6760
7
- data.tar.gz: 54358f50230a19b846dfa0185045e6edf37fa67f720dc86924ce621424600764b3d77c9ee814300fab2604cea8db08325625b016f2392553bc58171a21449142
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 ||= Page.new(Plugins.site, source_dir, page_dir, file, {'path'=>plugin.docs_base_path})
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
@@ -3,12 +3,12 @@ require 'find'
3
3
  module Octopress
4
4
  module Ink
5
5
  class Plugin
6
- attr_accessor :name, :type, :assets_path,
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(name, type)
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 : @name
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, @name)
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}"
@@ -5,6 +5,11 @@ module Octopress
5
5
  module Ink
6
6
  class AssetPipelinePlugin < Plugin
7
7
 
8
+ def initialize(slug, type)
9
+ @name = "Octopress Assset Pipeline"
10
+ super
11
+ end
12
+
8
13
  def register_assets
9
14
 
10
15
  local_stylesheets.each {|f| add_stylesheet(f) }
@@ -17,13 +17,13 @@ module Octopress
17
17
  plugins.size
18
18
  end
19
19
 
20
- def self.plugin(name)
21
- if name == 'theme'
20
+ def self.plugin(slug)
21
+ if slug == 'theme'
22
22
  @theme
23
23
  else
24
- found = plugins.reject { |p| p.name != name }
24
+ found = plugins.reject { |p| p.slug != slug }
25
25
  if found.empty?
26
- raise IOError.new "No Theme or Plugin with the name '#{name}' was found."
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.name] = p.config
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)
@@ -1,5 +1,5 @@
1
1
  module Octopress
2
2
  module Ink
3
- VERSION = "1.0.0.alpha.35"
3
+ VERSION = "1.0.0.alpha.36"
4
4
  end
5
5
  end
@@ -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.2.0"
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
@@ -2,3 +2,4 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem "octopress-ink", path: "../"
4
4
  gem "pry-debugger"
5
+ #gem "octopress", path: "../../cli"
@@ -4,6 +4,7 @@ class TestTheme < Octopress::Ink::Plugin
4
4
  def initialize(name, type)
5
5
  @assets_path = File.expand_path(File.join(File.dirname(__FILE__)))
6
6
  @description = "Test theme y'all"
7
+ @name = "Classic Theme"
7
8
  super
8
9
  end
9
10
  def add_assets
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.35
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-08 00:00:00.000000000 Z
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.2.0
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.2.0
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