flnews_post_proc 1.80 → 1.93

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: 68848e2172c1555bc98ed2ad95fcc219871a4b53ef4647dba81e274902f12c45
4
- data.tar.gz: 4248c0c515796d015ffe92610d1e75f14eef4235576cede2a97097d8c79d8671
3
+ metadata.gz: 6e6e9b868f3b13e1037ebf89c7b2d9245358bda76b115831d63b5a137af5b090
4
+ data.tar.gz: 01d2e7e729338b1ac18c47050e16756ff9a13e0190333a4308c7106674125c1c
5
5
  SHA512:
6
- metadata.gz: fdc9928326e6b1a93a30615a1bd9e8db18f51400594e1385bf10411a3994f5e53a3eda06c0963ce0361d6705cc5ae8f9b45b3a262b347f1af39758108f7571e9
7
- data.tar.gz: c9367005a143b112384827412280af9e33e4287c0f87bc4bb7b1507d6ab4046cdf66df72757b03c194d798e9785dbe5660fbcf263260d6d299ab0fbf1a438cac
6
+ metadata.gz: 825ef12b6621d7e41d2dc39999d244a1af4d8c1a9ab80fa330b04b85c26b4acf3a5413b9172c2547d67c5899aa694b4f20247d95ba07cd92081aa54c471a961f
7
+ data.tar.gz: 2e207259576e65bb114caecd37fede29a73775c13fb0059acdfdbeb1aaafa2ed2b8141c968463137ed412cb25e74d6ee53d8a22b389261e613983ea33480f485
data/bin/flnews_post_proc CHANGED
@@ -88,6 +88,11 @@ if (!STDIN.tty?)
88
88
  warn 'Input contains other things than plain-text, but I cannot say, what.'
89
89
  end
90
90
  end
91
+ # Is this article superseding another ?
92
+ if (Headers::supersedes?(artext) )
93
+ debug 'is supersedes! '
94
+ config.set(:SUPERSEDES, true)
95
+ end
91
96
  #----------->
92
97
  # Allow to override the configuration,
93
98
  # if not disabled (default is true)
@@ -1,5 +1,5 @@
1
1
  <?xml version="1.0" encoding="utf-8"?>
2
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
3
  <head>
4
4
  <meta name="generator" content="vim - Vi Improved, a programmer's editor; HTML Tidy for Linux version 5.8.0
5
5
  "/>
@@ -18,16 +18,23 @@
18
18
  Stylesheet for use with Docutils.
19
19
  */
20
20
 
21
- /* The defaults for docutils */
22
- @import url(html4css1.css);
23
-
24
21
  body {
25
- background-color:#e0f0a0;
22
+ background-color:#e0f0c0;
26
23
  font-family: Verdana,Helvetica,Univers;
27
24
  }
28
25
 
