synful 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -1
  3. data/bin/synful +39 -21
  4. data/synful.gemspec +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e868e7d2521446e9bee4d813d8e15580b5ccfb58f71c0b7fad2459d212585a13
4
- data.tar.gz: 1b2b05e76f6718625c94b77fa43e55c3d808a2c3c22ded2a83c9f4a24d8d99e9
3
+ metadata.gz: bebeb5fb786aeb51dced6d659f916b4780c5d826b34cde51b20c24d567e49b67
4
+ data.tar.gz: d28d17a448e5cf0c86b00e8c2589a4ada7bec18237536a910d39f14ec8ad4f25
5
5
  SHA512:
6
- metadata.gz: f7c6834c135e52ed6aa55f5ea9422a566957a3b046f02a94ff9a32391c34f927513801a866f8d2ec919fc7b721dddc7ef80d9e314b4977d0bb971ef54fed7287
7
- data.tar.gz: 50d63b3c5b7af27adbc8b4e38765a8c60d183d1cc2c413e3e1edf5a4982184dad28f090e9518ddcc5b46c26641d1be042f11197d83eb0728d0f628207158f87b
6
+ metadata.gz: 983bbe5586af0479ad709165cd8100c69284098a1953586ea866ec57a153e91b292ba042d5f16c86d05ab22e69c9f88f81aad32526eb850ebc6cbc5d9da316e6
7
+ data.tar.gz: 246452e18e1df63ab9d99ff1a2576c50c9a9092566c4484a27cb97b9ada2f6c30bed70755430fdaafaf41bd5aa98eb51546ddd9e0c9ca9e5d8ec02dada290303
data/README.md CHANGED
@@ -25,6 +25,8 @@ is made possible by the amazing Rouge library.
25
25
  $ synful winr/bin/winr censive/lib/censive.rb
26
26
  ```
27
27
 
28
+ <img src="https://user-images.githubusercontent.com/142875/219864590-482cb060-465c-4fbb-9fe0-3de34dea703e.png" width="900">
29
+
28
30
  A more complicated example is:
29
31
 
30
32
  ```
@@ -36,7 +38,7 @@ exclude all files with the `.spec` or `.ru` extensions. It will also
36
38
  include files from the `lib/` and `test/` directories as well as the
37
39
  `/tmp/example.rb` file. Even though the `test/boring-results.txt` file
38
40
  should be rendered, we have disabled it via the `-` (minus sign or dash)
39
- in front of it's filename. Note that to use this type of negation, we
41
+ in front of its filename. Note that to use this type of negation, we
40
42
  need to precede it with a "double-dash" `--` to tell `synful` that we
41
43
  are done with the normal command options.
42
44
 
data/bin/synful CHANGED
@@ -14,6 +14,7 @@
14
14
  # ============================================================================
15
15
  # TODO:
16
16
  # 1. Ensure there is a section for a file, even when it has a bad encoding
17
+ # 2. See https://stackoverflow.com/questions/18519641/why-cant-i-refer-to-data-in-class-context
17
18
  # ============================================================================
18
19
 
19
20
  require "optparse"
@@ -134,15 +135,28 @@ __END__
134
135
  <title>Synful</title>
135
136
  <link rel="icon" href="data:,">
136
137
  <style type="text/css">
