atlas2ipynb 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NjYyYjMwOWM0MzI3YzRjN2ZlZTQyY2U5NzVhMmIzNjBjYWNjMmEzNA==
4
+ NjI3YzYzNTI3Nzg2OThmZGViZTRhMWM0MzQxOTJkMGUxNTIxNTlhOA==
5
5
  data.tar.gz: !binary |-
6
- Y2JlNjJlNmQ5ODJkMzNjZGUxODQ5YjlmMDRkZWNmNWI1NDM5ZmVkYQ==
6
+ ZDNiNThiZGQ1MmY2ODE3MzMxZjU5MDI0NzEzNTAxMzcwMmU1NDhiMQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NzEzMjBlZWQ1NjFmNmEwNmQxMzEzYWQyYTUzODliNmVkNjlmZjg1NmJhNDJj
10
- NGVhMWY4N2EzYWNiMWUzM2MxZGM1NGI3NzBiNTZlODk1OWI2MTQ3NTQ2NDUy
11
- ZWIwNWFlNzc4YzY1YzRmY2FiYzc2YWU5ZDQwMzg5Yjg1YTVlNDg=
9
+ ZjM4NmNiYjI2MzhiZmQxN2Q4ZGZkOGUzZTY2MTdhNDZiMGU3NTgwZTViMmY5
10
+ YjYzNzc5MTdjOTJjZWY4YTc5MTE5YjM2MGU4ZDA0MTA4OTg2ZDcyYWY5YjJl
11
+ N2RkMzVjOTg2MjgxYTVlZjM5MDY3ZDY1ZjViMzhiM2JhYWU5YjM=
12
12
  data.tar.gz: !binary |-
13
- Njg3OWRiNGU0MWI4YTMwYTIyMDAzYzg0MzJmMjNiZTFkMDU0MWM2NTM1ZmUw
14
- OGQxYmE0NzViYjgzN2E4NzM3ZDk3MTNmMDNjODIzMTcxYjk2MWEyMGJhNWUw
15
- MjNjYTJiNjgyZWYyM2E1M2MyMGM1NTkzNTllMTg4NTgyYTdmMGQ=
13
+ MjM0ZWQzNTdkYzIxMDgwNWMzNGViYTFhMmM2OTY2MGJkNWI1NmI2MjMxODNm
14
+ M2FkMjU3MWVlNTVjYmNhNDUzNmEwMjJlZjBjMGQ1N2U5OTA1ZTQ2MTQ3MTNm
15
+ OGIyNThkYTk3ZmExMzFlNDNkMjUxMjViM2U3MmE1YzI4Zjk4NTk=
@@ -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.8"
7
+ spec.version = "0.0.9"
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.}
@@ -57,11 +57,8 @@ end
57
57
  @last_response.status.each do |format|
58
58
  puts "Downloading #{project}"
59
59
  `curl #{format.download_url} > #{fn}.zip`
60
- `unzip #{fn}.zip -d #{fn}`
61
- Dir.chdir("#{Dir.pwd}/#{fn}"){
62
- converter = Atlas2ipynb::Converter.new
63
- converter.convert!
64
- }
60
+ `unzip #{fn}.zip`
61
+ converter = Atlas2ipynb::Converter.new
65
62
  end
66
63
 
67
64
  puts "\nAssuming things when ok, you can view the notebook by:"
@@ -54,11 +54,18 @@ module Atlas2ipynb
54
54
  "source" => c.text
55
55
  }
56
56
  when "pre", "code"
57
+ # test for the code type. If it's not python, then insert the
58
+ # appropriate cell magics
59
+ listing = c.text
60
+ code_type = c.attributes["data-code-language"] || "python"
61
+ if code_type != "python"
62
+ listing = "%%#{code_type}\n#{listing}"
63
+ end
57
64
  out << {
58
65
  "cell_type" => "code",
59
66
  "collapsed" => false,
60
- "input" => c.text,
61
- "language" => c.attributes["data-code-language"] || "python",
67
+ "input" => listing,
68
+ "language" => code_type,
62
69
  "metadata" => {},
63
70
  "outputs" => []
64
71
  }
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.8
4
+ version: 0.0.9
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-04-02 00:00:00.000000000 Z
11
+ date: 2014-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler