flnews_post_proc 1.75 → 1.80

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.
Binary file
Binary file
@@ -1,236 +1,289 @@
1
1
  ===========================
2
2
  flnews_post_proc
3
3
  ===========================
4
+
5
+ .. |program| replace:: **flnews_post_proc**
6
+
4
7
  ------------------------------------------
5
8
  Post-Processor for the flnews Newsreader
6
9
  ------------------------------------------
7
10
 
8
11
  SYNOPSIS
9
12
  ===========================
10
- The post-processor is invoked by piping an article into it. This typically occurs
11
- automatically when the "post_proc" variable is set to `flnews_post_proc` in the
12
- flnews configuration file.
13
+ The post-processor is invoked by piping an article into it. This typically
14
+ occurs automatically when the "post_proc" variable is set to |program|
15
+ in the flnews `configuration`_ file.
16
+
17
+ For testing purposes, you can also pipe locally stored articles into the
18
+ post-processor using a command like:
19
+
20
+ |program| < article
13
21
 
14
- For testing purposes, you can also pipe locally stored articles into the post-processor
15
- using a command like:
22
+ or:
16
23
 
17
- **flnews_post_proc < article**
24
+ cat article.txt | |program|
18
25
 
19
26
  DESCRIPTION
20
27
  ===========================
21
- The flnews newsreader fully supports Usenet access, enabling the reception and reading
22
- of articles from newsgroups, as well as composing and posting them.
28
+ The flnews newsreader fully supports Usenet access, enabling the reception and
29
+ reading of articles from newsgroups, as well as composing and posting them.
23
30
 
24
- When comparing various news clients, differences will often influence your choice of
25
- preferred client. Flnews distinguishes itself by not only offering control over its
26
- internal behavior, but also by allowing you to modify outgoing posts just before they
27
- are sent to the configured NNTP server.
31
+ When comparing various news clients, differences will often influence your
32
+ choice of preferred client. Flnews distinguishes itself by not only offering
33
+ control over its internal behavior, but also by allowing you to modify outgoing
34
+ posts just before they are sent to the configured NNTP server.
28
35
 
29
- The `flnews_post_proc` program can be used to modify and enhance a post in ways that
30
- flnews alone cannot. It is configurable and may meet the needs of some Usenet users,
31
- though it is primarily intended as a starting point for creating your own custom solutions.
36
+ The |program| program can be used to modify and enhance a post in ways
37
+ that flnews alone cannot. It is configurable and may meet the needs of some
38
+ Usenet users, though it is primarily intended as a starting point for creating
39
+ your own custom solutions.
32
40
 
33
41
  Limitations of Basic Newsreaders
34
42
  --------------------------------------------------------