137
- html body { font-size: 14px; }
138
- body { font-family: Verdana; padding: 5px; }
139
- a { text-decoration: none; }
140
- h4 a { color: #fff; font-weight: bold; margin: 0; border: none; }
141
- h4 a:hover { background: #333; }
142
- h4 { background: black; color: white; padding: 5px; margin: 0; border: none; }
138
+ body { margin: 0; padding: 0; font-family: Verdana; font-size: 14px; }
139
+ pre { margin: 0; font-family: Consolas, Menlo, monospace; }
140
+ a { text-decoration: none; scroll-margin-top: 0.5em; }
141
+
142
+ .cap {
143
+ background: black;
144
+ color: white;
145
+ font-weight: bold;
146
+ line-height: 30px;
147
+ display: grid;
148
+ grid-template-columns: 1fr 10em;
149
+ align-items: stretch;
150
+ }
151
+ .cap > div:nth-child(1) { padding-left: 1em; }
152
+ .cap > div:nth-child(2) { display: grid; grid-template-columns: 1fr 1fr 1fr; place-content: stretch; }
153
+ .cap a { text-align: center; color: white; }
154
+ .cap a:hover { background: rgba(255,255,255,0.5); }
155
+
156
+ @media print { .cap > div:nth-child(2) { display: none; } }
157
+
143
158
  li a { color: #000; }
144
159
  li a:hover { text-decoration: underline; color: #666; }
145
- pre { margin: 0; font-family: Consolas, Menlo, monospace; }
146
160
 
147
161
  .rouge-table { padding: 0; border-collapse: collapse; }
148
162
  .rouge-table td { padding: 0; vertical-align: top; }
@@ -225,13 +239,15 @@ __END__
225
239
  <%= erb :toc if (count = @list.size) > 1 %><%
226
240
  @list.each_with_index do |file, i|
227
241
  @file = file
228
- @prev = @list[(i - 1) % count]
229
242
  @next = @list[(i + 1) % count]
243
+ @prev = @list[(i - 1) % count]
230
244
  @curr = count > 1 ? "#{i + 1}) " : "" %>
231
245
  <%= erb :file %><% end %>
232
246
 
233
247
  @@ toc
234
- <h4><a name="top">Index</a></h4>
248
+ <div class="cap">
249
+ <div><a name="top">Index</a></div>
250
+ </div>
235
251
 
236
252
  <ul><% @list.each do |file| %>
237
253
  <li><a href="#<%= file %>"><%= file %></a></li><% end %>
@@ -261,18 +277,20 @@ __END__
261
277
  end
262
278
  %>
263
279
 
264
- <h4>
265
- <a name="<%= @file %>"><%= @curr %><%= @file %>
266
- (<%= data.count("\n") + 1 %> lines)
267
- <%= "[" + type.tag + "]" if type %>
268
- <%= File.mtime(@file).strftime("on %Y-%m-%d at %-I:%M %P") %>
269
- </a>
270
- <span style="float: right">
271
- <a class="jump" href="#<%= @prev %>">&nbsp;&nbsp;&nbsp;&nbsp;&darr;&nbsp;&nbsp;&nbsp;&nbsp;</a>
272
- <a class="jump" href="#<%= @next %>">&nbsp;&nbsp;&nbsp;&nbsp;&UpArrow;&nbsp;&nbsp;&nbsp;&nbsp;</a>
273
- <a class="jump" href="#top">&nbsp;&nbsp;&nbsp;&nbsp;⥣&nbsp;&nbsp;&nbsp;&nbsp;</a>
274
- </span>
275
- </h4>
280
+ <div class="cap">
281
+ <div>
282
+ <a name="<%= @file %>"><%= @curr %><%= @file %>
283
+ (<%= data.count("\n") + 1 %> lines)
284
+ <%= "[" + type.tag + "]" if type %>
285
+ <%= File.mtime(@file).strftime("on %Y-%m-%d at %-I:%M %P") %>
286
+ </a>
287
+ </div>
288
+ <div>
289
+ <a href="#<%= @next %>">&darr;</a>
290
+ <a href="#<%= @prev %>">&UpArrow;</a>
291
+ <a href="#top">⥣</a>
292
+ </div>
293
+ </div>
276
294
 
277
295
  <%=
278
296
  if type
data/synful.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "synful"
5
- s.version = "1.0.0"
5
+ s.version = "1.0.1"
6
6
  s.author = "Steve Shreeve"
7
7
  s.email = "steve.shreeve@gmail.com"
8
8
  s.summary =
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: synful
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Shreeve
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-18 00:00:00.000000000 Z
11
+ date: 2023-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rouge