viewworkbook 0.2 → 0.3

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,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4ea17c22ed36a2ee8c245622927a8aaa61b9f3b728ad8187d1ba7b12f9ee96ce
4
- data.tar.gz: ed2fed97be3c121166774666db444c4f5012e1c669087e22bb45e656c3d7f5dc
3
+ metadata.gz: a4943afe2b6aa8ae15fbe68bd2fa19a7414db859dbaf929bba1a1edcbea1ebf6
4
+ data.tar.gz: ce9062cfe21a227155394e571061a346ca789c9412dd4da9e6e20d78a0aac150
5
5
  SHA512:
6
- metadata.gz: a5a5120bd2585eda4981751ca381250eba81efac51e8238da37fb0c60820c3c466da5af6fc97d8d65a9f249647f64c53c1d18727cef93fa778dc50683ea496c7
7
- data.tar.gz: ad2f49b95c35e2d05e3ee5fa1f4954de464286abcefc213ce04c59d910b333ebe66be6e1ddf6cbf518ab0fc5a58a0d6ac2fd25fe1fba35875d130b15b0a31676
6
+ metadata.gz: 7a09911027db613cbf2b9e2a5d411164a9e45a2197d4420558e3ff646f41f14c78f07b054d1789efebb3ea3fc51c1930857c584bf8ab4bf6de23605d4c713335
7
+ data.tar.gz: 1ca1daf23662c17da9824a8751a5b47e7687f51bbdcc2d2df7ff3a3beb33a4a4d602b372117e34379e590f1ff8c727ae6086d88bb26672e0c2770249e41c9979
@@ -1,361 +1,64 @@
1
- <?xml version="1.0" encoding="utf-8" ?>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
2
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
3
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
4
  <head>
5
5
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
- <meta name="generator" content="Docutils 0.13.1: http://docutils.sourceforge.net/" />
6
+ <meta name="generator" content="Docutils 0.21.2: https://docutils.sourceforge.io/" />
7
7
  <title>Viewworkbook</title>
8
8
  <style type="text/css">
9
9
 
10
10
  /*
11
- :Author: David Goodger (goodger@python.org)
12
- :Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
13
- :Copyright: This stylesheet has been placed in the public domain.
11
+ :Author: Michael Uplawski
12
+ :Contact: michael.uplawski@uplawski.eu
13
+ :License: WTFPL 2.0, see http://www.wtfpl.net/about/
14
14
 
15
- Default cascading style sheet for the HTML output of Docutils.
16
-
17
- See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
18
- customize this style sheet.
19
- */
20
-
21
- /* used to remove borders from tables and images */
22
- .borderless, table.borderless td, table.borderless th {
23
- border: 0 }
24
-
25
- table.borderless td, table.borderless th {
26
- /* Override padding for "table.docutils td" with "! important".
27
- The right padding separates the table cells. */
28
- padding: 0 0.5em 0 0 ! important }
29
-
30
- .first {
31
- /* Override more specific margin styles with "! important". */
32
- margin-top: 0 ! important }
33
-
34
- .last, .with-subtitle {
35
- margin-bottom: 0 ! important }
36
-
37
- .hidden {
38
- display: none }
39
-
40
- .subscript {
41
- vertical-align: sub;
42
- font-size: smaller }
43
-
44
- .superscript {
45
- vertical-align: super;
46
- font-size: smaller }
47
-
48
- a.toc-backref {
49
- text-decoration: none ;
50
- color: black }
51
-
52
- blockquote.epigraph {
53
- margin: 2em 5em ; }
54
-
55
- dl.docutils dd {
56
- margin-bottom: 0.5em }
57
-
58
- object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
59
- overflow: hidden;
60
- }
61
-
62
- /* Uncomment (and remove this text!) to get bold-faced definition list terms
63
- dl.docutils dt {
64
- font-weight: bold }
65
- */
66
-
67
- div.abstract {
68
- margin: 2em 5em }
69
-
70
- div.abstract p.topic-title {
71
- font-weight: bold ;
72
- text-align: center }
73
-
74
- div.admonition, div.attention, div.caution, div.danger, div.error,
75
- div.hint, div.important, div.note, div.tip, div.warning {
76
- margin: 2em ;
77
- border: medium outset ;
78
- padding: 1em }
79
-
80
- div.admonition p.admonition-title, div.hint p.admonition-title,
81
- div.important p.admonition-title, div.note p.admonition-title,
82
- div.tip p.admonition-title {
83
- font-weight: bold ;
84
- font-family: sans-serif }
85
-
86
- div.attention p.admonition-title, div.caution p.admonition-title,
87
- div.danger p.admonition-title, div.error p.admonition-title,
88
- div.warning p.admonition-title, .code .error {
89
- color: red ;
90
- font-weight: bold ;
91
- font-family: sans-serif }
92
-
93
- /* Uncomment (and remove this text!) to get reduced vertical space in
94
- compound paragraphs.
95
- div.compound .compound-first, div.compound .compound-middle {
96
- margin-bottom: 0.5em }
97
-
98
- div.compound .compound-last, div.compound .compound-middle {
99
- margin-top: 0.5em }
15
+ Stylesheet for use with Docutils.
100
16
  */
101
17
 