35
- While flnews creates posts that are generally complete and ready for submission, there are
36
- instances where users might find the output unsatisfactory for arbitrary reasons:
37
-
38
- * If you're posting to different newsgroups in multiple languages, the introductory line
39
- referencing a prior post can only be set once in the flnews configuration file. As a
40
- result, posts to a French newsgroup, for example, may start with an introduction in
41
- English. The post-processor can address this by setting specific introductory lines
42
- for each newsgroup.
43
-
44
- * Similar issues arise when you set a standard signature and want it to vary based on
45
- the newsgroup. The post-processor allows different signatures to be used for different
46
- newsgroups, and you can even randomize the selection from a list of signatures stored
47
- in a file.
48
-
49
- * Custom headers, such as GnuPG key IDs or your language proficiency, can also be added
50
- to posts, though signatures may be a better alternative. Custom headers can be defined
51
- in the configuration file and will be added to outgoing posts.
52
-
53
- * Headers like "Archive" and "X-No-Archive" are sometimes set to prevent an article from
54
- being indexed by search engines (e.g., Google). For example, test posts likely don't need
55
- to be included in search results. The post-processor can apply both headers to all posts
56
- sent to certain newsgroups.
57
-
58
- **NOTE**: As of 2024, the "X-No-Archive" header has limited effectiveness, and it is
59
- up to server operators whether or not to honor it.
60
-
61
- * Posts that include many references to other posts or URLs can become cluttered. The
62
- post-processor can convert marked text into footnotes, similar to the <ref/> link format
63
- used in Wikipedia, with the delimiter configurable in the configuration file.
64
- Example (using %=):
65
- "This is an object %=and this becomes the footnote, describing the object further=%"
43
+ While flnews creates posts that are generally complete and ready for
44
+ submission, there are instances where users might find the output
45
+ unsatisfactory for arbitrary reasons:
46
+
47
+ * If you're posting to different newsgroups in multiple languages, the
48
+ introductory line referencing a prior post can only be set once in the flnews
49
+ `configuration`_ file. As a result, posts to a French newsgroup, for example,
50
+ may start with an introduction in English. The post-processor can address
51
+ this by setting specific introductory lines for each newsgroup.
52
+
53
+ * Similar issues arise when you set a standard signature and want it to vary
54
+ based on the newsgroup. The post-processor allows different signatures to be
55
+ used for different newsgroups, and you can even randomize the selection from
56
+ a list of signatures stored in a file.
57
+
58
+ * Custom headers, such as GnuPG key IDs or your language proficiency, can also
59
+ be added to posts, though signatures may be a better alternative. Custom
60
+ headers can be defined in the `configuration`_ file and will be added to
61
+ outgoing posts.
62
+
63
+ * Headers like "Archive" and "X-No-Archive" are sometimes set to prevent an
64
+ article from being indexed by search engines (e.g., Google). For example,
65
+ test posts likely don't need to be included in search results. The
66
+ post-processor can apply both headers to all posts sent to certain
67
+ newsgroups.
68
+
69
+ **NOTE**: As of 2024, the "X-No-Archive" header has limited effectiveness,
70
+ and it is up to server operators whether or not to honor it.
71
+
72
+ * Posts that include many references to other posts or URLs can become
73
+ cluttered. The post-processor can convert marked text into footnotes, similar
74
+ to the <ref/> link format used in Wikipedia, with the delimiter configurable
75
+ in the `configuration`_ file.
76
+ Example (using %=): "This is an object %=and this becomes the footnote,
77
+ describing the object further=%"
66
78
 
67
79
  Dialog for Overriding Settings
68
80
  ------------------------------
69
- **IMPORTANT**: As of version 1.72, YAD or Zenity cannot be used for the dialog interface.
81
+ **IMPORTANT**: As of version 1.72, YAD or Zenity cannot be used for the dialog
82
+ interface.
70
83
 
71
- Before the post-processor runs, a dialog can be displayed to allow users to **disable**
72
- certain configuration options. If Whiptail or xterm are available, you can choose to
73
- disable the following options. You **cannot** enable options that haven't already been set
74
- in the configuration.
84
+ Before the post-processor runs, a dialog can be displayed to allow users to
85
+ **disable** certain `configuration`_ options. If Whiptail or xterm are available,
86
+ you can choose to disable the following options. You **cannot** enable options
87
+ that haven't already been set in the `configuration`_.
75
88
 
76
- * Signatures (if set in the configuration) can be **ignored**. A default signature will
77
- be used, or no signature at all.
89
+ * Signatures (if set in the `configuration`_) can be **ignored**. A default
90
+ signature will be used, or no signature at all.
78
91
  * Custom headers can be **omitted**.
79
- * The "Archive" and "X-No-Archive" headers can be **ignored** if set for the current
80
- newsgroup.
92
+ * The "Archive" and "X-No-Archive" headers can be **ignored** if set for the
93
+ current newsgroup.
81
94
  * Logging can be **disabled**, if enabled.
82
95
 
83
- Pressing Esc or the Cancel button on the dialog will interrupt the process, and flnews
84
- will not post the article.
96
+ Pressing Esc or the Cancel button on the dialog will interrupt the process, and
97
+ flnews will not post the article.
85
98
 
