orgmode-cli-tools 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- # TODO add CLI flags to toggle:
3
+ # TODO add CLI flags to toggle: ?
4
4
  # t, --include-toc
5
5
  # s, --include-section-numbering
6
6
  # h N, --headline-levels=N
@@ -15,6 +15,7 @@ def elisp_code(src_dir)
15
15
  (require 'org-publish)
16
16
  (require 'htmlize)
17
17
 
18
+ (setq c-standard-font-lock-fontify-region-function 'font-lock-default-fontify-region)
18
19
  (setq org-export-htmlize-output-type 'css)
19
20
 
20
21
  (org-publish '("org2html" :base-directory "#{src_dir}"
@@ -103,6 +103,7 @@ def convert(orgfile_path)
103
103
  title = "" # TODO derive title from filename and|or org contents
104
104
  puts `org2html #{orgfile_path}`
105
105
  htmlfile_path = orgfile_path.gsub(".org", ".html")
106
+ htmldir_name = orgfile_path.gsub(".org", "")
106
107
  body = body(htmlfile_path)
107
108
  body = transform_divs_into_sections(body)
108
109
  body = slide_layout(title, body)
@@ -110,9 +111,10 @@ def convert(orgfile_path)
110
111
  # TODO use path of this file to find dir of template dir where gem is actually located
111
112
 
112
113
  gem_root_path = File.expand_path(File.dirname(__FILE__))+"/.."
113
- `cp -r #{gem_root_path}/templates/reveal_js_template generated_slides`
114
- File.open("generated_slides/index.html", 'w') { |file| file.write(body) }
114
+ `cp -r #{gem_root_path}/templates/reveal_js_template #{htmldir_name}_generated_slides`
115
+ File.open("#{htmldir_name}_generated_slides/index.html", 'w') { |file| file.write(body) }
115
116
  `rm #{htmlfile_path}`
117
+ return htmldir_name
116
118
  end
117
119
 
118
120
  if ARGV.length != 1
@@ -120,4 +122,7 @@ if ARGV.length != 1
120
122
  exit 1
121
123
  end
122
124
 
123
- convert(ARGV[0])
125
+ htmldir_name = convert(ARGV[0])
126
+
127
+ puts "\n\nSlides generated here:"
128
+ puts "#{htmldir_name}_generated_slides/index.html\n\n"
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  module OrgmodeCliTools
3
3
 
4
- VERSION = "0.3.0"
4
+ VERSION = "0.4.0"
5
5
 
6
6
  end
metadata CHANGED
@@ -1,24 +1,25 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orgmode-cli-tools
3
3
  version: !ruby/object:Gem::Version
4
+ version: 0.4.0
4
5
  prerelease:
5
- version: 0.3.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Thomas Kjeldahl Nilsson
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-05 00:00:00.000000000 Z
12
+ date: 2013-11-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- type: :runtime
15
+ name: nokogiri
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
21
  version: '0'
22
+ type: :runtime
22
23
  prerelease: false
23
24
  version_requirements: !ruby/object:Gem::Requirement
24
25
  none: false
@@ -26,15 +27,15 @@ dependencies:
26
27
  - - ! '>='
27
28
  - !ruby/object:Gem::Version
28
29
  version: '0'
29
- name: nokogiri
30
30
  - !ruby/object:Gem::Dependency
31
- type: :development
31
+ name: minitest
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  none: false
34
34
  requirements:
35
35
  - - ! '>='
36
36
  - !ruby/object:Gem::Version
37
37
  version: '0'
38
+ type: :development
38
39
  prerelease: false
39
40
  version_requirements: !ruby/object:Gem::Requirement
40
41
  none: false
@@ -42,15 +43,15 @@ dependencies:
42
43
  - - ! '>='
43
44
  - !ruby/object:Gem::Version
44
45
  version: '0'
45
- name: minitest
46
46
  - !ruby/object:Gem::Dependency
47
- type: :development
47
+ name: shoulda
48
48
  requirement: !ruby/object:Gem::Requirement
49
49
  none: false
50
50
  requirements:
51
51
  - - ! '>='
52
52
  - !ruby/object:Gem::Version
53
53
  version: '0'
54
+ type: :development
54
55
  prerelease: false
55
56
  version_requirements: !ruby/object:Gem::Requirement
56
57
  none: false
@@ -58,15 +59,15 @@ dependencies:
58
59
  - - ! '>='
59
60
  - !ruby/object:Gem::Version
60
61
  version: '0'
61
- name: shoulda
62
62
  - !ruby/object:Gem::Dependency
63
- type: :development
63
+ name: shoulda-context
64
64
  requirement: !ruby/object:Gem::Requirement
65
65
  none: false
66
66
  requirements:
67
67
  - - ! '>='
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
+ type: :development
70
71
  prerelease: false
71
72
  version_requirements: !ruby/object:Gem::Requirement
72
73
  none: false
@@ -74,7 +75,6 @@ dependencies:
74
75
  - - ! '>='
75
76
  - !ruby/object:Gem::Version
76
77
  version: '0'
77
- name: shoulda-context
78
78
  description: CLI convenience tools for Org Mode files
79
79
  email:
80
80
  - thomas@kjeldahlnilsson.net
@@ -143,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
143
  version: '0'
144
144
  requirements: []
145
145
  rubyforge_project: orgmode-cli-tools
146
- rubygems_version: 1.8.24
146
+ rubygems_version: 1.8.25
147
147
  signing_key:
148
148
  specification_version: 3
149
149
  summary: CLI convenience tools for Org Mode files