102
- div.dedication {
103
- margin: 2em 5em ;
104
- text-align: center ;
105
- font-style: italic }
106
-
107
- div.dedication p.topic-title {
108
- font-weight: bold ;
109
- font-style: normal }
110
-
111
- div.figure {
112
- margin-left: 2em ;
113
- margin-right: 2em }
114
-
115
- div.footer, div.header {
116
- clear: both;
117
- font-size: smaller }
118
-
119
- div.line-block {
120
- display: block ;
121
- margin-top: 1em ;
122
- margin-bottom: 1em }
123
-
124
- div.line-block div.line-block {
125
- margin-top: 0 ;
126
- margin-bottom: 0 ;
127
- margin-left: 1.5em }
128
-
129
- div.sidebar {
130
- margin: 0 0 0.5em 1em ;
131
- border: medium outset ;
132
- padding: 1em ;
133
- background-color: #ffffee ;
134
- width: 40% ;
135
- float: right ;
136
- clear: right }
137
-
138
- div.sidebar p.rubric {
139
- font-family: sans-serif ;
140
- font-size: medium }
141
-
142
- div.system-messages {
143
- margin: 5em }
144
-
145
- div.system-messages h1 {
146
- color: red }
18
+ /* The defaults for docutils */
19
+ @import url(html4css1.css);
147
20
 