86
- To disable the dialog entirely (and apply all configured options without further interaction),
87
- set the **OVERRIDE_CONFIG** option.
99
+ To disable the dialog entirely (and apply all configured options without
100
+ further interaction), set the **OVERRIDE_CONFIG** option.
88
101
 
89
102
  CONFIGURATION
90
103
  ===============
91
- Upon first execution of the program, a copy of the original configuration file is created
92
- in */home/[user]/.flnews_post_proc.conf*. This file is used thereafter. Deleting it will
93
- cause the file to be recreated, but any custom changes will be lost.
104
+ Upon first execution of the program, a copy of the original configuration file
105
+ is created in */home/[user]/.flnews_post_proc.conf*. This file is used
106
+ thereafter. Deleting it will cause the file to be recreated, but any custom
107
+ changes will be lost.
94
108
 
95
- The configuration file uses YAML syntax and includes detailed explanations. The variables
96
- within it fall into two categories:
109
+ The configuration file uses YAML syntax and includes detailed explanations. The
110
+ variables within it fall into two categories:
111
+
112
+ 1. Variables that represent values originally set by flnews, which can be used
113
+ or replaced. These elements are typically captured using regular
114
+ expressions.
97
115
 
98
- 1. Variables that represent values originally set by flnews, which can be used or replaced.
99
- These elements are typically captured using regular expressions.
100
116
  2. Variables that define new or modified content.
101
117
 
102
- Example Configuration Variables
118
+ Configuration Options
103
119
  -------------------------------
104
120
 
105
- **FUP_NAME**
106
- A regular expression that matches the name of the previous poster in a quoted post. This
107
- string is recognized in the original article and used with the matching element from
108
- *GROUP_INTRO*.
109
-
110
- Leave this field empty to retain the default value from the FLNews configuration.
111
-
112
- CONTENT: A string representing a regular expression.
121
+ .. empty lines in the following definition list are in reality '\ '
113
122
 
114
- DEFAULT: EMPTY
115
-
116
- EXAMPLE1: "On \\\\d+.\\\\d+.\\\\d{2,4} at \\\\d+:\\\\d+ **(.*)** wrote:"
123
+ **FUP_NAME**
117
124
 
118
- EXAMPLE2: "**(.*)** wrote:"
125
+ A regular expression that matches the name of the previous poster in a
126
+ quoted post. This string is recognized in the original article and used
127
+ with the matching element from `GROUP_INTROS`_.
128
+
129
+ Leave this field empty to retain the default value from the FLNews
130
+ configuration.
131
+
132
+ CONTENT: A string representing a regular expression.
133
+
134
+ DEFAULT: EMPTY
135
+
136
+ EXAMPLE1: "On \\\\d+.\\\\d+.\\\\d{2,4} at \\\\d+:\\\\d+ **(.*)** wrote:"
137
+
138
+ EXAMPLE2: "**(.*)** wrote:"
139
+
140
+ .. _fup_group:
119
141
 
120
142
  **FUP_GROUP**
121
- A regular expression that matches the newsgroup where the quoted post was published.
122
-
123
- Leave this field empty to ignore the exact group.
124
-
125
- CONTENT: A string representing a regular expression.
126
143
 
127
- DEFAULT: EMPTY
144
+ A regular expression that matches the newsgroup where the quoted post was
145
+ published.
146
+
147
+ Leave this field empty to ignore the exact group.
148
+
149
+ CONTENT: A string representing a regular expression.
150
+
151
+ DEFAULT: EMPTY
152
+
153
+ EXAMPLE: "wrote in **(.*)**:"
128
154
 
129
- EXAMPLE: "wrote in **(.*)**:"
155
+ .. _group_intros:
130
156
 
131
157
  **GROUP_INTROS**
132
- Introductory strings referring to the previous poster in a quoted post. When the newsgroup
133
- matches *FUP_GROUP*, these variables are used in the resulting introduction.
134
158
 
