From 7099ae0466a6003f789393f3494c28980ddb0103 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Tue, 22 Jul 2014 19:55:44 +0200 Subject: [PATCH 1/3] Disable -nolinks for lynx-generated text FAQ This way lynx also emits URLs for references at the bottom, like elinks does. The formating is a little different though (word wrapping), and elinks adds a "Visible links" line as well. --- autogen.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autogen.sh b/autogen.sh index cf4b9798..d65bdede 100755 --- a/autogen.sh +++ b/autogen.sh @@ -28,7 +28,7 @@ cat docs/help/Makefile.am.gen|sed "s/@HELPFILES@/$files/g"|sed 's/?/\\?/g'|tr '! # .html -> .txt with lynx or elinks echo "Documentation: html -> txt..." if type lynx >/dev/null 2>&1 ; then - lynx -dump -nolist docs/faq.html|perl -pe 's/^ *//; if ($_ eq "\n" && $state eq "Q") { $_ = ""; } elsif (/^([QA]):/) { $state = $1 } elsif ($_ ne "\n") { $_ = " $_"; };' > docs/faq.txt + lynx -dump docs/faq.html|perl -pe 's/^ *//; if ($_ eq "\n" && $state eq "Q") { $_ = ""; } elsif (/^([QA]):/) { $state = $1 } elsif ($_ ne "\n") { $_ = " $_"; };' > docs/faq.txt elif type elinks >/dev/null 2>&1 ; then elinks -dump docs/faq.html|perl -pe 's/^ *//; if ($_ eq "\n" && $state eq "Q") { $_ = ""; } elsif (/^([QA]):/) { $state = $1 } elsif ($_ ne "\n") { $_ = " $_"; };' > docs/faq.txt else From 103b0e22eb7a463ee22398132449a05de96cada3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Tue, 22 Jul 2014 19:58:51 +0200 Subject: [PATCH 2/3] Force default locale when calling lynx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Else it ends up saying "Références" or other translation for the word. Might want to do the same for elinks... --- autogen.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autogen.sh b/autogen.sh index d65bdede..b0bd2159 100755 --- a/autogen.sh +++ b/autogen.sh @@ -28,7 +28,7 @@ cat docs/help/Makefile.am.gen|sed "s/@HELPFILES@/$files/g"|sed 's/?/\\?/g'|tr '! # .html -> .txt with lynx or elinks echo "Documentation: html -> txt..." if type lynx >/dev/null 2>&1 ; then - lynx -dump docs/faq.html|perl -pe 's/^ *//; if ($_ eq "\n" && $state eq "Q") { $_ = ""; } elsif (/^([QA]):/) { $state = $1 } elsif ($_ ne "\n") { $_ = " $_"; };' > docs/faq.txt + LC_ALL=C lynx -dump docs/faq.html|perl -pe 's/^ *//; if ($_ eq "\n" && $state eq "Q") { $_ = ""; } elsif (/^([QA]):/) { $state = $1 } elsif ($_ ne "\n") { $_ = " $_"; };' > docs/faq.txt elif type elinks >/dev/null 2>&1 ; then elinks -dump docs/faq.html|perl -pe 's/^ *//; if ($_ eq "\n" && $state eq "Q") { $_ = ""; } elsif (/^([QA]):/) { $state = $1 } elsif ($_ ne "\n") { $_ = " $_"; };' > docs/faq.txt else From 9d4ea891b91b6cf514a3c70dc68a22feafb17d8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Tue, 22 Jul 2014 01:38:13 +0200 Subject: [PATCH 3/3] Also try links for docs generation Haiku has links (links2) but not elinks. Links doesn't seem to generate references however, but it's the 2nd fallback so it's better than nothing. --- autogen.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/autogen.sh b/autogen.sh index b0bd2159..466a5a05 100755 --- a/autogen.sh +++ b/autogen.sh @@ -31,6 +31,8 @@ if type lynx >/dev/null 2>&1 ; then LC_ALL=C lynx -dump docs/faq.html|perl -pe 's/^ *//; if ($_ eq "\n" && $state eq "Q") { $_ = ""; } elsif (/^([QA]):/) { $state = $1 } elsif ($_ ne "\n") { $_ = " $_"; };' > docs/faq.txt elif type elinks >/dev/null 2>&1 ; then elinks -dump docs/faq.html|perl -pe 's/^ *//; if ($_ eq "\n" && $state eq "Q") { $_ = ""; } elsif (/^([QA]):/) { $state = $1 } elsif ($_ ne "\n") { $_ = " $_"; };' > docs/faq.txt +elif type links >/dev/null 2>&1 ; then + links -dump docs/faq.html|perl -pe 's/^ *//; if ($_ eq "\n" && $state eq "Q") { $_ = ""; } elsif (/^([QA]):/) { $state = $1 } elsif ($_ ne "\n") { $_ = " $_"; };' > docs/faq.txt else echo "**Error**: No lynx or elinks present" exit 1