atlas2ipynb 0.0.1 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTg5MzhiYWI1NzVjODhiNzgyZjQ4OTY2NDc0NjA0ZjM5YTY5ZTJkNg==
4
+ MmU1NzIxZDgzMTRlODUyNDc4MjMwMmRlNjc1YjgxYjBhNjA2ZjA2Ng==
5
5
  data.tar.gz: !binary |-
6
- Y2U5MTJhNmMwNTE3NTM0ZmRkZDlhMzhhMjg2NzMzOGRmZDA5NTJmMg==
6
+ ZjAyYTU0ZDdkNjYyZWNmMzU2ZWQ2ZWE1YjVkMjhlMGY3OGFiZTc5Mw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- N2VmMjBmYzA2OTNhZjhiNDdkMjliN2E5OTljMGU3NzMyNDUwNDJiNjMxMmRi
10
- ZTEzNWNkNzk5MTFmY2I2YzY0NWQ4OTZhNDYyZTg1NjQ0ODlkNTRmY2ZhMDFi
11
- ODg3ZTBjYjA1Nzg2NDE4Yjg1NDFmZWEzZWMyYWY3ODRiZDIzOWE=
9
+ ZmJkMzJkOTc3ZmRkZWNmZWYyOTI5OGQ2M2ZiYjNjNzlhYWRhMDI2MjZiOThh
10
+ Y2IxZGY0NjE5ODhjZGUxNmYzOTYyZWE3NTUwNjFlM2RmN2JhMDgzOWM1OGI1
11
+ NzU0NmU3ZDI5MDVhY2EwZDdiNjhiNTllN2FkYmZlZDI1OGMyYjE=
12
12
  data.tar.gz: !binary |-
13
- ZjA2YTMwNjU4ODU4NGYzN2IxNTY5OTkxMzM5YjFiYmFhNWRhNjRiZWRmOGQ2
14
- YzA1MzhhZTM2MDZhMTY1NDUzMTBlNmFmMmViMjQyZjRmMjQ4MDIwNWNjZjY2
15
- NDBjNzE2MjkxZTdlOTIzZTMxNzBlNjY0YmY5ZjVhNTVlYTY1Yjg=
13
+ ZDk1YTY1YmY1YzZhM2RlY2MyYTEwYTg4ZDI5NmYwYTU4Njk3MjdlODA5N2Zm
14
+ NzAxODY1NmI5OWFiMTY4ZDRmMzVkMTRmMDAzZjg2NjI1NDY0N2NkYzQyNmYx
15
+ ZjBjNzAwOTRhOWQ5NmNmNWNkYTFmYzFiYjMxOGVkZjllODFjMjY=
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Atlas2ipynb
2
2
 
3
- TODO: Write a gem description
3
+ This gem converts the HTML files from Atlas into iPython Notebooks.
4
4
 
5
5
  ## Installation
6
6
 
@@ -18,7 +18,17 @@ Or install it yourself as:
18
18
 
19
19
  ## Usage
20
20
 
21
- TODO: Write usage instructions here
21
+ Here's what you need to do:
22
+
23
+ * Write your project in http://atlas.oreilly.com[Atlas]
24
+ * Get a working HTML build
25
+ * Download and unzip the build
26
+ * Run "atlas2ipynb" in the directory where you downloaded the files
27
+ * Start the iPytnon notebook server
28
+
29
+ ## TODO:
30
+
31
+ * Integrate the atlas-api gem so that you can also build, download, unzip, and convert directly from the command line
22
32
 
23
33
  ## Contributing
24
34
 
data/atlas2ipynb.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "atlas2ipynb"
7
- spec.version = "0.0.1"
7
+ spec.version = "0.0.3"
8
8
  spec.authors = ["Andrew Odewahn"]
9
9
  spec.email = ["odewahn@oreilly.com"]
10
10
  spec.summary = %q{Converts Atlas HTML build into iPythyon Notebooks.}
@@ -20,9 +20,9 @@ Gem::Specification.new do |spec|
20
20
  spec.add_development_dependency "bundler", "~> 1.5"
21
21
  spec.add_development_dependency "rake"
22
22
 
23
- spec.add_dependency "nokogiri", "~> 1.6"
24
- spec.add_dependency "json", "~> 1.8"
25
- spec.add_dependency "active_support", '~> 3.0', '>= 3.0.0'
23
+ spec.add_dependency "nokogiri"
24
+ spec.add_dependency "json"
25
+ spec.add_dependency "active_support"
26
26
  spec.add_dependency "i18n"
27
27
 
28
28
  end
data/lib/atlas2ipynb.rb CHANGED
@@ -4,8 +4,8 @@ require 'i18n'
4
4
  require 'active_support/inflector'
5
5
 
6
6
  # If running in irb, don't forget to do this:
7
- # require 'bundler'
8
- # Bundler.require
7
+ # require 'bundler'
8
+ # Bundler.require
9
9
  #
10
10
  module Atlas2ipynb
11
11
 
@@ -44,8 +44,8 @@ module Atlas2ipynb
44
44
  def process_section(n, level, out)
45
45
  n.children.each do |c|
46
46
  case c.name
47
- when "section"
48
- process_section(c, level+1, out) # since a section is just a container, we need to recurse to get the content
47
+ when "section", "span", "div"
48
+ process_section(c, level+1, out) # since ipynb is flat, we need to recurse on sections
49
49
  when "h1", "h2", "h3", "h4", "h4", "h5", "h6"
50
50
  out << {
51
51
  "cell_type" => "heading",
@@ -53,7 +53,7 @@ module Atlas2ipynb
53
53
  "metadata" => {},
54
54
  "source" => c.text
55
55
  }
56
- when "pre","code"
56
+ when "pre", "code"
57
57
  out << {
58
58
  "cell_type" => "code",
59
59
  "collapsed" => false,
@@ -119,7 +119,7 @@ module Atlas2ipynb
119
119
  # Convert all chapter files in the directory into ipynb
120
120
  #*************************************************************************************
121
121
  def convert!
122
- puts "Searching for ch*.html files from Atlas"
122
+ puts "Searching for ch*.html files from Atlas yeah"
123
123
  Dir["ch*.html"].each do |fn|
124
124
  out = html_to_ipynb(fn)
125
125
  # Compute the new filename, which is the original filename
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atlas2ipynb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Odewahn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-31 00:00:00.000000000 Z
11
+ date: 2014-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -42,50 +42,44 @@ dependencies:
42
42
  name: nokogiri
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - ! '>='
46
46
  - !ruby/object:Gem::Version
47
- version: '1.6'
47
+ version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - ! '>='
53
53
  - !ruby/object:Gem::Version
54
- version: '1.6'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: json
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
- version: '1.8'
61
+ version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - ! '>='
67
67
  - !ruby/object:Gem::Version
68
- version: '1.8'
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: active_support
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
74
- - !ruby/object:Gem::Version
75
- version: '3.0'
76
73
  - - ! '>='
77
74
  - !ruby/object:Gem::Version
78
- version: 3.0.0
75
+ version: '0'
79
76
  type: :runtime
80
77
  prerelease: false
81
78
  version_requirements: !ruby/object:Gem::Requirement
82
79
  requirements:
83
- - - ~>
84
- - !ruby/object:Gem::Version
85
- version: '3.0'
86
80
  - - ! '>='
87
81
  - !ruby/object:Gem::Version
88
- version: 3.0.0
82
+ version: '0'
89
83
  - !ruby/object:Gem::Dependency
90
84
  name: i18n
91
85
  requirement: !ruby/object:Gem::Requirement