148
- div.system-message {
149
- border: medium outset ;
150
- padding: 1em }
151
-
152
- div.system-message p.system-message-title {
153
- color: red ;
154
- font-weight: bold }
155
-
156
- div.topic {
157
- margin: 2em }
158
-
159
- h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
160
- h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
161
- margin-top: 0.4em }
162
-
163
- h1.title {
164
- text-align: center }
165
-
166
- h2.subtitle {
167
- text-align: center }
168
-
169
- hr.docutils {
170
- width: 75% }
171
-
172
- img.align-left, .figure.align-left, object.align-left, table.align-left {
173
- clear: left ;
174
- float: left ;
175
- margin-right: 1em }
176
-
177
- img.align-right, .figure.align-right, object.align-right, table.align-right {
178
- clear: right ;
179
- float: right ;
180
- margin-left: 1em }
181
-
182
- img.align-center, .figure.align-center, object.align-center {
183
- display: block;
184
- margin-left: auto;
185
- margin-right: auto;
21
+ body {
22
+ background-color:#300020;
23
+ font-family: Verdana,Helvetica,Univers;
24
+ color:#f0f0f0;
25
+ color:#f0f0f0;
186
26
  }
187
27
 
188
- table.align-center {
189
- margin-left: auto;
190
- margin-right: auto;
28
+ h1 {color:cyan;font-size:1.5em;}
29
+ h1.title {color:#a0a0f0;font-size:2em;}
30
+ h2 {color:#ffffa0;}
31
+
32
+ p, ul.simple, ol.simple, dt {margin-left:2em;}
33
+ p.first {font-weight:bold;}
34
+ dd {margin-left:4em;}
35
+ td {color:#f0f080;}
36
+
37
+ /* correct left margin of nested block tags*/
38
+ dd {}
39
+ dd p, li p {margin-left:0;}
40
+ dd * ul {margin-left:0 ! important; }
41
+ dd ul {margin-left:0 ! important; }
42
+ dd dl dt, dd dl dd {margin-left:0 ! important;}
43
+ dt {font-weight:bold;}
44
+ dt, dd {color:#f0f0f0}
45
+
46
+ tt.docutils {color:#000080;
47
+ background-color:#a080a0;
48
+ padding-left:3px;
49
+ padding-right:3px;
50
+ white-space:nowrap;
191
51
  }
192
52
 
193
- .align-left {
194
- text-align: left }
195
-
196
- .align-center {
197
- clear: both ;
198
- text-align: center }
53
+ a.external {color:#ff90ff;}
199
54
 
200
- .align-right {
201
- text-align: right }
202
-
203
- /* reset inner alignment in figures */
204
- div.align-right {
205
- text-align: inherit }
206
-
207
- /* div.align-center * { */
208
- /* text-align: left } */
209
-
210
- .align-top {
211
- vertical-align: top }
212
-
213
- .align-middle {
214
- vertical-align: middle }
215
-
216
- .align-bottom {
217
- vertical-align: bottom }
218
-
219
- ol.simple, ul.simple {
220
- margin-bottom: 1em }
221
-
222
- ol.arabic {
223
- list-style: decimal }
224
-
225
- ol.loweralpha {
226
- list-style: lower-alpha }
227
-
228
- ol.upperalpha {
229
- list-style: upper-alpha }
230
-
231
- ol.lowerroman {
232
- list-style: lower-roman }
233
-
234
- ol.upperroman {
235
- list-style: upper-roman }
236
-
237
- p.attribution {
238
- text-align: right ;
239
- margin-left: 50% }
240
-
241
- p.caption {
242
- font-style: italic }
243
-
244
- p.credits {
245
- font-style: italic ;
246
- font-size: smaller }
247
-
248
- p.label {
249
- white-space: nowrap }
250
-
251
- p.rubric {
252
- font-weight: bold ;
253
- font-size: larger ;
254
- color: maroon ;
255
- text-align: center }
256
-
257
- p.sidebar-title {
258
- font-family: sans-serif ;
259
- font-weight: bold ;
260
- font-size: larger }
261
-
262
- p.sidebar-subtitle {
263
- font-family: sans-serif ;
264
- font-weight: bold }
265
-
266
- p.topic-title {
267
- font-weight: bold }
268
-
269
- pre.address {
270
- margin-bottom: 0 ;
271
- margin-top: 0 ;
272
- font: inherit }
273
-
274
- pre.literal-block, pre.doctest-block, pre.math, pre.code {
275
- margin-left: 2em ;
276
- margin-right: 2em }
277
-
278
- pre.code .ln { color: grey; } /* line numbers */
279
- pre.code, code { background-color: #eeeeee }
280
- pre.code .comment, code .comment { color: #5C6576 }
281
- pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
282
- pre.code .literal.string, code .literal.string { color: #0C5404 }
283
- pre.code .name.builtin, code .name.builtin { color: #352B84 }
284
- pre.code .deleted, code .deleted { background-color: #DEB0A1}
285
- pre.code .inserted, code .inserted { background-color: #A3D289}
286
-
287
- span.classifier {
288
- font-family: sans-serif ;
289
- font-style: oblique }
290
-
291
- span.classifier-delimiter {
292
- font-family: sans-serif ;
293
- font-weight: bold }
294
-
295
- span.interpreted {
296
- font-family: sans-serif }
297
-
298
- span.option {
299
- white-space: nowrap }
300
-
301
- span.pre {
302
- white-space: pre }
303
-
304
- span.problematic {
305
- color: red }
306
-
307
- span.section-subtitle {
308
- /* font-size relative to parent (h1..h6 element) */
309
- font-size: 80% }
310
-
311
- table.citation {
312
- border-left: solid 1px gray;
313
- margin-left: 1px }
314
-
315
- table.docinfo {
316
- margin: 2em 4em }
317
-
318
- table.docutils {
319
- margin-top: 0.5em ;
320
- margin-bottom: 0.5em }
321
-
322
- table.footnote {
323
- border-left: solid 1px black;
324
- margin-left: 1px }
325
-
326
- table.docutils td, table.docutils th,
327
- table.docinfo td, table.docinfo th {
328
- padding-left: 0.5em ;
329
- padding-right: 0.5em ;
330
- vertical-align: top }
331
-
332
- table.docutils th.field-name, table.docinfo th.docinfo-name {
333
- font-weight: bold ;
334
- text-align: left ;
335
- white-space: nowrap ;
336
- padding-left: 0 }
337
-
338
- /* "booktabs" style (no vertical lines) */
339
- table.docutils.booktabs {
340
- border: 0px;
341
- border-top: 2px solid;
342
- border-bottom: 2px solid;
343
- border-collapse: collapse;
55
+ blockquote {background-color:#400020;
56
+ padding:0.5em;
57
+ border-radius:1em;
58
+ border-style:dotted;
59
+ border-width:0.5pt;
344
60
  }
345
- table.docutils.booktabs * {
346
- border: 0px;
347
- }
348
- table.docutils.booktabs th {
349
- border-bottom: thin solid;
350
- text-align: left;
351
- }
352
-
353
- h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
354
- h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
355
- font-size: 100% }
356
61
 
357
- ul.auto-toc {
358
- list-style-type: none }
359
62
 
360
63
  </style>
361
64
  </head>
@@ -370,26 +73,32 @@ ul.auto-toc {
370
73
  </div>
371
74
  <div class="section" id="description">
372
75
  <h1>DESCRIPTION</h1>
373
- <p>Viewworkbook lets you read spreadsheet-files in text-mode, in a terminal
374
- window. It reproduces the tables which are contained in a spreadsheet file and
76
+ <p>ViewWorkbook allows you to read spreadsheet files in text mode in a terminal
77
+ window. It reproduces the tables contained in a spreadsheet file and It also
375
78
  lets you navigate through the sheets. The visible part of a sheet is limited
376
- laterally and horizontally by the terminal-size but can be scrolled. You can
377
- adapt the width of table-columns, to render the table more readable and
378
- finally, if you wish, save tables to a text-file. To the author of the
379
- program, the utility serves to take a quick glance at spreadsheets that are
380
- received via email, in the Mutt mail-client, which is itself a terminal
79
+ laterally and horizontally by the size of the terminal, but you can scroll
80
+ through it. You can adapt the width of table columns to make the table more
81
+ readable. Finally, you can save tables to a text file if you wish. For the
82
+ author of the program, the utility serves to quickly glance at spreadsheets
83
+ that are received via email in the Mutt mail client, which is a terminal
381
84
  application.</p>
382
- <p>The supported spreadsheet formats are those which are handled by the Ruby-gem
383
- &quot;<strong>roo</strong>&quot; (February 2017):</p>
85
+ <p>Supported spreadsheet formats are those handled by the Ruby gem &quot;<strong>roo</strong>&quot;
86
+ (2024, roo 2.10.1):</p>
87
+ <ul class="simple">
88
+ <li>Microsoft™ Excel 2007 - 2013 formats (<strong>xlsx</strong>, <strong>xlsm</strong>)</li>
89
+ <li>LibreOffice / OpenOffice.org formats (<strong>ods</strong>)</li>
90
+ <li>CSV</li>
91
+ <li>Microsoft™ Excel 97, Excel 2002 XML, and Excel 2003 XML formats (<strong>xls</strong>,
92
+ <strong>xml</strong>)</li>
93
+ </ul>
94
+ <p>Additionally also</p>
384
95
  <ul class="simple">
385
- <li>Microsoft's <strong>xls</strong> and <strong>xlsx</strong>,</li>
386
- <li>the OpenDocument spreadsheet <strong>ods</strong></li>
387
- <li>and the SoftMaker™ spreadsheet formats <strong>pmd</strong> and <strong>pmdx</strong>.</li>
96
+ <li>The SoftMakerspreadsheet formats <strong>pmd</strong> and <strong>pmdx</strong>.</li>
388
97
  </ul>
389
98
  </div>
390
99
  <div class="section" id="options">
391
100
  <h1>Options</h1>
392
- <p>Other than the path to the spreadsheet file, viewworkbook does currently not
101
+ <p>Other than the path to the spreadsheet file, viewworkbook does not currently
393
102
  interpret any command line arguments.</p>
394
103
  <div class="section" id="menu-commands">
395
104
  <h2>Menu commands</h2>
@@ -448,40 +157,41 @@ below the current table:</p>
448
157
  </tbody>
449
158
  </table>
450
159
  <p><strong>value (v) * save to file (f) * sheet (s) * column (c) * up(i) * down(k) * left(j) * right(l) * quit (q) *</strong></p>
451
- <p>When you enter one of the hotkeys, a command can be executed directly (like &quot;q&quot;
452
- to terminate the program), a sub-menu may be shown (like with &quot;c&quot; which shall
453
- give you control on column properties) or you are confronted with an input
454
- invitation (like with &quot;v&quot;, where you have to enter a cell-reference). Read on
455
- for an explanation of each menu command.</p>
160
+ <p>When you press one of the hotkeys, you can execute a command directly (like &quot;q&quot;
161
+ to terminate the program) or a submenu may appear (like with &quot;c&quot; which gives
162
+ you control over column properties) or you may be prompted for input (like with
163
+ &quot;v&quot;, where you have to enter a cell reference). Read on for an explanation of
164
+ each menu command.</p>
456
165
  <blockquote>
457
166
  <dl class="docutils">
458
167
  <dt>value (v)</dt>
459
168
  <dd>display the value from a cell. This is useful, when columns are not wide
460
- enough to show complete values. After entering &quot;<strong>v</strong>&quot;, you are
169
+ enough to show the full value. After entering &quot;<strong>v</strong>&quot;, you are
461
170
  immediately invited to enter a cell reference. Cells are referenced in
462
- the format &quot;Column:Row&quot;, e.g. D:12 for the cell in column &quot;D&quot; and row
171
+ the format &quot;column:row&quot;, e.g. D:12 for the cell in column &quot;D&quot; and row
463
172
  &quot;12&quot;.</dd>
464
173
  <dt>save to file (f)</dt>
465
- <dd>Save the current or all tables to a text file. The command does initially
466
- show two alternative sub-commands:</dd>
174
+ <dd>Save the current table or all tables to a text file. Initially, the command
175
+ shows two alternative sub-commands:</dd>
467
176
  <dt>Current sheet (c) * all sheets (a)</dt>
468
- <dd>Independently of your choice, in the next step you will have to enter the
469
- path to the output file. You will be warned, if the file already exists
470
- and may choose to either overwrite the existing file or name a different
471
- one.</dd>
177
+ <dd>Regardless of your choice, you will be prompted to enter the output file
178
+ path in the next step. You will receive a warning, if the file already
179
+ exists at which point you can choose to either overwrite the existing file
180
+ or give it a different name.</dd>
472
181
  <dt>sheet (s)</dt>
473
- <dd>Navigate to a different sheet in the current workbook. You may choose
474
- between a sheet-number and the name of a sheet. If you want to indicate
475
- the next sheet <strong>by name</strong>, the list of all available names is first
476
- shown. You just type right away the one that you want.</dd>
182
+ <dd>Navigate to a different sheet whthin the current workbook. You can choose
183
+ a sheet by its number or by its name. If you want to select the next sheet
184
+ <strong>by name</strong>, a list of available names will first be shown. You just type
185
+ the name you want.</dd>
477
186
  <dt>column (c)</dt>
478
- <dd>Alter the properties of the table-columns. At the time of this writing
479
- (February 2017) the only property that can be changed, is the width of all
480
- columns. When you enter &quot;<strong>c</strong>&quot; the subcommand column width (w) is shown.
481
- After entering &quot;<strong>w</strong>&quot; you can enter the desired width in characters.</dd>
187
+ <dd>Alter the properties of the table columns. As of February 2017 the only
188
+ property that can be changed, is the width of all columns. When you enter
189
+ &quot;<strong>c</strong>&quot; the subcommand column width (w) is shown. After entering &quot;<strong>w</strong>&quot;
190
+ you can enter the desired width in characters.</dd>
482
191
  <dt>Arrows(i, j, k, l)</dt>
483
- <dd>Navigate in a sheet that is too big to be displayed entirely at once.
484
- These hotkeys correspond to the default navigation keys in the vi editor.</dd>
192
+ <dd>Use these hotkeys to navigate a sheet that is too big to be displayed
193
+ entirely at once. These hotkeys correspond to the default navigation keys
194
+ in the Vi editor.</dd>
485
195
  <dt>quit (q)</dt>
486
196
  <dd>Enter &quot;<strong>q</strong>&quot; to quit the program at any moment except when an input
487
197
  invitation is shown.</dd>
@@ -489,9 +199,9 @@ invitation is shown.</dd>
489
199
  </blockquote>
490
200
  </div>
491
201
  <div class="section" id="hidden-menu-commands">
492
- <h2>Hidden (menu-)commands</h2>
493
- <p>There is currently only one such command available:
494
- The <strong>Escape-key</strong> will interrupt an unfinished action and refresh the display.</p>
202
+ <h2>Hidden menu commands</h2>
203
+ <p>Currently, there is only one such command available. Pressing the <strong>Escape
204
+ key</strong> will interrupt an unfinished action and refresh the display.</p>
495
205
  </div>
496
206
  </div>
497
207
  <div class="section" id="other-information">
@@ -499,18 +209,18 @@ The <strong>Escape-key</strong> will interrupt an unfinished action and refresh
499
209
  <blockquote>
500
210
  <dl class="docutils">
501
211
  <dt>Development and source code</dt>
502
- <dd>Viewworkbook has been written in Ruby. As Ruby is an interpreted programming
503
- language, the executable file and all those that it may refer to at one
504
- point in time, are themselves the source-files of the current
505
- program-version. You can open them in any text-editor to scrutinize the
506
- source-code. If you have received the program as a Ruby-gem, you can also
507
- decompress a copy of the gem-file with <strong>tar -x</strong>, then <strong>tar -xzf</strong>.</dd>
212
+ <dd>Viewworkbook has been written in Ruby. Since Ruby is an interpreted programming
213
+ language, the executable file and all files to which it refers at any given time
214
+ are the source files of the current program version. You can open these
215
+ files in any text editor to examine the source code. If you have received
216
+ the program as a Ruby-gem, you can also decompress a copy of the gem-file
217
+ with <strong>tar -x</strong>, then <strong>tar -xzf</strong>.</dd>
508
218
  <dt>Bugs</dt>
509
- <dd>Negative values are not always displayed, when very long (like 15 ciphers).
510
- Enlarging the column-width further does not have an effect.</dd>
219
+ <dd>Negative values are not always displayed, when they are very long (like 15
220
+ ciphers). Increasing the column width further does not help.</dd>
511
221
  <dt>License</dt>
512
- <dd>Viewworkbook is distributed under the conditions of the GNU General Public
513
- License, version 3.</dd>
222
+ <dd>Viewworkbook is distributed under the conditions of the WTFPL 2.0 or later,
223
+ see <a class="reference external" href="http://www.wtfpl.net/about/">http://www.wtfpl.net/about/</a> for details</dd>
514
224
  <dt>Author</dt>
515
225
  <dd>Viewworkbook has been developed by Michael Uplawski
516
226
  &lt;<a class="reference external" href="mailto:michael.uplawski&#64;uplawski.eu">michael.uplawski&#64;uplawski.eu</a>&gt;</dd>
Binary file
@@ -11,28 +11,35 @@ viewworkbook <spreadsheet>
11
11
 
12
12
  DESCRIPTION
13
13
  =============
14
- Viewworkbook lets you read spreadsheet-files in text-mode, in a terminal
15
- window. It reproduces the tables which are contained in a spreadsheet file and
14
+ ViewWorkbook allows you to read spreadsheet files in text mode in a terminal
15
+ window. It reproduces the tables contained in a spreadsheet file and It also
16
16
  lets you navigate through the sheets. The visible part of a sheet is limited
17
- laterally and horizontally by the terminal-size but can be scrolled. You can
18
- adapt the width of table-columns, to render the table more readable and
19
- finally, if you wish, save tables to a text-file. To the author of the
20
- program, the utility serves to take a quick glance at spreadsheets that are
21
- received via email, in the Mutt mail-client, which is itself a terminal
17
+ laterally and horizontally by the size of the terminal, but you can scroll
18
+ through it. You can adapt the width of table columns to make the table more
19
+ readable. Finally, you can save tables to a text file if you wish. For the
20
+ author of the program, the utility serves to quickly glance at spreadsheets
21
+ that are received via email in the Mutt mail client, which is a terminal
22
22
  application.
23
23
 
24
- The supported spreadsheet formats are those which are handled by the Ruby-gem
25
- "**roo**" (February 2017):
24
+ Supported spreadsheet formats are those handled by the Ruby gem "**roo**"
25
+ (2024, roo 2.10.1):
26
26
 
27
- - Microsoft™'s **xls** and **xlsx**,
27
+ - Microsoft™ Excel 2007 - 2013 formats (**xlsx**, **xlsm**)
28
28
 
29
- - the OpenDocument spreadsheet **ods**
29
+ - LibreOffice / OpenOffice.org formats (**ods**)
30
30
 
31
- - and the SoftMaker™ spreadsheet formats **pmd** and **pmdx**.
31
+ - CSV
32
+
33
+ - Microsoft™ Excel 97, Excel 2002 XML, and Excel 2003 XML formats (**xls**,
34
+ **xml**)
35
+
36
+ Additionally also
37
+
38
+ - The SoftMaker™ spreadsheet formats **pmd** and **pmdx**.
32
39
 
33
40
  Options
34
41
  =============
35
- Other than the path to the spreadsheet file, viewworkbook does currently not
42
+ Other than the path to the spreadsheet file, viewworkbook does not currently
36
43
  interpret any command line arguments.
37
44
 
38
45
  Menu commands
@@ -52,72 +59,73 @@ below the current table:
52
59
 
53
60
  **value (v) * save to file (f) * sheet (s) * column (c) * up(i) * down(k) * left(j) * right(l) * quit (q) ***
54
61
 
55
- When you enter one of the hotkeys, a command can be executed directly (like "q"
56
- to terminate the program), a sub-menu may be shown (like with "c" which shall
57
- give you control on column properties) or you are confronted with an input
58
- invitation (like with "v", where you have to enter a cell-reference). Read on
59
- for an explanation of each menu command.
62
+ When you press one of the hotkeys, you can execute a command directly (like "q"
63
+ to terminate the program) or a submenu may appear (like with "c" which gives
64
+ you control over column properties) or you may be prompted for input (like with
65
+ "v", where you have to enter a cell reference). Read on for an explanation of
66
+ each menu command.
60
67
 
61
68
  value (v)
62
69
  display the value from a cell. This is useful, when columns are not wide
63
- enough to show complete values. After entering "**v**", you are
70
+ enough to show the full value. After entering "**v**", you are
64
71
  immediately invited to enter a cell reference. Cells are referenced in
65
- the format "Column:Row", e.g. D:12 for the cell in column "D" and row
72
+ the format "column:row", e.g. D:12 for the cell in column "D" and row
66
73
  "12".
67
74
 
68
75
  save to file (f)
69
- Save the current or all tables to a text file. The command does initially
70
- show two alternative sub-commands:
76
+ Save the current table or all tables to a text file. Initially, the command
77
+ shows two alternative sub-commands:
71
78
 
72
79
  Current sheet (c) * all sheets (a)
73
- Independently of your choice, in the next step you will have to enter the
74
- path to the output file. You will be warned, if the file already exists
75
- and may choose to either overwrite the existing file or name a different
76
- one.
80
+ Regardless of your choice, you will be prompted to enter the output file
81
+ path in the next step. You will receive a warning, if the file already
82
+ exists at which point you can choose to either overwrite the existing file
83
+ or give it a different name.
77
84
 
78
85
  sheet (s)
79
- Navigate to a different sheet in the current workbook. You may choose
80
- between a sheet-number and the name of a sheet. If you want to indicate
81
- the next sheet **by name**, the list of all available names is first
82
- shown. You just type right away the one that you want.
86
+ Navigate to a different sheet whthin the current workbook. You can choose
87
+ a sheet by its number or by its name. If you want to select the next sheet
88
+ **by name**, a list of available names will first be shown. You just type
89
+ the name you want.
83
90
 
84
91
  column (c)
85
- Alter the properties of the table-columns. At the time of this writing
86
- (February 2017) the only property that can be changed, is the width of all
87
- columns. When you enter "**c**" the subcommand column width (w) is shown.
88
- After entering "**w**" you can enter the desired width in characters.
92
+ Alter the properties of the table columns. As of February 2017 the only
93
+ property that can be changed, is the width of all columns. When you enter
94
+ "**c**" the subcommand column width (w) is shown. After entering "**w**"
95
+ you can enter the desired width in characters.
89
96
 
90
97
  Arrows(i, j, k, l)
91
- Navigate in a sheet that is too big to be displayed entirely at once.
92
- These hotkeys correspond to the default navigation keys in the vi editor.
93
-
98
+ Use these hotkeys to navigate a sheet that is too big to be displayed
99
+ entirely at once. These hotkeys correspond to the default navigation keys
100
+ in the Vi editor.
101
+
94
102
  quit (q)
95
103
  Enter "**q**" to quit the program at any moment except when an input
96
104
  invitation is shown.
97
105
 
98
- Hidden (menu-)commands
99
- ------------------------
100
- There is currently only one such command available:
101
- The **Escape-key** will interrupt an unfinished action and refresh the display.
106
+ Hidden menu commands
107
+ ---------------------
108
+ Currently, there is only one such command available. Pressing the **Escape
109
+ key** will interrupt an unfinished action and refresh the display.
102
110
 
103
111
  Other Information
104
112
  =================
105
113
 
106
114
  Development and source code
107
- Viewworkbook has been written in Ruby. As Ruby is an interpreted programming
108
- language, the executable file and all those that it may refer to at one
109
- point in time, are themselves the source-files of the current
110
- program-version. You can open them in any text-editor to scrutinize the
111
- source-code. If you have received the program as a Ruby-gem, you can also
112
- decompress a copy of the gem-file with **tar -x**, then **tar -xzf**.
115
+ Viewworkbook has been written in Ruby. Since Ruby is an interpreted programming
116
+ language, the executable file and all files to which it refers at any given time
117
+ are the source files of the current program version. You can open these
118
+ files in any text editor to examine the source code. If you have received
119
+ the program as a Ruby-gem, you can also decompress a copy of the gem-file
120
+ with **tar -x**, then **tar -xzf**.
113
121
 
114
122
  Bugs
115
- Negative values are not always displayed, when very long (like 15 ciphers).
116
- Enlarging the column-width further does not have an effect.
123
+ Negative values are not always displayed, when they are very long (like 15
124
+ ciphers). Increasing the column width further does not help.
117
125
 
118
126
  License
119
- Viewworkbook is distributed under the conditions of the GNU General Public
120
- License, version 3.
127
+ Viewworkbook is distributed under the conditions of the WTFPL 2.0 or later,
128
+ see http://www.wtfpl.net/about/ for details
121
129
 
122
130
  Author
123
131
  Viewworkbook has been developed by Michael Uplawski
data/lib/action.rb CHANGED
@@ -26,13 +26,13 @@ class Action
26
26
 
27
27
  attr_accessor :name, :key, :proc, :global, :hidden
28
28
 
29
+ # return a string representation of the action
29
30
  def to_s
30
31
  "[#<" << classname << ':' << hash << '@name="' << name << '", @key="' << key << '">'
31
32
  end
32
33
 
33
-
34
+ # create an action
34
35
  def initialize(options = {}, &b)
35
-
36
36
  @name = options[:name]
37
37
  @key = options[:key]
38
38
  @proc = b if b
@@ -40,6 +40,7 @@ class Action
40
40
  @hidden = options[:hidden]
41
41
  end
42
42
 
43
+ # execute te action
43
44
  def call(*args)
44
45
  unless @proc
45
46
  raise ActionError.new((@name ? '' : 'Unnamed ') << 'action' << (@name ? (' ' << @name) : '') << ' called before a command was defined')
@@ -47,3 +48,4 @@ class Action
47
48
  @proc.call(*args)
48
49
  end
49
50
  end
51
+ # Ω
data/lib/cell.rb CHANGED
@@ -26,6 +26,7 @@ class Cell
26
26
 
27
27
  include BasicLogging
28
28
 
29
+ # create a cell in co:row and enter a value
29
30
  def initialize(row = nil, col = nil, value = nil)
30
31
  @row = row if row
31
32
  @col = col if col
@@ -38,18 +39,22 @@ class Cell
38
39
  debug(@debinfo << "cell.initialize, lines is #{@lines}, value is #{value}, ideal_width is #{@ideal_width}")
39
40
  end
40
41
 
42
+ # returns self
41
43
  def to_cell()
42
44
  self
43
45
  end
44
46
 
47
+ # return a line from the cell
45
48
  def line(num = nil)
46
49
  num && num < @lines.length ? @lines[num].to_s : ' ' if @lines && !@lines.empty?
47
50
  end
48
51
 
52
+ # returns a string representation of the cell
49
53
  def to_s
50
54
  object_id.to_s << "{" << @row.number.to_s << ":" << @col.number.to_s << ", " << @lines.to_s << ", " << @ideal_height.to_s << ", " << @ideal_width.to_s << " }"
51
55
  end
52
56
 
57
+ # resizes the cell to its ideal value.
53
58
  def resize
54
59
  @@split_pattern = nil
55
60
  split_value
@@ -57,6 +62,7 @@ class Cell
57
62
  @row.resize
58
63
  end
59
64
 
65
+ # set the value of the cell
60
66
  def value=(value)
61
67
  @@split_pattern = nil
62
68
  @value = value
@@ -64,10 +70,12 @@ class Cell
64
70
  debug(@debinfo << 'after split_value, lines is ' << @lines.to_s)
65
71
  end
66
72
 
73
+ # returns the column number of the cell
67
74
  def col
68
75
  @col.number
69
76
  end
70
-
77
+
78
+ # returns the row number of the cell
71
79
  def row
72
80
  @row.number
73
81
  end
@@ -76,6 +84,9 @@ class Cell
76
84
 
77
85
  private
78
86
 
87
+ # handle long values in a way to make part of them
88
+ # visible, hide the remainder, if the cell ist too
89
+ # small.
79
90
  def split_value()
80
91
  # The regex may be used in many cells. Define on class-level.
81
92
  # And...
@@ -100,6 +111,7 @@ class Cell
100
111
  @row.resize
101
112
  end
102
113
 
114
+ # Determines the ideal height and width of the cell
103
115
  def set_limits
104
116
  if @lines && !@lines.empty?
105
117
  @ideal_height = @lines.length
data/lib/column.rb CHANGED
@@ -31,7 +31,8 @@ class Column
31
31
  @width = @@col_width
32
32
  @@columns << self
33
33
  end
34
-
34
+
35
+ # add a cell to the column
35
36
  def add(cell)
36
37
  n_cell = nil
37
38
  if cell.respond_to?(:to_cell)
@@ -48,16 +49,19 @@ class Column
48
49
  set_limits
49
50
  end
50
51
 
52
+ # execute the block for each cell in the column
51
53
  def each(&b)
52
54
  @cells.each do |c|
53
55
  yield(c)
54
56
  end
55
57
  end
56
58
 
59
+ # return the width of the column
57
60
  def self::col_width
58
61
  @@col_width
59
62
  end
60
63
 
64
+ # set the column width to w
61
65
  def self::col_width=(w)
62
66
  @@col_width = w
63
67
  debug(@number.to_s << ' ' <<"self::col_width=(#{w}), calling resize")
@@ -65,12 +69,14 @@ class Column
65
69
  @@columns.each {|col| col.resize(w)}
66
70
  end
67
71
 
72
+ # resize the column to width
68
73
  def resize(width)
69
74
  @width = width
70
75
  debug(@number.to_s << ' ' <<'calling resize')
71
76
  @cells.each {|cell| cell.resize}
72
77
  end
73
78
 
79
+ # returns a string representation of the column
74
80
  def to_s
75
81
  '<' << self.class.name.dup << ':' << object_id.to_s << "{number=%s width=%s cells.length=}>" %[@number, @cells.length]
76
82
  end
@@ -80,6 +86,7 @@ class Column
80
86
 
81
87
  private
82
88
 
89
+ # determine ideal width of the column
83
90
  def set_limits
84
91
  @ideal_width = @cells.max{|c1, c2| c1.ideal_width <=> c2.ideal_width}.ideal_width
85
92
  @ideal_width ||= @@DEF_WIDTH
data/lib/menu.rb CHANGED
@@ -22,7 +22,6 @@ require_relative 'user_input'
22
22
 
23
23
  # Shows options that the user can choose from.
24
24
  # Options may be associated with sub-menus.
25
-
26
25
  class Menu
27
26
  include BasicLogging
28
27
 
@@ -33,6 +32,7 @@ class Menu
33
32
  @@global_elements = []
34
33
  @@hidden_elements = []
35
34
 
35
+ # create the menu
36
36
  def initialize(options = {})
37
37
  @elements = []
38
38
  if(options && !options.respond_to?(:to_hash) )
@@ -42,10 +42,12 @@ class Menu
42
42
  @key = options[:key] if options[:key]
43
43
  end
44
44
 
45
+ # display menu
45
46
  def call(*args)
46
47
  show()
47
48
  end
48
49
 
50
+ # add an action or sub menu to the menu
49
51
  def add(element, pos = nil)
50
52
  if(element.respond_to?(:call))
51
53
  if(pos)
@@ -67,6 +69,7 @@ class Menu
67
69
  end
68
70
 
69
71
  private
72
+ # display menu and react to user input.
70
73
  def show()
71
74
  @elements.each do |ele|
72
75
  name = ele.name.downcase
data/lib/row.rb CHANGED
@@ -28,6 +28,7 @@ class Row
28
28
  @height = 1
29
29
  end
30
30
 
31
+ # add a cell to the row
31
32
  def add(cell)
32
33
  n_cell = nil
33
34
  if cell.respond_to?(:to_cell)
@@ -44,12 +45,15 @@ class Row
44
45
  resize()
45
46
  end
46
47
 
48
+ # execute block on each cell in the row
47
49
  def each(&b)
48
50
  @cells.each do |c|
49
51
  yield(c)
50
52
  end
51
53
  end
52
54
 
55
+ # adapt the height of the row to the ideal height of the
56
+ # highest cell
53
57
  def resize()
54
58
  if(@cells && ! @cells.empty? )
55
59
  if(@cells.length == 1 )
@@ -62,6 +66,7 @@ class Row
62
66
  @height ||= @@DEF_HEIGHT
63
67
  end
64
68
 
69
+ # returns a string representation of the row
65
70
  def to_s
66
71
  '#<' << self.class.name << ':' << object_id.to_s << "{number=%s height=%s cells.length=%s}" %[@number.to_s, @height.to_s, @cells.length.to_s]
67
72
  end
data/lib/sheetdata.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  =begin
4
4
  /***************************************************************************
5
- * ©2016-2024, Michael Uplawski <michael.uplawski@uplawski.eu> *
5
+ * ©2016-2025, Michael Uplawski <michael.uplawski@uplawski.eu> *
6
6
  * *
7
7
  * This program is free software; you can redistribute it and/or modify *
8
8
  * it under the terms of the WTFPL 2.0 or later, see *
@@ -21,7 +21,6 @@ require 'roo-xls'
21
21
 
22
22
  require_relative 'basic_logging'
23
23
 
24
- # Transforms a file into a Roo spreadsheet instance.
25
24
 
26
25
  ODS_Magic = "OpenDocument Spreadsheet"
27
26
  XLS_Magic = "Composite Document File V2 Document"
@@ -36,6 +35,9 @@ CSV_MIME = "text/plain"
36
35
  # SoftMaker Office
37
36
  PMDX_MIME = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
38
37
 
38
+ =begin
39
+ Transforms a file into a Roo spreadsheet instance.
40
+ =end
39
41
  class SheetData
40
42
  # logs on class level
41
43
  self.extend BasicLogging
@@ -43,6 +45,7 @@ class SheetData
43
45
  @@file = nil
44
46
  @@workbook = nil
45
47
 
48
+ # returns a new workbook
46
49
  def self::workbook(file)
47
50
  @@file = file
48
51
  if !@@workbook
@@ -68,7 +68,7 @@ class SheetInterface
68
68
  size = `stty size`.split.map { |x| x.to_i }.reverse
69
69
  return size
70
70
  end
71
- # Asks the user to enter a number, then verifies ageinst eventual
71
+ # Asks the user to enter a number, then verifies against eventual
72
72
  # constraints.
73
73
  def ask_number(question, &constraint)
74
74
  num = nil
data/viewworkbook.gemspec CHANGED
@@ -1,9 +1,9 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'viewworkbook'
3
- s.version = '0.2'
4
- s.date = '2024-01-03'
5
- s.summary = "New logging module, new License, runtime-dependencies corrected."
6
- s.summary << "Better support for SoftMaker's PMDX format"
3
+ s.version = '0.3'
4
+ s.date = '2025-08-29'
5
+ s.summary = "Documentation text improved, "
6
+ s.summary << "List of dependencies completed."
7
7
  s.description = "View spreadsheet files in a text-console."
8
8
  s.authors = ["Michael Uplawski"]
9
9
  s.email = 'michael.uplawski@uplawski.eu'
@@ -13,8 +13,14 @@ Gem::Specification.new do |s|
13
13
  s.homepage = 'http://rubygems.org/gems/viewworkbook'
14
14
  s.requirements = 'roo, roo-xls, ruby-filemagic'
15
15
  s.add_runtime_dependency 'roo', '~> 2.4', '>= 2.4.0'
16
+ s.add_runtime_dependency 'roo-xls', '~> 1.2', '>= 1.2.0'
16
17
  s.add_runtime_dependency 'ruby-filemagic', '~> 0.3', '>= 0.3.2'
17
18
  s.executables = 'viewworkbook'
18
19
  s.license = 'Nonstandard'
19
20
  s.required_ruby_version = '>= 3.0'
21
+ s.metadata = {
22
+ "homepage_uri" => 'https://www.uplawski.eu/software/viewworkbook/',
23
+ "documentation_uri" => 'https://www.uplawski.eu/software/viewworkbook/viewworkbook.html'
24
+ }
25
+
20
26
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: viewworkbook
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.2'
4
+ version: '0.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Uplawski
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-01-03 00:00:00.000000000 Z
10
+ date: 2025-08-29 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: roo
@@ -30,6 +29,26 @@ dependencies:
30
29
  - - ">="
31
30
  - !ruby/object:Gem::Version
32
31
  version: 2.4.0
32
+ - !ruby/object:Gem::Dependency
33
+ name: roo-xls
34
+ requirement: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - "~>"
37
+ - !ruby/object:Gem::Version
38
+ version: '1.2'
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: 1.2.0
42
+ type: :runtime
43
+ prerelease: false
44
+ version_requirements: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '1.2'
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: 1.2.0
33
52
  - !ruby/object:Gem::Dependency
34
53
  name: ruby-filemagic
35
54
  requirement: !ruby/object:Gem::Requirement
@@ -84,8 +103,9 @@ files:
84
103
  homepage: http://rubygems.org/gems/viewworkbook
85
104
  licenses:
86
105
  - Nonstandard
87
- metadata: {}
88
- post_install_message:
106
+ metadata:
107
+ homepage_uri: https://www.uplawski.eu/software/viewworkbook/
108
+ documentation_uri: https://www.uplawski.eu/software/viewworkbook/viewworkbook.html
89
109
  rdoc_options: []
90
110
  require_paths:
91
111
  - lib
@@ -101,9 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
121
  version: '0'
102
122
  requirements:
103
123
  - roo, roo-xls, ruby-filemagic
104
- rubygems_version: 3.4.20
105
- signing_key:
124
+ rubygems_version: 3.6.7
106
125
  specification_version: 4
107
- summary: New logging module, new License, runtime-dependencies corrected.Better support
108
- for SoftMaker's PMDX format
126
+ summary: Documentation text improved,List of dependencies completed.
109
127
  test_files: []