livetext 0.8.31 → 0.8.32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1ee6ee1d590a7359564a5fc3f189dcdff2df06b9
4
- data.tar.gz: 9ddf33c92e84c1f86c693e507d0fe3dc59dd9646
3
+ metadata.gz: 3b44756af395f11daf846eab2e16442463ac8e68
4
+ data.tar.gz: a6e7b003814945f84e813bb20d619ff3700b5cfd
5
5
  SHA512:
6
- metadata.gz: 03682316cf60d6863bdad5fe502e5fbb2e3c6be2e3eb472d04b5f376a56a0397f62af5fd6102d7f8488aef2a50d1bb50940001c742999da73fb4a7c1f0e11702
7
- data.tar.gz: b3664f3bfc92519419f68b0cab472cc9e91ae90f1567cb1aaf40c23a83589308a0984054936c4ac26c89adf6b888dceaf302965fd6b88dcce5208574d011430b
6
+ metadata.gz: bf8a6f59b30bdd36ea5406587c7055a65a32b852235fc36cc65e00f732edd9944a2438212780c037f4224c5c1ba74a75c60f788403cb873fbed1b60c80fb7856
7
+ data.tar.gz: d19ed8a6ef7d97e7791c12cb80858093bbcb5a5611967508acbc783e3e93ddaebb0707392a8cd36cf1d87984ae6d5b1030afd9f040dbebf975e0ba620cc9c979
data/lib/livetext.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  class Livetext
2
- VERSION = "0.8.31"
2
+ VERSION = "0.8.32"
3
3
  end
4
4
 
5
5
  $Livetext = Livetext
data/lib/standard.rb CHANGED
@@ -296,4 +296,38 @@ module Livetext::Standard
296
296
  _puts "<a href='#{url}'>#{text}</a>"
297
297
  end
298
298
 
299
+ def xtable # Borrowed from bookish - FIXME
300
+ # @table_num ||= 0
301
+ # @table_num += 1
302
+ title = @_data
303
+ delim = " :: "
304
+ _puts "<br><center><table border=1 width=90% cellpadding=5>"
305
+ lines = _body(true)
306
+ maxw = nil
307
+ sep = "\030"
308
+ lines.each do |line|
309
+ _formatting(line)
310
+ line.gsub!("\n", sep)
311
+ cells = line.split(delim)
312
+ wide = cells.map {|x| x.length }
313
+ maxw = [0] * cells.size
314
+ maxw = maxw.map.with_index {|x, i| [x, wide[i]].max }
315
+ end
316
+
317
+ sum = maxw.inject(0, :+)
318
+ maxw.map! {|x| (x/sum*100).floor }
319
+
320
+ lines.each do |line|
321
+ cells = line.split(delim)
322
+ _puts "<tr>"
323
+ cell.gsub!(sep, "\n")
324
+ cells.each.with_index {|cell, i| ; _puts " <td>#{cell}</td>" }
325
+ _puts "</tr>"
326
+ end
327
+ _puts "</table>"
328
+ # @toc << "#{_nbsp(8)}<b>Table #@chapter.#@table_num</b> #{title}<br>"
329
+ # _next_output(_slug("table_#{title}"))
330
+ # _puts "<b>Table #@chapter.#@table_num &nbsp;&nbsp; #{title}</b></center><br>"
331
+ end
332
+
299
333
  end
@@ -24,7 +24,7 @@ some
24
24
  random text.
25
25
  .end
26
26
 
27
- .table Just another table
27
+ .xtable Just another table
28
28
  $r1c1 :: $r1c2
29
29
  $r2c1 :: $r2c2
30
30
  .end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: livetext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.31
4
+ version: 0.8.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton