jupyter_to_scrapbox 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -5
- data/jupyter_to_scrapbox.gemspec +3 -3
- data/lib/jupyter_to_scrapbox/version.rb +1 -1
- data/lib/jupyter_to_scrapbox.rb +4 -6
- metadata +4 -7
- data/exe/.DS_Store +0 -0
- data/lib/.DS_Store +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ff45bd5cb4be74deb64b811c66c141b219f242f
|
4
|
+
data.tar.gz: 76d386b0bd4f176b8bcc325dd88178784379e70b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1adc76f20790d244bff425f5d73693cbc9714f4097c7b6a7c24e927e125df90d638843cc0a39aada7c6953f27088654519e231dc2a1300c0bf67aa0fb805752c
|
7
|
+
data.tar.gz: b836e0222848683b28b4b53f09dc26237c4106c1ab86df01ab654e2915c03518d7f1e15b76a95b811320d954f1179437829b5174c2ec191588aec6453e7909e4
|
data/README.md
CHANGED
@@ -8,11 +8,13 @@ This tool converts jupyter notebook file to json file suitable for import to scr
|
|
8
8
|
|
9
9
|
TODO: Delete this and the text above, and describe your gem
|
10
10
|
|
11
|
-
Warning : do not believe the instruction below.
|
11
|
+
Warning : under condtruction. do not believe the instruction below.
|
12
12
|
|
13
13
|
## Installation
|
14
14
|
|
15
|
-
|
15
|
+
This tool, written in Ruby, is distributed via rubygem.
|
16
|
+
|
17
|
+
From command line, invoke gem install command:
|
16
18
|
|
17
19
|
```ruby
|
18
20
|
gem install jupyter_to_scrapbox
|
@@ -20,13 +22,18 @@ gem install jupyter_to_scrapbox
|
|
20
22
|
|
21
23
|
## Usage
|
22
24
|
|
25
|
+
The input file is jupyter notebook (file extension = .ipynb)
|
26
|
+
|
27
|
+
Invoke this tool by:
|
23
28
|
|
24
|
-
|
29
|
+
```ruby
|
30
|
+
$ bundle exec jupyter_to_scrapbox convert FILE > scrapbox.json
|
31
|
+
```
|
25
32
|
|
26
|
-
|
33
|
+
To import `scrapbox.json` to scrapbox, follow the instruction of "import pages" tool of "scrapbox" at the url:
|
27
34
|
https://scrapbox.io/help/インポート・エクスポートする
|
28
35
|
|
29
|
-
Specify
|
36
|
+
Specify `scrapbox.json` created by this tool.
|
30
37
|
|
31
38
|
## Development
|
32
39
|
|
data/jupyter_to_scrapbox.gemspec
CHANGED
@@ -9,9 +9,9 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Hiroharu Sugawara"]
|
10
10
|
spec.email = ["hsugawa@tmu.ac.jp"]
|
11
11
|
|
12
|
-
spec.summary = %q{convert jupyter-notebook to scrapbox-ready-json}
|
13
|
-
spec.description = %q{convert jupyter-notebook to scrapbox-import-json}
|
14
|
-
spec.homepage = %q{
|
12
|
+
spec.summary = %q{convert jupyter-notebook to scrapbox-import-ready-json}
|
13
|
+
spec.description = %q{convert jupyter-notebook to scrapbox-import-ready-json}
|
14
|
+
spec.homepage = %q{https://github.com/hsugawa8651/jupyter_to_scrapbox_gem}
|
15
15
|
spec.licenses = [ "MIT" ]
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
data/lib/jupyter_to_scrapbox.rb
CHANGED
@@ -9,6 +9,8 @@ module JupyterToScrapbox
|
|
9
9
|
@ipynb_path=File.expand_path(path)
|
10
10
|
@sb_json=[]
|
11
11
|
@verbose=false
|
12
|
+
@display_input_numbers=false
|
13
|
+
@prefix_comment="#"
|
12
14
|
end
|
13
15
|
|
14
16
|
def set_verbose()
|
@@ -28,7 +30,6 @@ module JupyterToScrapbox
|
|
28
30
|
end
|
29
31
|
|
30
32
|
def push_text(s)
|
31
|
-
# @sb_json << s
|
32
33
|
s.split("\n").each do |s1|
|
33
34
|
@sb_json << s1
|
34
35
|
end
|
@@ -39,7 +40,6 @@ module JupyterToScrapbox
|
|
39
40
|
end
|
40
41
|
|
41
42
|
def push_code(s)
|
42
|
-
# @sb_json << "\t"+s
|
43
43
|
s.split("\n").each do |s1|
|
44
44
|
@sb_json << "\t"+s1
|
45
45
|
end
|
@@ -68,7 +68,7 @@ module JupyterToScrapbox
|
|
68
68
|
vputs "-- source"
|
69
69
|
vputs code["source"]
|
70
70
|
push_text("code:source.jl")
|
71
|
-
if @
|
71
|
+
if @display_input_numbers
|
72
72
|
count=code["execution_count"]
|
73
73
|
push_code("#{@prefix_comment} In[#{count}]")
|
74
74
|
end
|
@@ -135,7 +135,7 @@ module JupyterToScrapbox
|
|
135
135
|
vp @file_extension
|
136
136
|
|
137
137
|
if %r!\.(jl|py|rb)!i =~ @file_extension
|
138
|
-
@
|
138
|
+
@display_input_numbers=true
|
139
139
|
@prefix_comment="#"
|
140
140
|
end
|
141
141
|
|
@@ -145,8 +145,6 @@ module JupyterToScrapbox
|
|
145
145
|
end
|
146
146
|
|
147
147
|
def start()
|
148
|
-
vputs "this is a pen"
|
149
|
-
vputs "Hello "+@ipynb_path
|
150
148
|
parse_ipynb()
|
151
149
|
|
152
150
|
my_title=File.basename(@ipynb_path,".ipynb")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jupyter_to_scrapbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hiroharu Sugawara
|
@@ -52,11 +52,10 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
-
description: convert jupyter-notebook to scrapbox-import-json
|
55
|
+
description: convert jupyter-notebook to scrapbox-import-ready-json
|
56
56
|
email:
|
57
57
|
- hsugawa@tmu.ac.jp
|
58
58
|
executables:
|
59
|
-
- ".DS_Store"
|
60
59
|
- jupyter_to_scrapbox
|
61
60
|
extensions: []
|
62
61
|
extra_rdoc_files: []
|
@@ -68,13 +67,11 @@ files:
|
|
68
67
|
- Rakefile
|
69
68
|
- bin/console
|
70
69
|
- bin/setup
|
71
|
-
- exe/.DS_Store
|
72
70
|
- exe/jupyter_to_scrapbox
|
73
71
|
- jupyter_to_scrapbox.gemspec
|
74
|
-
- lib/.DS_Store
|
75
72
|
- lib/jupyter_to_scrapbox.rb
|
76
73
|
- lib/jupyter_to_scrapbox/version.rb
|
77
|
-
homepage:
|
74
|
+
homepage: https://github.com/hsugawa8651/jupyter_to_scrapbox_gem
|
78
75
|
licenses:
|
79
76
|
- MIT
|
80
77
|
metadata: {}
|
@@ -97,5 +94,5 @@ rubyforge_project:
|
|
97
94
|
rubygems_version: 2.6.12
|
98
95
|
signing_key:
|
99
96
|
specification_version: 4
|
100
|
-
summary: convert jupyter-notebook to scrapbox-ready-json
|
97
|
+
summary: convert jupyter-notebook to scrapbox-import-ready-json
|
101
98
|
test_files: []
|
data/exe/.DS_Store
DELETED
Binary file
|
data/lib/.DS_Store
DELETED
Binary file
|