135
- CONTENT: A newsgroup or regular expression per line, followed by a colon, space, and string.
136
-
137
- DEFAULT: As configured in FLNews.
138
-
139
- EXAMPLE: alt.test: "Thus spoke %fup_name% on that baleful %fup_date%:"
159
+ Introductory strings referring to the previous poster in a quoted post.
160
+ When the newsgroup matches `FUP_GROUP`_, these variables are used in the
161
+ resulting introduction.
162
+
163
+ CONTENT: A newsgroup or regular expression per line, followed by a colon,
164
+ space, and string.
165
+
166
+ DEFAULT: As configured in FLNews.
167
+
168
+ EXAMPLE: alt.test: "Thus spoke %fup_name% on that baleful %fup_date%:"
140
169
 
141
170
  **GROUP_SIGS**
142
- Signature lines for each newsgroup or a path to a file containing signatures, which should be
143
- formatted and separated by one empty line. A random signature is picked from the file for each
144
- newsgroup. You can also source another file within the signature file by starting a line with
145
- ". /path/to/other/file".
146
171
 
147
- CONTENT: A newsgroup or regular expression per line, followed by a colon, space, and string.
172
+ Signature lines for each newsgroup or a path to a file containing
173
+ signatures, which should be formatted and separated by one empty line. A
174
+ random signature is picked from the file for each newsgroup. You can also
175
+ source another file within the signature file by starting a line with
176
+ ". /path/to/other/file".
177
+
178
+ CONTENT: A newsgroup or regular expression per line, followed by a colon,
179
+ \ \ \ \ space, and string.
180
+
181
+ DEFAULT: As configured in flnews.
148
182
 
149
- DEFAULT: As configured in flnews.
183
+ EXAMPLE::
150
184
 
151
- EXAMPLE: alt.test: "Signature for alt.test\\r\\nsecond line"
152
- EXAMPLE: comp.*: /home/[user]/.my_sigs
185
+ alt.test: "Signature for alt.test\\r\\nsecond line"
186
+ comp.*: /home/[user]/.my_sigs
153
187
 
154
188
  **CUSTOM_HEADERS**
155
- Additional custom headers to be added to outgoing articles.
156
189
 
157
- CONTENT: One line per header, starting with a dash and space, followed by the header name and value.
190
+ Additional custom headers to be added to outgoing articles.
191
+
192
+ CONTENT: One line per header, starting with a dash and space, followed by
193
+ the header name and value.
194
+
195
+ DEFAULT: Undefined
196
+
197
+ EXAMPLE::
158
198
 
159
- DEFAULT: Undefined
160
-
161
- EXAMPLE:
162
- - 'X-My-Header: nothing fancy'
163
- - 'X-Another-Header: care not!'
199
+ - 'X-My-Header: nothing fancy'
200
+ - 'X-Another-Header: care not!'
164
201
 
165
202
  **NO_ARCHIVE_GROUPS**
166
- Newsgroups where the "Archive: no" and "X-No-Archive: YES" headers should be set.
167
-
168
- CONTENT: A line with a dash and space, followed by the group name or a regular expression.
169
203
 
170
- DEFAULT: Empty
204
+ Newsgroups where the "Archive: no" and "X-No-Archive: YES" headers should
205
+ be set.
206
+
207
+ CONTENT: A line with a dash and space, followed by the group name or a
208
+ regular expression.
209
+
210
+ DEFAULT: Empty
211
+
212
+ EXAMPLE::
171
213
 
172
- EXAMPLE:
173
- - "alt.test"
174
- - "^news.*"
214
+ - "alt.test"
215
+ - "^news.*"
175
216
 
176
217
  **DEBUG_LOG**
177
- The name of the file where debug messages are logged. If specified, logging will be enabled.
178
- If empty, logging is disabled.
179
218
 
