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 +4 -4
- data/doc/text/news.md +11 -0
- data/lib/jekyll-jupyter-notebook/generator.rb +35 -13
- data/lib/jekyll-jupyter-notebook/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c466c7ee83b97759654b140f971cf5767b326f81bfed119c01fdf8d02bb2af8
|
4
|
+
data.tar.gz: 33243d1e14cb04552dc2ec8351403deee428ab25a529de95e943903b65eddd1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5b9a7c0f95059b609eea6e9389b4dc9b231de0e87dd384a9f0f219a165ae6d7e18beba5df8fb46813e860f94793e6b5d4f65aa3b39c4704a427c92eefe9433d
|
7
|
+
data.tar.gz: b2eef64b0124162eaf4608a50502d1ae005042b8c38f38e9e70336fad47c44dc9b7758a5314326a3712bff44c299422f9d9cfd9289f1f180ca5bfc599e770191
|
data/doc/text/news.md
CHANGED
@@ -11,26 +11,48 @@
|
|
11
11
|
# limitations under the License.
|
12
12
|
|
13
13
|
module JekyllJupyterNotebook
|
14
|
-
module
|
14
|
+
module IFramable
|
15
15
|
def output_ext
|
16
|
-
|
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
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
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
|
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
|
+
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:
|
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
|
-
|
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
|