29
- h1 {color:darkblue;font-size:1.5em;}
30
- h1.title {color:#a0a0f0;font-size:2em;}
26
+ p {width: 80%;}
27
+
28
+ h1.title {color:#800080;font-size:2em;}
29
+ h2 {color:darkblue;font-size:1.5em;}
30
+ h3 {color:#3030f0;font-size:1em;}
31
+
32
+ nav:before {
33
+ content:'Contenu';
34
+ font-weight:bold;
35
+ color:darkblue;
36
+ font-size:1.5em;
37
+ }
31
38
 
32
39
  p, ul.simple, ol.simple, dt {margin-left:2em;}
33
40
  dd {margin-left:4em;}
@@ -44,24 +51,115 @@
44
51
 
45
52
  pre.literal-block {
46
53
  margin-left:2em;
47
- font-family: Verdana, Helvetica, Univers;
48
- }
49
-
54
+ font-family:Verdana,Helvetica,Univers;
55
+ }8
50
56
  blockquote {background-color:#ffc090;
51
57
  padding:0.5em;
58
+ width:80%;
52
59
  border-radius:0.5em;
53
60
  }
54
61
 
62
+
55
63
  /*]]>*/
56
64
  </style>
57
65
  </head>
58
- <body>
66
+ <body class="with-toc">
59
67
  <main id="flnews-post-proc">
60
68
  <h1 class="title">flnews_post_proc</h1>
61
69
 
62
70
  <p class="subtitle" id="post-traitement-pour-flnews">
63
71
  Post-Traitement pour flnews</p>
64
72
 
73
+ <nav class="contents local" id="contents" role="doc-toc">
74
+ <ul class="simple">
75
+ <li>
76
+ <p><a class="reference internal" href="#synopsis" id=
77
+ "toc-entry-1">SYNOPSIS</a>
78
+ </p>
79
+ </li>
80
+
81
+ <li>
82
+ <p><a class="reference internal" href="#description" id=
83
+ "toc-entry-2">DESCRIPTION</a>
84
+ </p>
85
+
86
+ <ul>
87
+ <li>
88
+ <p><a class="reference internal" href=
89
+ "#les-limites-d-un-lecteur-basique-de-news-ce-qui-peut-faire-program"
90
+ id="toc-entry-3">Les limites d'un lecteur basique de
91
+ news – ce qui peut faire
92
+ <strong>flnews_post_proc</strong></a>
93
+ </p>
94
+ </li>
95
+
96
+ <li>
97
+ <p><a class="reference internal" href=
98
+ "#dialogue-pour-desactiver-des-options" id=
99
+ "toc-entry-4">Dialogue pour désactiver des
100
+ options</a>
101
+ </p>
102
+ </li>
103
+ </ul>
104
+ </li>
105
+
106
+ <li>
107
+ <p><a class="reference internal" href="#configuration"
108
+ id="toc-entry-5">CONFIGURATION</a>
109
+ </p>
110
+
111
+ <ul>
112
+ <li>
113
+ <p><a class="reference internal" href=
114
+ "#options-de-configuration" id="toc-entry-6">Options
115
+ de configuration</a>
116
+ </p>
117
+ </li>
118
+ </ul>
119
+ </li>
120
+
121
+ <li>
122
+ <p><a class="reference internal" href=
123
+ "#autres-informations" id="toc-entry-7">Autres
124
+ Informations</a>
125
+ </p>
126
+
127
+ <ul>
128
+ <li>
129
+ <p><a class="reference internal" href=
130
+ "#remplacement-avec-signature" id=
131
+ "toc-entry-8">Remplacement avec signature</a>
132
+ </p>
133
+ </li>
134
+
135
+ <li>
136
+ <p><a class="reference internal" href="#tester" id=
137
+ "toc-entry-9">Tester</a>
138
+ </p>
139
+ </li>
140
+
141
+ <li>
142
+ <p><a class="reference internal" href="#code-source"
143
+ id="toc-entry-10">Code source</a>
144
+ </p>
145
+ </li>
146
+
147
+ <li>
148
+ <p><a class="reference internal" href="#license" id=
149
+ "toc-entry-11">License</a>
150
+ </p>
151
+ </li>
152
+
153
+ <li>
154
+ <p><a class="reference internal" href="#auteur" id=
155
+ "toc-entry-12">Auteur</a>
156
+ </p>
157
+ </li>
158
+ </ul>
159
+ </li>
160
+ </ul>
161
+ </nav>
162
+
65
163
  <section id="synopsis">
66
164
  <h2>SYNOPSIS</h2>
67
165
 
@@ -569,7 +667,7 @@ alt.fr.test: /home/[utilisateur]/.signatures</pre>
569
667
  <p>EXEMPLE: No</p>
570
668
  </blockquote>
571
669
 
572
- <p><strong>OVERRIDE_CONFIG</strong>
670
+ <p id="override-config"><strong>OVERRIDE_CONFIG</strong>
573
671
  </p>
574
672
 
575
673
  <blockquote>
@@ -597,6 +695,47 @@ alt.fr.test: /home/[utilisateur]/.signatures</pre>
597
695
  <section id="autres-informations">
598
696
  <h2>Autres Informations</h2>
599
697
 
698
+ <section id="remplacement-avec-signature">
699
+ <h3>Remplacement avec signature</h3>
700
+
701
+ <p>Lors du remplacement d'un article existant, aucune
702
+ signature n'est appliquée automatiquement. Ceci permet de
703
+ conserver autant de contenu original que possible.</p>
704
+
705
+ <p>Pour conserver la signature originale dans la nouvelle
706
+ version de l'article :</p>
707
+
708
+ <ol class="arabic simple">
709
+ <li>
710
+ <p>Dans flnews, sélectionnez l'intégralité de l'article
711
+ avec la souris – de la première ligne (y compris toute
712
+ introduction) jusqu'à la dernière ligne de la
713
+ signature.</p>
714
+ </li>
715
+
716
+ <li>
717
+ <p>Dans le menu Article, sélectionnez
718
+ <strong>Remplacer</strong>.</p>
719
+ </li>
720
+
721
+ <li>
722
+ <p>Apportez les modifications souhaitées. Notez que la
723
+ signature sera incluse dans le texte modifiable,
724
+ contrairement à la situation normale où flnews supprime
725
+ les signatures avant d'ouvrir l'éditeur.</p>
726
+ </li>
727
+
728
+ <li>
729
+ <p>Envoyez l'article.</p>
730
+ </li>
731
+ </ol>
732
+
733
+ <p><strong>Note :</strong> Le dialogue de configuration
734
+ (voir ci-dessous : <a class="reference internal" href=
735
+ "#override-config">OVERRIDE_CONFIG</a>) n'affecte pas les
736
+ signatures lors d'un remplacement.</p>
737
+ </section>
738
+
600
739
  <section id="tester">
601
740
  <h3>Tester</h3>
602
741
 
Binary file
Binary file
@@ -8,6 +8,11 @@ flnews_post_proc
8
8
  Post-Traitement pour flnews
9
9
  ------------------------------------------
10
10
 
11
+ .. contents::
12
+ :local:
13
+ :backlinks: none
14
+ :depth: 3
15
+
11
16
  SYNOPSIS
12
17
  =======================
13
18
  Un article est envoyé au logiciel de post-traitement via STDIN. Cela se fait
@@ -358,6 +363,8 @@ Options de configuration
358
363
 
359
364
  EXEMPLE: No
360
365
 
366
+ .. _OVERRIDE_CONFIG:
367
+
361
368
  **OVERRIDE_CONFIG**
362
369
 
363
370
  Une constante booléenne. Vous pouvez décider d'ignorer les options
@@ -378,6 +385,30 @@ Options de configuration
378
385
  Autres Informations
379
386
  ===================
380
387
 
388
+ Remplacement avec signature
389
+ ---------------------------
390
+
391
+ Lors du remplacement d'un article existant, aucune signature n'est appliquée
392
+ automatiquement. Ceci permet de conserver autant de contenu original que
393
+ possible.
394
+
395
+ Pour conserver la signature originale dans la nouvelle version de l'article :
396
+
397
+ 1. Dans flnews, sélectionnez l'intégralité de l'article avec la souris – de la
398
+ première ligne (y compris toute introduction) jusqu'à la dernière ligne de
399
+ la signature.
400
+
401
+ 2. Dans le menu Article, sélectionnez **Remplacer**.
402
+
403
+ 3. Apportez les modifications souhaitées. Notez que la signature sera incluse
404
+ dans le texte modifiable, contrairement à la situation normale où flnews
405
+ supprime les signatures avant d'ouvrir l'éditeur.
406
+
407
+ 4. Envoyez l'article.
408
+
409
+ **Note :** Le dialogue de configuration (voir ci-dessous : `OVERRIDE_CONFIG`_)
410
+ n'affecte pas les signatures lors d'un remplacement.
411
+
381
412
  Tester
382
413
  ------
383
414
  L'effet qu'aura l'exécution du programme peut être vérifié de deux manières :
@@ -27,7 +27,14 @@
27
27
 
28
28
  h1.title {color:#800080;font-size:2em;}
29
29
  h2 {color:darkblue;font-size:1.5em;}
30
- h3 {color:#3030f0;font-size:1.5em;}
30
+ h3 {color:#3030f0;font-size:1em;}
31
+
32
+ nav:before {
33
+ content:'Contents';
34
+ font-weight:bold;
35
+ color:darkblue;
36
+ font-size:1.5em;
37
+ }
31
38
 
32
39
  p, ul.simple, ol.simple, dt {margin-left:2em;}
33
40
  dd {margin-left:4em;}
@@ -45,25 +52,115 @@
45
52
  pre.literal-block {
46
53
  margin-left:2em;
47
54
  font-family:Verdana,Helvetica,Univers;
48
- }
55
+ }8
49
56
  blockquote {background-color:#ffc090;
50
57
  padding:0.5em;
51
58
  width:80%;
52
59
  border-radius:0.5em;
53
60
  }
54
61
 
62
+
55
63
  /*]]>*/
56
64
  </style>
57
65
  </head>
58
- <body>
66
+ <body class="with-toc">
59
67
  <main id="flnews-post-proc">
60
68
  <h1 class="title">flnews_post_proc</h1>
61
69
 
62
70
  <p class="subtitle" id=
63
71
  "post-processor-for-the-flnews-newsreader">Post-Processor for
64
- the flnews Newsreader</p>
72
+ the <a class="reference external" href=
73
+ "https://micha.freeshell.org/flnews/">flnews</a> Newsreader</p>
74
+
75
+ <nav class="contents local" id="contents" role="doc-toc">
76
+ <ul class="simple">
77
+ <li>
78
+ <p><a class="reference internal" href="#synopsis-1" id=
79
+ "toc-entry-1">SYNOPSIS</a>
80
+ </p>
81
+ </li>
82
+
83
+ <li>
84
+ <p><a class="reference internal" href="#description-1"
85
+ id="toc-entry-2">DESCRIPTION</a>
86
+ </p>
87
+
88
+ <ul>
89
+ <li>
90
+ <p><a class="reference internal" href=
91
+ "#limitations-of-basic-newsreaders-1" id=
92
+ "toc-entry-3">Limitations of Basic Newsreaders</a>
93
+ </p>
94
+ </li>
95
+
96
+ <li>
97
+ <p><a class="reference internal" href=
98
+ "#dialog-for-overriding-settings-1" id=
99
+ "toc-entry-4">Dialog for Overriding Settings</a>
100
+ </p>
101
+ </li>
102
+ </ul>
103
+ </li>
65
104
 
66
- <section id="synopsis">
105
+ <li>
106
+ <p><a class="reference internal" href="#configuration-1"
107
+ id="toc-entry-5">CONFIGURATION</a>
108
+ </p>
109
+
110
+ <ul>
111
+ <li>
112
+ <p><a class="reference internal" href=
113
+ "#configuration-options" id=
114
+ "toc-entry-6">Configuration Options</a>
115
+ </p>
116
+ </li>
117
+ </ul>
118
+ </li>
119
+
120
+ <li>
121
+ <p><a class="reference internal" href=
122
+ "#other-information-1" id="toc-entry-7">Other
123
+ Information</a>
124
+ </p>
125
+
126
+ <ul>
127
+ <li>
128
+ <p><a class="reference internal" href=
129
+ "#signatures-in-supersedes-1" id=
130
+ "toc-entry-8">Signatures in Supersedes</a>
131
+ </p>
132
+ </li>
133
+
134
+ <li>
135
+ <p><a class="reference internal" href="#testing-1"
136
+ id="toc-entry-9">Testing</a>
137
+ </p>
138
+ </li>
139
+
140
+ <li>
141
+ <p><a class="reference internal" href=
142
+ "#source-code-1" id="toc-entry-10">Source Code</a>
143
+ </p>
144
+ </li>
145
+
146
+ <li>
147
+ <p><a class="reference internal" href="#license-1"
148
+ id="toc-entry-11">License</a>
149
+ </p>
150
+ </li>
151
+
152
+ <li>
153
+ <p><a class="reference internal" href="#author-1" id=
154
+ "toc-entry-12">Author</a>
155
+ </p>
156
+ </li>
157
+ </ul>
158
+ </li>
159
+ </ul>
160
+ </nav>
161
+
162
+ <section id="synopsis-1">
163
+ <span id="synopsis"></span>
67
164
  <h2>SYNOPSIS</h2>
68
165
 
69
166
  <p>The post-processor is invoked by piping an article into
@@ -79,14 +176,15 @@
79
176
  <p><strong>flnews_post_proc</strong> &lt; article</p>
80
177
  </blockquote>
81
178
 
82
- <p>or:</p>
179
+ <p>.or:</p>
83
180
 
84
181
  <blockquote>
85
182
  <p>cat article.txt | <strong>flnews_post_proc</strong></p>
86
183
  </blockquote>
87
184
  </section>
88
185
 
89
- <section id="description">
186
+ <section id="description-1">
187
+ <span id="description"></span>
90
188
  <h2>DESCRIPTION</h2>
91
189
 
92
190
  <p>The flnews newsreader fully supports Usenet access,
@@ -106,7 +204,8 @@
106
204
  Usenet users, though it is primarily intended as a starting
107
205
  point for creating your own custom solutions.</p>
108
206
 
109
- <section id="limitations-of-basic-newsreaders">
207
+ <section id="limitations-of-basic-newsreaders-1">
208
+ <span id="limitations-of-basic-newsreaders"></span>
110
209
  <h3>Limitations of Basic Newsreaders</h3>
111
210
 
112
211
  <p>While flnews creates posts that are generally complete
@@ -174,7 +273,8 @@
174
273
  </ul>
175
274
  </section>
176
275
 
177
- <section id="dialog-for-overriding-settings">
276
+ <section id="dialog-for-overriding-settings-1">
277
+ <span id="dialog-for-overriding-settings"></span>
178
278
  <h3>Dialog for Overriding Settings</h3>
179
279
 
180
280
  <p><strong>IMPORTANT</strong>: As of version 1.72, YAD or
@@ -225,7 +325,8 @@
225
325
  </section>
226
326
  </section>
227
327
 
228
- <section id="configuration">
328
+ <section id="configuration-1">
329
+ <span id="configuration"></span>
229
330
  <h2>CONFIGURATION</h2>
230
331
 
231
332
  <p>Upon first execution of the program, a copy of the
@@ -457,7 +558,7 @@ comp.*: /home/[user]/.my_sigs</pre>
457
558
  <p>EXAMPLE: ... I leave this to your discretion.</p>
458
559
  </blockquote>
459
560
 
460
- <p><strong>OVERRIDE_CONFIG</strong>
561
+ <p id="override-dialog"><strong>OVERRIDE_CONFIG</strong>
461
562
  </p>
462
563
 
463
564
  <blockquote>
@@ -473,10 +574,50 @@ comp.*: /home/[user]/.my_sigs</pre>
473
574
  </section>
474
575
  </section>
475
576
 
476
- <section id="other-information">
577
+ <section id="other-information-1">
578
+ <span id="other-information"></span>
477
579
  <h2>Other Information</h2>
478
580
 
479
- <section id="testing">
581
+ <section id="signatures-in-supersedes-1">
582
+ <span id="signatures-in-supersedes"></span>
583
+ <h3>Signatures in Supersedes</h3>
584
+
585
+ <p>When superseding an existing post, the post-processor
586
+ will NOT automatically add a signature. This preserves the
587
+ original post content as much as possible.</p>
588
+
589
+ <p>To retain the signature from the original post:</p>
590
+
591
+ <ol class="arabic simple">
592
+ <li>
593
+ <p>In flnews, select the entire article body with the
594
+ mouse—from the first line (including any introductions)
595
+ down to the last line of the signature.</p>
596
+ </li>
597
+
598
+ <li>
599
+ <p>From the Article menu, select
600
+ <strong>Supersede</strong>.</p>
601
+ </li>
602
+
603
+ <li>
604
+ <p>Edit the article text as needed. The signature will
605
+ be included in the editable text (normally, flnews
606
+ strips signatures before opening the editor).</p>
607
+ </li>
608
+
609
+ <li>
610
+ <p>Send the article.</p>
611
+ </li>
612
+ </ol>
613
+
614
+ <p><strong>Note:</strong> The <a class="reference internal"
615
+ href="#override-dialog">override dialog</a> (see above)
616
+ does not affect signatures in superseding posts.</p>
617
+ </section>
618
+
619
+ <section id="testing-1">
620
+ <span id="testing"></span>
480
621
  <h3>Testing</h3>
481
622
 
482
623
  <p>You can verify the post-processor’s effect by using one
@@ -503,7 +644,8 @@ comp.*: /home/[user]/.my_sigs</pre>
503
644
  </ol>
504
645
  </section>
505
646
 
506
- <section id="source-code">
647
+ <section id="source-code-1">
648
+ <span id="source-code"></span>
507
649
  <h3>Source Code</h3>
508
650
 
509
651
  <p>The gem file for the program, available via the gem
@@ -533,7 +675,8 @@ comp.*: /home/[user]/.my_sigs</pre>
533
675
  <cite>doc</cite>, and <cite>lib</cite>.</p>
534
676
  </section>
535
677
 
536
- <section id="license">
678
+ <section id="license-1">
679
+ <span id="license"></span>
537
680
  <h3>License</h3>
538
681
 
539
682
  <p>The <strong>flnews_post_proc</strong> is distributed
@@ -546,7 +689,8 @@ comp.*: /home/[user]/.my_sigs</pre>
546
689
  of the gem.</p>
547
690
  </section>
548
691
 
549
- <section id="author">
692
+ <section id="author-1">
693
+ <span id="author"></span>
550
694
  <h3>Author</h3>
551
695
 
552
696
  <p><strong>flnews_post_proc</strong> has been developed by
@@ -554,10 +698,6 @@ comp.*: /home/[user]/.my_sigs</pre>
554
698
  "mailto:michael.uplawski@uplawski.eu">michael.uplawski@uplawski.eu</a>&gt;</p>
555
699
  </section>
556
700
  </section>
557
-
558
- <section id="section-1">
559
- <h2>Ω</h2>
560
- </section>
561
701
  </main>
562
702
  </body>
563
703
  </html>
Binary file
Binary file
@@ -4,10 +4,19 @@ flnews_post_proc
4
4
 
5
5
  .. |program| replace:: **flnews_post_proc**
6
6
 
7
+ .. _flnews: https://micha.freeshell.org/flnews/
8
+
7
9
  ------------------------------------------
8
- Post-Processor for the flnews Newsreader
10
+ Post-Processor for the flnews_ Newsreader
9
11
  ------------------------------------------
10
12
 
13
+ .. contents::
14
+ :local:
15
+ :backlinks: none
16
+ :depth: 3
17
+
18
+ .. _SYNOPSIS:
19
+
11
20
  SYNOPSIS
12
21
  ===========================
13
22
  The post-processor is invoked by piping an article into it. This typically
@@ -19,12 +28,15 @@ post-processor using a command like:
19
28
 
20
29
  |program| < article
21
30
 
22
- or:
31
+ .or:
23
32
 
24
33
  cat article.txt | |program|
25
34
 
35
+ .. _DESCRIPTION:
36
+
26
37
  DESCRIPTION
27
38
  ===========================
39
+
28
40
  The flnews newsreader fully supports Usenet access, enabling the reception and
29
41
  reading of articles from newsgroups, as well as composing and posting them.
30
42
 
@@ -38,6 +50,8 @@ that flnews alone cannot. It is configurable and may meet the needs of some
38
50
  Usenet users, though it is primarily intended as a starting point for creating
39
51
  your own custom solutions.
40
52
 
53
+ .. _Limitations of Basic Newsreaders:
54
+
41
55
  Limitations of Basic Newsreaders
42
56
  --------------------------------------------------------
43
57
  While flnews creates posts that are generally complete and ready for
@@ -76,6 +90,8 @@ unsatisfactory for arbitrary reasons:
76
90
  Example (using %=): "This is an object %=and this becomes the footnote,
77
91
  describing the object further=%"
78
92
 
93
+ .. _Dialog for Overriding Settings:
94
+
79
95
  Dialog for Overriding Settings
80
96
  ------------------------------
81
97
  **IMPORTANT**: As of version 1.72, YAD or Zenity cannot be used for the dialog
@@ -99,6 +115,8 @@ flnews will not post the article.
99
115
  To disable the dialog entirely (and apply all configured options without
100
116
  further interaction), set the **OVERRIDE_CONFIG** option.
101
117
 
118
+ .. _CONFIGURATION:
119
+
102
120
  CONFIGURATION
103
121
  ===============
104
122
  Upon first execution of the program, a copy of the original configuration file
@@ -273,6 +291,8 @@ Configuration Options
273
291
  DEFAULT: yes
274
292
 
275
293
  EXAMPLE: ... I leave this to your discretion.
294
+
295
+ .. _override dialog:
276
296
 
277
297
  **OVERRIDE_CONFIG**
278
298
 
@@ -285,9 +305,34 @@ Configuration Options
285
305
 
286
306
  EXAMPLE: No
287
307
 
308
+ .. _Other Information:
309
+
288
310
  Other Information
289
311
  ========================
290
312
 
313
+ .. _Signatures in Supersedes:
314
+
315
+ Signatures in Supersedes
316
+ ------------------------
317
+ When superseding an existing post, the post-processor will NOT automatically add a signature.
318
+ This preserves the original post content as much as possible.
319
+
320
+ To retain the signature from the original post:
321
+
322
+ 1. In flnews, select the entire article body with the mouse—from the first line
323
+ (including any introductions) down to the last line of the signature.
324
+
325
+ 2. From the Article menu, select **Supersede**.
326
+
327
+ 3. Edit the article text as needed. The signature will be included in the
328
+ editable text (normally, flnews strips signatures before opening the editor).
329
+
330
+ 4. Send the article.
331
+
332
+ **Note:** The `override dialog`_ (see above) does not affect signatures in superseding posts.
333
+
334
+ .. _Testing:
335
+
291
336
  Testing
292
337
  -------
293
338
  You can verify the post-processor’s effect by using one of two methods:
@@ -303,6 +348,8 @@ You can verify the post-processor’s effect by using one of two methods:
303
348
  posting to real newsgroups, especially when the post-processor will alter
304
349
  the article.
305
350
 
351
+ .. _Source Code:
352
+
306
353
  Source Code
307
354
  -----------
308
355
 
@@ -318,6 +365,8 @@ it, do the following:
318
365
 
319
366
  This will create the directories `bin`, `doc`, and `lib`.
320
367
 
368
+ .. _License:
369
+
321
370
  License
322
371
  -------
323
372
 
@@ -327,11 +376,11 @@ The |program| is distributed under the `WTFPL-2.0`_ or later License. For
327
376
  the complete license text, visit http://www.wtfpl.net/txt/copying/ or refer to
328
377
  the license file in the documentation directory of the gem.
329
378
 
379
+ .. _Author:
380
+
330
381
  Author
331
382
  ------
332
383
  |program| has been developed by
333
384
  Michael Uplawski <michael.uplawski@uplawski.eu>
334
385
 
335
- Ω
336
- ==
337
386
 
data/lib/basic_logging.rb CHANGED
@@ -116,7 +116,6 @@ module BasicLogging
116
116
  alias :error :log
117
117
  alias :fatal :log
118
118
 
119
-
120
119
  private
121
120
 
122
121
  def lock_target(&block)
data/lib/body.rb CHANGED
@@ -151,15 +151,23 @@ class Body
151
151
  end
152
152
 
153
153
  def set_signature(signature)
154
- # unless no changes requested.
155
- if signature && !signature.empty?
156
- # remove any signature(s) from
157
- # the current article
158
- sigpos = @lines.index('-- ')
159
- debug('found signature in line ' << sigpos.to_s) if sigpos
160
- @lines = @lines.slice(0, sigpos ) if sigpos
161
- debug('setting signature ' << signature) if signature
162
- @lines << "-- " << signature if signature
154
+ unless @@config.SUPERSEDES
155
+ debug 'is not a supersedes'
156
+ # unless no changes requested.
157
+ debug 'signature is ' << (signature ? signature.to_s : 'NIL')
158
+ if signature && !signature.empty?
159
+ # remove any signature(s) from
160
+ # the current article
161
+ sigpos = @lines.index('-- ')
162
+ debug('found signature in line ' << sigpos.to_s) if sigpos
163
+ @lines = @lines.slice(0, sigpos ) if sigpos
164
+ debug('setting signature ' << signature) if signature
165
+ @lines << "-- " << signature if signature
166
+ else
167
+ debug 'signature is ' << (signature ? signature.to_s : 'not set.' )
168
+ end
169
+ else
170
+ debug 'ignoring signature in spersedes'
163
171
  end
164
172
  end
165
173
 
@@ -246,17 +254,40 @@ class Body
246
254
  msg << "#{$LN}Cannot handle references or footnotes!"
247
255
  error(msg)
248
256
  end
249
-
257
+ # Now append them to the body... or find the right spot
258
+ # where they belong... good luck with that.
250
259
  if(references && !references.empty?)
251
- # a line, separating the footnotes from the body of the article
252
- body << $LN << @@config.REFERENCES_SEPARATOR << $LN
260
+
261
+ # concatenate references.
262
+ refs = ''
253
263
  references.each_with_index do |r, i|
254
264
  r = r.gsub(ref_delim, '').gsub(ref_delim.reverse,'')
255
265
  num = (i + 1).to_s << ") "
256
266
  r.strip!
257
267
  r.wrap!(WRAP_LENGTH, num.length)
258
- body << num << r << $LN
268
+ refs << num << r << $LN
259
269
  end
270
+
271
+ # a previously set signature must stay intact
272
+ # in a supersedes.
273
+ # Either insert the references ...
274
+ sigpos = body.index('-- ')
275
+ if @@config.SUPERSEDES && sigpos
276
+ debug 'inserting references'
277
+ # a line, separating the footnotes from the body of the article
278
+ body.insert(sigpos, $LN.dup << @@config.REFERENCES_SEPARATOR.strip << $LN)
279
+ # move the position lower than the separator
280
+ sigpos = body.index('-- ')
281
+ body.insert(sigpos, refs)
282
+ else
283
+ # ... or append references.
284
+ debug 'appending references'
285
+ # a line, separating the footnotes from the body of the article
286
+ body << $LN << @@config.REFERENCES_SEPARATOR.strip << $LN
287
+ body << refs
288
+ end
289
+
290
+
260
291
  else
261
292
  debug('no refences found')
262
293
  end
@@ -293,6 +324,7 @@ class Body
293
324
  end
294
325
  end
295
326
 
327
+ # formatting http URLs, not much is done here.
296
328
  def handle_http(l)
297
329
  debug('handle http')
298
330
  l_array = l.split
data/lib/configuration.rb CHANGED
@@ -77,33 +77,33 @@ class Configuration
77
77
  # updates the configuration file, if need be.
78
78
  def update_config(i_config)
79
79
  if @conf
80
- conf_version = @conf[:CONFIG_VERSION]
81
- if !conf_version || conf_version < PROGVERSION.to_f
82
- info "configuration has an older version number, looking for changes"
83
- i_conf = YAML::load_file(i_config)
84
- i_conf.transform_keys!{|k| k.to_sym}
85
- i_keys = i_conf.keys
86
- i_keys.each do |k|
87
- if !@conf[k]
88
- info('new configuration option: ' << k.to_s)
89
- @conf[k] = ''
80
+ conf_version = @conf[:CONFIG_VERSION]
81
+ if !conf_version || conf_version < PROGVERSION.to_f
82
+ info "configuration has an older version number, looking for changes"
83
+ i_conf = YAML::load_file(i_config)
84
+ i_conf.transform_keys!{|k| k.to_sym}
85
+ i_keys = i_conf.keys
86
+ i_keys.each do |k|
87
+ if !@conf[k]
88
+ info('new configuration option: ' << k.to_s)
89
+ @conf[k] = ''
90
+ end
91
+ end
92
+ @conf[:CONFIG_VERSION] = PROGVERSION.to_f
93
+ bak_conf = @config_file.dup << '_' << conf_version.to_s
94
+ bak_conf.gsub!('.' << PROGNAME, 'bak_' << PROGNAME)
95
+ info('Old configuration is saved to ' << bak_conf )
96
+ info('New configuration is saved to ' << @config_file )
97
+ begin
98
+ File::write(bak_conf, File.read(@config_file))
99
+ File::write(@config_file, @conf.to_yaml)
100
+ rescue Exception => ex
101
+ msg = "Cannot write altered configuration to " << @config_file << "!\n\t" << ex.message
102
+ STDERR.puts(msg << "\nAborting, bye\n")
103
+ error msg
104
+ exit false
90
105
  end
91
106
  end
92
- @conf[:CONFIG_VERSION] = PROGVERSION.to_f
93
- bak_conf = @config_file.dup << '_' << conf_version.to_s
94
- bak_conf.gsub!('.' << PROGNAME, 'bak_' << PROGNAME)
95
- info('Old configuration is saved to ' << bak_conf )
96
- info('New configuration is saved to ' << @config_file )
97
- begin
98
- File::write(bak_conf, File.read(@config_file))
99
- File::write(@config_file, @conf.to_yaml)
100
- rescue Exception => ex
101
- msg = "Cannot write altered configuration to " << @config_file << "!\n\t" << ex.message
102
- STDERR.puts(msg << "\nAborting, bye\n")
103
- error msg
104
- exit false
105
- end
106
- end
107
107
  else
108
108
  error "User-version of the configuration (#{@conf}) inaccessibble."
109
109
  exit false
@@ -44,7 +44,13 @@ class PostProcessor
44
44
  debug('calling headers.update')
45
45
  headers.update()
46
46
 
47
- newsgroups = headers.newsgroups
47
+ debug 'getting newsgroups'
48
+ begin
49
+ newsgroups = headers.newsgroups
50
+ debug "\thave newsgroups " << newsgroups.to_s
51
+ rescue Exception => ex
52
+ error "Cannot get Newsgroups: " << ex.message
53
+ end
48
54
 
49
55
  # Order matters. These actions work on a
50
56
  # preliminary version of the article, each
@@ -53,6 +59,7 @@ class PostProcessor
53
59
 
54
60
  # if need be, extract references and footnotes.
55
61
  body.handle_references
62
+ # signatures are ignored in Supersedes
56
63
  body.set_signature(newsgroups.signature)
57
64
 
58
65
  # verify and eventually correct URIs.
data/lib/headers.rb CHANGED
@@ -22,13 +22,8 @@ require_relative 'newsgroups'
22
22
  class Headers
23
23
  include BasicLogging
24
24
 
25
- # read the headers from the article
26
- def initialize(article_text)
27
-
28
- @config = Configuration.instance
29
- line = nil
25
+ def self.headers(article_text)
30
26
  # transform the article to an array.
31
- debug('before split, article_text is : ' << article_text)
32
27
  line_array = article_text.split($LN)
33
28
 
34
29
  # Ensure that all three headers are present.
@@ -36,42 +31,36 @@ class Headers
36
31
  if(missing_header)
37
32
  msg = "Input does not look like a news-article, no #{missing_header.delete(':')}; aborting."
38
33
  STDERR.puts msg
39
- error(msg)
40
34
  exit false
41
35
  end
42
36
 
43
- debug('after split, line_array is : ' << line_array.inspect)
44
37
  # find the first empty line
45
38
  end_index = line_array.index {|ele| ele.strip == ''}
46
39
  # keep the preceding lines.
47
40
  begin
48
- @lines = line_array.slice!(0, end_index)
41
+ lines = line_array.slice!(0, end_index)
49
42
  rescue Exception => ex
50
43
  msg = 'ERROR: cannot split the input into lines: ' << self.class.name << ': ' << ex.message
51
44
  # console
52
45
  STDERR.puts msg
53
46
  # log
54
- error(msg)
55
47
  exit false
56
48
  end
57
49
 
58
- debug('headers: ' << @lines.to_s)
59
-
60
50
  # headername: headervalue
61
- @headers = {}
51
+ headers = {}
62
52
 
63
53
  # fill the headers Hash from the header-lines.
64
54
  # headers may have been line-wrapped.
65
55
 
66
56
  cur_header = nil
67
- @lines.each do |l|
57
+ lines.each do |l|
68
58
  # has the header been wrapped?
69
59
  if !l.start_with?(/\s+/)
70
60
  # header is all before the first colon
71
61
  begin
72
62
  cur_header = l.match(/^(.*?):/)[1].to_sym
73
63
  rescue Exception => ex
74
- error ("Cannot match a header in line " << l << "(" << ex.message << ")")
75
64
  exit false;
76
65
  end
77
66
  # Consider the two following fixes as preliminary until proven.
@@ -85,28 +74,46 @@ class Headers
85
74
  val = l
86
75
  end
87
76
  # add value to the existing
88
- if cur_header && @headers[cur_header]
89
- @headers[cur_header] += val
77
+ if cur_header && headers[cur_header]
78
+ headers[cur_header] += val
90
79
  else
91
80
  # or add a new value
92
- @headers[cur_header] = val
81
+ headers[cur_header] = val
93
82
  end
94
83
  end
95
- debug('headers are ' << @headers.to_s)
84
+
85
+ return headers
86
+ end
87
+
88
+ def self::supersedes?(article_text)
89
+ headers(article_text).keys.include?(:Supersedes)
90
+ end
91
+
92
+ # read the headers from the article
93
+ def initialize(article_text)
94
+
95
+ @config = Configuration.instance
96
+ line = nil
97
+ debug 'setting the headers'
98
+ @headers = Headers::headers(article_text)
99
+
96
100
  @newsgroups = Newsgroups.new(header(:Newsgroups))
97
101
  debug('Newsgroups is ' << @newsgroups.inspect)
98
-
99
102
  end
100
103
 
101
104
  # returns the value of header 'name'
102
105
  def header(name)
103
106
  # name must be a symbol.
104
- if name.respond_to?(:to_sym)
105
- @headers[name]
106
- else
107
- error(name.to_s << ' is not a symbol!')
108
- nil
107
+ if(@headers && !@headers.empty?)
108
+ if name.respond_to?(:to_sym)
109
+ return @headers[name]
110
+ else
111
+ error(name.to_s << ' is not a symbol!')
112
+ end
113
+ else
114
+ error('no headers set')
109
115
  end
116
+ nil
110
117
  end
111
118
 
112
119
  # Add headers, if need be. Set values where necessary.
@@ -124,7 +131,7 @@ class Headers
124
131
  ch = pair.split(':')
125
132
  hn = ch[0].strip
126
133
  hv = ch[1].strip
127
- # Ensure header is ascii only
134
+ # Ensure header is as only
128
135
  if hv.ascii_only? && hn.ascii_only?
129
136
  # <---------- special treatment Post-Processor ---------->
130
137
  hv << ' ' << PROGVERSION.to_s if hn == 'X-Post-Processor' && hv == 'flnews_post_proc'
@@ -147,8 +154,13 @@ class Headers
147
154
  # basically a replacement for header(name), above.
148
155
  # But you can call self.Newsgroups or self.From etc.
149
156
  def method_missing(method, args = nil)
150
- return @headers[method] if @headers[method]
151
- error("unknown symbol '#{method}'")
157
+ if(@headers && !@headers.empty?)
158
+ return @headers[method] if @headers[method]
159
+ error("unknown symbol '#{method}'")
160
+ else
161
+ error('no article headers set')
162
+ end
163
+ return nil
152
164
  end
153
165
 
154
166
  # return the headers as a String.
data/lib/newsgroups.rb CHANGED
@@ -26,16 +26,19 @@ class Newsgroups
26
26
  @config = Configuration.instance
27
27
  @groups = groups.split(',')
28
28
  debug('set signature, intro, no_archive')
29
+
29
30
  # set details for this post
30
31
  if @groups.size == 1
31
- set_signature
32
+ debug 'supersedes is ' << @config.SUPERSEDES.to_s
33
+ debug 'Signature will ' << (@config.SUPERSEDES ? 'NOT ' : '') << 'be set'
34
+ set_signature if !@config.SUPERSEDES
32
35
  set_intro
33
36
  set_no_archive
34
37
  end
35
38
  end
36
39
 
37
40
  def no_archive
38
- debug('returning ' <<( @no_archive ? @no_archive : ' nil ') )
41
+ debug('no_archive returning ' <<( @no_archive ? @no_archive : ' nil ') )
39
42
  return @no_archive ? @no_archive : nil
40
43
  end
41
44
  attr_reader :signature, :intro, :groups
@@ -94,7 +97,9 @@ class Newsgroups
94
97
  @signature = nil
95
98
  # 1 group
96
99
  group = @groups[0]
100
+ debug ' getting group_sigs'
97
101
  gsigs = @config.GROUP_SIGS
102
+ debug "\t got " << gsigs.to_s
98
103
  tsig = nil
99
104
 
100
105
  if gsigs && gsigs.respond_to?(:to_hash)
data/lib/override.rb CHANGED
@@ -18,7 +18,8 @@
18
18
  # before posting, to do some “last minute” changes,
19
19
  # notably to deactivate them.
20
20
  #
21
- # Post-processing CANNOT be deactivated completely in this dialog.
21
+ # Post-processing CANNOT be deactivated completely in this dialog
22
+ # but cancelling the dialog will stop posting altogether.
22
23
 
23
24
  require_relative 'basic_logging'
24
25
 
data/lib/version.rb CHANGED
@@ -14,9 +14,8 @@
14
14
  =end
15
15
 
16
16
  PROGNAME = 'flnews_post_proc'
17
- PROGVERSION = "1.80"
17
+ PROGVERSION = "1.93"
18
18
  AUTHORS = "Michael Uplawski"
19
19
  EMAIL = "michael.uplawski@uplawski.eu"
20
- YEARS = "2023 - 2025"
21
- SUMMARY = "Generation of documentation simplified. BUG in signatures corrected."
22
-
20
+ YEARS = "2023 - 2026"
21
+ SUMMARY = "References precede a signature, also in Supersedes"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flnews_post_proc
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.80'
4
+ version: '1.93'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Uplawski
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-12-02 00:00:00.000000000 Z
10
+ date: 2026-01-22 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: diffy
@@ -103,5 +103,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  requirements: []
104
104
  rubygems_version: 3.6.7
105
105
  specification_version: 4
106
- summary: Generation of documentation simplified. BUG in signatures corrected.
106
+ summary: References precede a signature, also in Supersedes
107
107
  test_files: []