txt2html: support extracting publish/update dates (now restored)
authorAmin Bandali <bandali@gnu.org>
Sun, 10 Oct 2021 15:09:55 +0000 (11:09 -0400)
committerAmin Bandali <bandali@gnu.org>
Sun, 10 Oct 2021 15:09:55 +0000 (11:09 -0400)
bandali-computing.txt
fa/bandali-computing.fa.txt
fa/fsf-internship-beyond.fa.txt
fa/fsf-internship-intro.fa.txt
fsf-internship-beyond.txt
fsf-internship-intro.txt
libreplanet-2021.txt
txt2html

index a6d1a35..2ce768b 100644 (file)
@@ -59,4 +59,6 @@ are permitted in any medium without royalty provided the copyright
 notice and this notice are preserved.  This file is offered as-is,
 without any warranty.
 
+updated: 2021-02-28
+published: 2019-09-14
 plain text: https://bndl.org/bandali-computing.txt
index f22e74f..42fc537 100644 (file)
@@ -62,4 +62,6 @@ without any warranty.
 و در هر رسانه‌ای مجاز است، به این شرط که اعلان حق تکثیر و این اعلان حفظ
 شوند.  این پرونده به صورت موجود و بدون هیچ گونه ضمانت ارائه می‌شود.
 
+ویرایش: 2021-02-28
+انتشار: 2019-09-14
 متن ساده: https://bndl.org/fa/bandali-computing.fa.txt
index b529d8d..1c75f4a 100644 (file)
@@ -98,4 +98,5 @@ without any warranty.
 و در هر رسانه‌ای مجاز است، به این شرط که اعلان حق تکثیر و این اعلان حفظ
 شوند.  این پرونده به صورت موجود و بدون هیچ گونه ضمانت ارائه می‌شود.
 
+انتشار: 2020-12-18
 متن ساده: https://bndl.org/fa/fsf-internship-beyond.fa.txt
index 1f14dfe..e03f7aa 100644 (file)
@@ -76,4 +76,5 @@ without any warranty.
 و در هر رسانه‌ای مجاز است، به این شرط که اعلان حق تکثیر و این اعلان حفظ
 شوند.  این پرونده به صورت موجود و بدون هیچ گونه ضمانت ارائه می‌شود.
 
+انتشار: 2020-05-29
 متن ساده: https://bndl.org/fa/fsf-internship-intro.fa.txt
index 97253b9..cc140db 100644 (file)
@@ -110,4 +110,5 @@ are permitted in any medium without royalty provided the copyright
 notice and this notice are preserved.  This file is offered as-is,
 without any warranty.
 
+published: 2020-12-18
 plain text: https://bndl.org/fsf-internship-beyond.txt
index 4ea77bc..afba902 100644 (file)
@@ -76,4 +76,5 @@ are permitted in any medium without royalty provided the copyright
 notice and this notice are preserved.  This file is offered as-is,
 without any warranty.
 
+published: 2020-05-29
 plain text: https://bndl.org/fsf-internship-intro.txt
index ebece7c..2bca77e 100644 (file)
@@ -77,4 +77,6 @@ are permitted in any medium without royalty provided the copyright
 notice and this notice are preserved.  This file is offered as-is,
 without any warranty.
 
+updated: 2021-03-21
+published: 2021-03-20
 plain text: https://bndl.org/libreplanet-2021.txt
index 10de15d..e6dc30b 100644 (file)
--- a/txt2html
+++ b/txt2html
@@ -96,6 +96,7 @@ sub linkify {
 
 
 my $txt = do { local $/; <STDIN> };
+
 my $title = html_esc($txt =~ /\A([^\n]+)/);
 $title =~ s/^\s+|\s+$//g;
 if ($opt_lang eq 'fa') {
@@ -103,7 +104,11 @@ if ($opt_lang eq 'fa') {
 } else {
     $title .= ' &mdash; bandali' if $title !~ /bandali/;
 }
-my ($url) = $txt =~ /(?:plain text|متن ساده): (.*)\r?\n?\z/;
+
+my ($upd, $pub, $url) = $txt =~ /(.*)\r?\n(.*)\r?\n(.*)\r?\n?\z/;
+($upd) = $upd =~ /(?:updated|ویرایش): (.*)/ if $upd;
+($pub) = $pub =~ /(?:published|انتشار): (.*)/ if $pub;
+($url) = $url =~ /(?:plain text|متن ساده): (.*)/ if $url;
 $url = 'https://bndl.org/bandali-cv.txt'
     if (!$url and $title =~ /curriculum vitae/);
 $url = html_esc($url) if $url;