180
- CONTENT: The name of a writable file, which will be created if it doesn't exist and overwritten if necessary.
181
-
182
- DEFAULT: Empty
183
-
184
- EXAMPLE: '/tmp/a_log-file.txt'
219
+ The name of the file where debug messages are logged. If specified, logging
220
+ will be enabled. If empty, logging is disabled.
221
+
222
+ CONTENT: The name of a writable file, which will be created if it doesn't
223
+ exist and overwritten if necessary.
224
+
225
+ DEFAULT: Empty
226
+
227
+ EXAMPLE: '/tmp/a_log-file.txt'
185
228
 
186
229
  **LOG LEVEL**
187
- One of: debug, fatal, error, info, warn.
188
-
189
- **REFERENCES_SEPARATOR**
190
- A symbol or sequence marking the end of the message body and the beginning of a footnote list.
191
- If not defined, footnotes are appended directly after the message body.
192
230
 
193
- CONTENT: A quoted symbol or sequence.
231
+ One of: debug, fatal, error, info, warn.
194
232
 
195
- DEFAULT: Empty
233
+ **REFERENCES_SEPARATOR**
196
234
 
197
- EXAMPLE: '---------'
235
+ A symbol or sequence marking the end of the message body and the beginning
236
+ of a footnote list. If not defined, footnotes are appended directly after
237
+ the message body.
238
+
239
+ CONTENT: A quoted symbol or sequence.
240
+
241
+ DEFAULT: Empty
242
+
243
+ EXAMPLE: '---------'
198
244
 
199
245
  **REFERENCES_DELIMITER**
200
- A sequence marking the beginning and end of text to be used as a footnote or reference. The reversed
201
- sequence is used to mark the end.
202
-
203
- CONTENT: A quoted symbol or sequence.
204
246
 
205
- DEFAULT: None (empty)
206
-
207
- EXAMPLE: '%?'
247
+ A sequence marking the beginning and end of text to be used as a footnote
248
+ or reference. The reversed sequence is used to mark the end.
249
+
250
+ CONTENT: A quoted symbol or sequence.
251
+
252
+ DEFAULT: None (empty)
253
+
254
+ EXAMPLE: '%?'
208
255
 
209
256
  **REFERENCE_FORMAT**
210
- A format string using `%s` for a number to replace the reference text in the body.
211
-
212
- DEFAULT: " %s)" → becomes 1) ... 2) ... 3)
213
257
 
214
- EXAMPLE: "(%s)" becomes (1) ... (2) ... (3)
258
+ A format string using `%s` for a number to replace the reference text in
259
+ the body.
260
+
261
+ DEFAULT: " %s)" → becomes 1) ... 2) ... 3)
262
+
263
+ EXAMPLE: "(%s)" → becomes (1) ... (2) ... (3)
215
264
 
216
265
  **VFY_URLS**
217
- A boolean constant determining whether URLs should be verified and corrected if necessary.
218
- URL manipulations include adding angular brackets ('<', '>') and slashes after "http(s):".
219
266
 
220
- CONTENT: One of YES, yes, NO, no (case insensitive).
221
-
222
- DEFAULT: yes
223
-
224
- EXAMPLE: ... I leave this to your discretion.
267
+ A boolean constant determining whether URLs should be verified and
268
+ corrected if necessary. URL manipulations include adding angular brackets
269
+ ('<', '>') and slashes after "http(s):".
270
+
271
+ CONTENT: One of YES, yes, NO, no (case insensitive).
272
+
273
+ DEFAULT: yes
274
+
275
+ EXAMPLE: ... I leave this to your discretion.
225
276
 
226
277
  **OVERRIDE_CONFIG**
227
- A boolean constant that controls whether configuration options can be overridden before posting.
228
-
229
- Set this to "no" to disable the dialog.
230
-
231
- DEFAULT: yes
232
278
 
233
- EXAMPLE: No
279
+ A boolean constant that controls whether configuration options can be
280
+ overridden before posting.
281
+
282
+ Set this to "no" to disable the dialog.
283
+
284
+ DEFAULT: yes
285
+
286
+ EXAMPLE: No
234
287
 
235
288
  Other Information
236
289
  ========================
@@ -243,15 +296,21 @@ You can verify the post-processor’s effect by using one of two methods:
243
296
 
