jekyll-jupyter-notebook 0.0.4 → 0.0.5

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
  SHA256:
3
- metadata.gz: 425f800ab9b773e9a5af9360ba2715ca339d576fe1719deafdb3a328aa6c8ac8
4
- data.tar.gz: 1f2cd269d33799891f4f79c547d785cb9e571f9a4b01cfcd18a115ce18bfd4f9
3
+ metadata.gz: 6c466c7ee83b97759654b140f971cf5767b326f81bfed119c01fdf8d02bb2af8
4
+ data.tar.gz: 33243d1e14cb04552dc2ec8351403deee428ab25a529de95e943903b65eddd1a
5
5
  SHA512:
6
- metadata.gz: dc9f20a00e845900a7f1e10eee2d9b23a92c9842f8e0838581be05552b72a7fe54bb9e1ddd94152428c90f3522d5fbc267887bef5dd3e8b9b4e084a395e93454
7
- data.tar.gz: '074847bc947f0a7ed68d4ee9e1add0259dc7785adef09e712a3f7d0587c058fb2b516bed6bd06cbcf347fc1c0fac83ea40b440f669765757789b3abc2820b2ca'
6
+ metadata.gz: d5b9a7c0f95059b609eea6e9389b4dc9b231de0e87dd384a9f0f219a165ae6d7e18beba5df8fb46813e860f94793e6b5d4f65aa3b39c4704a427c92eefe9433d
7
+ data.tar.gz: b2eef64b0124162eaf4608a50502d1ae005042b8c38f38e9e70336fad47c44dc9b7758a5314326a3712bff44c299422f9d9cfd9289f1f180ca5bfc599e770191
data/doc/text/news.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # News
2
2
 
3
+ ## 0.0.5 - 2022-08-20
4
+
5
+ ### Improvements
6
+
7
+ * Added support for collection.
8
+ [GitHub#8][Reported by Jeremy Lloyd Conlin]
9
+
10
+ ### Thanks
11
+
12
+ * Jeremy Lloyd Conlin
13
+
3
14
  ## 0.0.4 - 2018-08-08
4
15
 
5
16
  ### Improvements
@@ -11,26 +11,48 @@
11
11
  # limitations under the License.
12
12
 
13
13
  module JekyllJupyterNotebook
14
- module IFramePage
14
+ module IFramable
15
15
  def output_ext
16
- ext + super
16
+ extname + super
17
17
  end
18
18
  end
19
19
 
20
20
  class Generator < Jekyll::Generator
21
21
  def generate(site)
22
+ generate_site_static_files(site)
23
+ site.collections.each_value do |collection|
24
+ generate_collection_filtered_entries(collection)
25
+ end
26
+ end
27
+
28
+ private
29
+ def generate_site_static_files(site)
22
30
  site.static_files.reject! do |static_file|
23
- if static_file.extname == ".ipynb"
24
- base = static_file.instance_variable_get(:@base)
25
- dir = static_file.instance_variable_get(:@dir)
26
- name = static_file.name
27
- page = Jekyll::Page.new(site, base, dir, name)
28
- page.extend(IFramePage)
29
- site.pages << page
30
- true
31
- else
32
- false
33
- end
31
+ next false unless static_file.extname == ".ipynb"
32
+
33
+ base = static_file.instance_variable_get(:@base)
34
+ dir = static_file.instance_variable_get(:@dir)
35
+ name = static_file.name
36
+ page = Jekyll::Page.new(site, base, dir, name)
37
+ page.extend(IFramable)
38
+ site.pages << page
39
+ true
40
+ end
41
+ end
42
+
43
+ def generate_collection_filtered_entries(collection)
44
+ collection.filtered_entries.reject! do |file_path|
45
+ full_path = collection.collection_dir(file_path)
46
+ next false unless File.extname(file_path) == ".ipynb"
47
+ next false if Jekyll::Utils.has_yaml_header?(full_path)
48
+
49
+ document = Jekyll::Document.new(full_path,
50
+ site: collection.site,
51
+ collection: collection)
52
+ document.extend(IFramable)
53
+ document.read
54
+ collection.docs << document
55
+ true
34
56
  end
35
57
  end
36
58
  end
@@ -11,5 +11,5 @@
11
11
  # limitations under the License.
12
12
 
13
13
  module JekyllJupyterNotebook
14
- VERSION = "0.0.4"
14
+ VERSION = "0.0.5"
15
15
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-jupyter-notebook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-08 00:00:00.000000000 Z
11
+ date: 2022-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -132,8 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
132
  - !ruby/object:Gem::Version
133
133
  version: '0'
134
134
  requirements: []
135
- rubyforge_project:
136
- rubygems_version: 3.0.0.beta1
135
+ rubygems_version: 3.4.0.dev
137
136
  signing_key:
138
137
  specification_version: 4
139
138
  summary: Jekyll Jupyter Notebook plugin adds [Jupyter](http://jupyter.org/) Notebook