mkbok 0.0.3 → 0.0.4

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.
Files changed (3) hide show
  1. data/bin/mkbok +22 -12
  2. data/lib/mkbok_version.rb +1 -1
  3. metadata +1 -1
data/bin/mkbok CHANGED
@@ -63,7 +63,8 @@ end
63
63
 
64
64
  option_parser.parse!
65
65
 
66
- $here = File.expand_path(File.dirname(__FILE__))
66
+ #$here = File.expand_path(File.dirname(__FILE__))
67
+ $here = Dir.getwd
67
68
  $root = File.join($here)
68
69
  $outDir = File.join($root, 'pdf')
69
70
  options[:name] = File.basename(Dir.getwd) unless options[:name]
@@ -199,7 +200,7 @@ unless missing.empty?
199
200
  exit
200
201
  end
201
202
 
202
- puts "Will generate pdf for the following languages:"
203
+ puts "Will generate pdf for the following languages using template #{options[:template]}:"
203
204
  puts " #{languages}"
204
205
  puts
205
206
 
@@ -208,44 +209,53 @@ figures do
208
209
  config = $config['default'].merge($config[lang]) rescue $config['default']
209
210
 
210
211
  puts "#{lang}:"
211
- prefacemarkdown = Dir["#$root/#{lang}/0preface/*.markdown"].sort.map do |file|
212
+ puts "\tParsing preface markdown... "
213
+ prefacemarkdown = Dir["#$root/#{lang}/*preface/*.markdown"].sort.map do |file|
214
+ puts "\t =>"+file
212
215
  File.read(file)
213
216
  end.join("\n\n")
214
217
 
215
- print "\tParsing preface markdown... "
216
218
  preface = IO.popen('pandoc -p --no-wrap -f markdown -t latex', 'w+') do |pipe|
217
219
  pipe.write(pre_pandoc(prefacemarkdown, config))
218
220
  pipe.close_write
219
221
  post_pandoc(pipe.read, config, lang, false)
220
222
  end
221
223
 
224
+ puts "\n\tParsing main chapters markdown... "
225
+ found = false
222
226
  chaptersmarkdown = Dir["#$root/#{lang}/*chapters/*.markdown"].sort.map do |file|
227
+ found = true
228
+ puts "\t =>"+file
223
229
  File.read(file)
224
230
  end.join("\n\n")
225
- puts "done"
231
+ chaptersmarkdown = Dir["#$root/#{lang}/*/*.markdown"].sort.map do |file|
232
+ puts "\t =>"+file
233
+ File.read(file)
234
+ end.join("\n\n") unless found
235
+ # puts "done"
226
236
 
227
- print "\tParsing main chapters markdown... "
228
- chapters = IO.popen('pandoc -p --no-wrap -f markdown -t latex', 'w+') do |pipe|
237
+ latex = IO.popen('pandoc -p --no-wrap -f markdown -t latex', 'w+') do |pipe|
229
238
  pipe.write(pre_pandoc(chaptersmarkdown, config))
230
239
  pipe.close_write
231
240
  post_pandoc(pipe.read, config, lang)
232
241
  end
233
- puts "done"
242
+ # puts "done"
234
243
 
244
+ puts "\n\tParsing appendix markdown... "
235
245
  appendixmarkdown = Dir["#$root/#{lang}/*appendix/*.markdown"].sort.map do |file|
246
+ puts "\t =>"+file
236
247
  File.read(file)
237
248
  end.join("\n\n")
238
249
 
239
- print "\tParsing appendix markdown... "
240
250
  appendix = IO.popen('pandoc -p --no-wrap -f markdown -t latex', 'w+') do |pipe|
241
251
  pipe.write(pre_pandoc(appendixmarkdown, config))
242
252
  pipe.close_write
243
253
  post_pandoc(pipe.read, config, lang)
244
254
  end
245
- puts "done"
255
+ #puts "done"
246
256
 
247
- print "\tCreating main.tex for #{lang}... "
248
- dir = "#$root/latex/#{lang}"
257
+ print "\n\tCreating main.tex for #{lang}... "
258
+ dir = "latex/#{lang}"
249
259
  mkdir_p(dir)
250
260
 
251
261
  File.open("#{dir}/main.tex", 'w') do |file|
data/lib/mkbok_version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module MkBok
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mkbok
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: