livetext 0.9.04 → 0.9.05

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
  SHA256:
3
- metadata.gz: 953abc29d2faf2ff8d8ae5e1c7e4033efbc1dbd57b69144634b3287b71424b77
4
- data.tar.gz: 3086f96e6226ada9787338b26d08950667e44b65029e5bc5d80bc4c72b50b7bb
3
+ metadata.gz: 20018f4ffc0706839f4d17412fd107ed9525b6c0958d29fa3e52dd4be8e6eb36
4
+ data.tar.gz: f3805cf9788faf459c3abd3b5145d16d806802e641d432a4d0045180115a8ea1
5
5
  SHA512:
6
- metadata.gz: d8a49669fc15a3a5aad4151cf190f8d527edc1349fb30a7abfdf9141648f32bbb56d507a6f7ccfc983c9335d7f2df037a9dbf30325e27c02e1d68590ffb1c2bd
7
- data.tar.gz: 9e4c56a912009b7332fd9702c1fd7a8a27fdbb9c639d0ae62ec4adabd31e8e70554a7ab4645ba6595a138712c0dfcb47430805d69530f26e5d9479dd90148b38
6
+ metadata.gz: 559f0f7ef52b6b09d47c20577b2febd3ccfdd125d647deb91b71947b5ce9531fa12156889c2f58ea7cad88666aa332eb91cafd58a071fcd2380e88e2e7482274
7
+ data.tar.gz: 5f658b46c63d9fdc5b4786ff9f5b9be9cf2bb85e2c2215348b65f0e717af65fc20e8351dea7168765e9149c3f6c0c5ec5c632e20cd90fac4da9bc6d5974eb319
@@ -1,5 +1,5 @@
1
1
  class Livetext
2
- VERSION = "0.9.04"
2
+ VERSION = "0.9.05"
3
3
  Path = File.expand_path(File.join(File.dirname(__FILE__)))
4
4
  end
5
5
 
@@ -19,7 +19,7 @@ module Livetext::UserAPI
19
19
  end
20
20
 
21
21
  def _args
22
- @_args = @_data.chomp.split
22
+ @_args = _format(@_data).chomp.split
23
23
  if block_given?
24
24
  @_args.each {|arg| yield arg }
25
25
  else
@@ -12,6 +12,7 @@ def credit
12
12
  end
13
13
 
14
14
  def h1; _out "<h1>#{@_data}</h1>"; end
15
+ def h2; _out "<h2>#{@_data}</h2>"; end
15
16
  def h3; _out "<h3>#{@_data}</h3>"; end
16
17
 
17
18
  def list
@@ -118,11 +119,11 @@ def sec
118
119
  @sec += 1
119
120
  @sec2 = 0
120
121
  @section = "#@chapter.#@sec"
121
- # _errout("section #@section")
122
- @toc << "#{_nbsp(3)}<b>#@section</b> #@_data<br>"
122
+ title = @_data.dup
123
+ @toc << "#{_nbsp(3)}<b>#@section</b> #{title}<br>"
123
124
  @_data = _slug(@_data)
124
125
  next_output
125
- _out "<h3>#@section #{@_data}</h3>\n"
126
+ _out "<h3>#@section #{title}</h3>\n"
126
127
  rescue => err
127
128
  STDERR.puts "#{err}\n#{err.backtrace}"
128
129
  exit
@@ -131,11 +132,33 @@ end
131
132
  def subsec
132
133
  @sec2 += 1
133
134
  @subsec = "#@chapter.#@sec.#@sec2"
134
- @toc << "#{_nbsp(6)}<b>#@subsec</b> #@_data<br>"
135
- # _errout("section #@subsec")
135
+ title = @_data.dup
136
+ @toc << "#{_nbsp(6)}<b>#@subsec</b> #{title}<br>"
136
137
  @_data = _slug(@_data)
137
138
  next_output
138
- _out "<h3>#@subsec #{@_data}</h3>\n"
139
+ _out "<h3>#@subsec #{title}</h3>\n"
140
+ end
141
+
142
+ def definition_table
143
+ title = @_data
144
+ wide = "95"
145
+ delim = " :: "
146
+ _out "<br><center><table width=#{wide}% cellpadding=5>"
147
+ lines = _body(true)
148
+ lines.map! {|line| _format(line) }
149
+
150
+ lines.each do |line|
151
+ cells = line.split(delim)
152
+ _out "<tr>"
153
+ cells.each.with_index do |cell, i|
154
+ width = (i == 0) ? "width=15%" : ""
155
+ _out " <td #{width} valign=top>#{cell}</td>"
156
+ end
157
+ _out "</tr>"
158
+ end
159
+ _out "</table></center><br><br>"
160
+
161
+ _optional_blank_line
139
162
  end
140
163
 
141
164
  def table2
@@ -204,7 +227,7 @@ def table
204
227
  cells = line.split(delim)
205
228
  wide = cells.map {|x| x.length }
206
229
  maxw = [0] * cells.size
207
- maxw = maxw.map.with_index {|x, i| [x, wide[i]].max }
230
+ maxw = maxw.map.with_index {|x, i| [x, wide[i]+2].max }
208
231
  end
209
232
 
210
233
  sum = maxw.inject(0, :+)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: livetext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.04
4
+ version: 0.9.05
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-03 00:00:00.000000000 Z
11
+ date: 2020-03-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A smart text processor extensible in Ruby
14
14
  email: rubyhacker@gmail.com