244
297
  **:~$ /usr/local/bin/[post-processor] < [test-article]**
245
298
 
246
- This will show the modified article, and you can pipe it into another file for further testing.
299
+ This will show the modified article, and you can pipe it into another file
300
+ for further testing.
247
301
 
248
- 2. Post directly to a test newsgroup (e.g., alt.test). This is essential before posting to
249
- real newsgroups, especially when the post-processor will alter the article.
302
+ 2. Post directly to a test newsgroup (e.g., alt.test). This is essential before
303
+ posting to real newsgroups, especially when the post-processor will alter
304
+ the article.
250
305
 
251
306
  Source Code
252
307
  -----------
253
- The gem file for the program, available via the gem utility or rubygems.org, contains all
254
- the source code and documentation (this page included). To extract it, do the following:
308
+
309
+ .. _rubygems.org: https://rubygems.org/gems/flnews_post_proc
310
+
311
+ The gem file for the program, available via the gem utility or `rubygems.org`_,
312
+ contains all the source code and documentation (this page included). To extract
313
+ it, do the following:
255
314
 
256
315
  1. Extract the gem file: `tar -xf flnews_post_proc-0.1.gem`
257
316
  2. Uncompress the data archive: `gunzip data.gz`
@@ -261,13 +320,16 @@ This will create the directories `bin`, `doc`, and `lib`.
261
320
 
262
321
  License
263
322
  -------
264
- The flnews_post_proc is distributed under the WTFPL-2.0 or later License.
265
- For more details, visit http://www.wtfpl.net/txt/copying/ or refer to the license file in the
266
- documentation directory of the gem.
323
+
324
+ .. _WTFPL-2.0: https://www.wtfpl.net/about/
325
+
326
+ The |program| is distributed under the `WTFPL-2.0`_ or later License. For
327
+ the complete license text, visit http://www.wtfpl.net/txt/copying/ or refer to
328
+ the license file in the documentation directory of the gem.
267
329
 
268
330
  Author
269
331
  ------
270
- flnews_post_proc has been developed by
332
+ |program| has been developed by
271
333
  Michael Uplawski <michael.uplawski@uplawski.eu>
272
334
 
273
335
  Ω
data/lib/newsgroups.rb CHANGED
@@ -116,7 +116,7 @@ class Newsgroups
116
116
  end # if no signature
117
117
  end # gsigs.each
118
118
  end # gsigs for group?
119
- if tsig && tsig.strip.start_with?('/')
119
+ if tsig && tsig.rstrip.start_with?('/')
120
120
  tsig = pick_sig(tsig.strip)
121
121
  end
122
122
  @signature = correct_linebreaks(tsig) if tsig
@@ -138,7 +138,7 @@ class Newsgroups
138
138
  ssigs = Array.new
139
139
  all_sigs = Array.new
140
140
  File::read(sigfile).split(delim).collect do |item|
141
- item.strip!
141
+ item.rstrip!
142
142
  # find a sourced file
143
143
  psrc = item.match(srcregex)
144
144
  if(psrc )
data/lib/version.rb CHANGED
@@ -14,9 +14,9 @@
14
14
  =end
15
15
 
16
16
  PROGNAME = 'flnews_post_proc'
17
- PROGVERSION = "1.75"
17
+ PROGVERSION = "1.80"
18
18
  AUTHORS = "Michael Uplawski"
19
19
  EMAIL = "michael.uplawski@uplawski.eu"
20
20
  YEARS = "2023 - 2025"
21
- SUMMARY = "new documentation- and homepage URIs"
21
+ SUMMARY = "Generation of documentation simplified. BUG in signatures corrected."
22
22
 
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.75'
4
+ version: '1.80'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Uplawski
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-08-27 00:00:00.000000000 Z
10
+ date: 2025-12-02 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: new documentation- and homepage URIs
106
+ summary: Generation of documentation simplified. BUG in signatures corrected.
107
107
  test_files: []