aboutsummaryrefslogtreecommitdiff
path: root/info2html
diff options
context:
space:
mode:
authorRodrigo Arias Mallo <rodarima@gmail.com>2025-03-08 14:27:34 +0100
committerRodrigo Arias Mallo <rodarima@gmail.com>2025-03-08 14:27:34 +0100
commitf1ba95d9c35f4777d0767c0054c1e85bc84e6516 (patch)
treec4b481c7ab0f04fc2d464e4d4fa2a25a4cf08ede /info2html
parent9b01b19d21cfa76d43e365bdf1b771c0c0b25124 (diff)
Inject CSS directly in the HTML
Diffstat (limited to 'info2html')
-rwxr-xr-xinfo2html6
1 files changed, 6 insertions, 0 deletions
diff --git a/info2html b/info2html
index 523133f..1015868 100755
--- a/info2html
+++ b/info2html
@@ -56,6 +56,9 @@ $CURRENT_PATH=dirname(__FILE__);
$INFO2HTMLCONF = $CURRENT_PATH."/info2html.conf";
require($INFO2HTMLCONF); #-- configuration settings
+$INFO2HTMLCSS = do { local(@ARGV, $/) = $CURRENT_PATH."/info2html.css"; <> };
+$CSS_STYLE="<style>\n$INFO2HTMLCSS\n</style>";
+
use URI::Escape;
#-- patterns
@@ -81,6 +84,7 @@ sub DieFileNotFound{
print <<"EOF";
<html><head><title>Info Files - Error Message</title>
$BOTS_STAY_AWAY
+$CSS_STYLE
$HTML_HEAD_STUFF</head><body class='error noopen'>
<h1>File IO Error</h1>
<p>The Info file could not be opened for reading.</p>
@@ -444,6 +448,7 @@ sub PrintHeader{
print <<"EOF";
<html><head><title>Info: ($BaseInfoFile) $LinkList[1]</title>
+$CSS_STYLE
$HTML_HEAD_STUFF</head><body class='node'>
EOF
@@ -493,6 +498,7 @@ sub ReplyNotFoundMessage{
print <<"EOF";
<html><head><title>Info Files - Error Message</title>
$BOTS_STAY_AWAY
+$CSS_STYLE
$HTML_HEAD_STUFF</head><body class='error nonesuch'>
<h1>Error: Page not found</h1>
<p>The Info node <q>$Tag</q> in Info file <em>$FileName</em>