mirror of
https://github.com/cc65/cc65.git
synced 2024-09-29 17:56:21 +00:00
Applied Magervalps colorization changes with some minor modifications.
Colorization is now done by using CSS style sheets, so even colorized pages are valid HTML. git-svn-id: svn://svn.cc65.org/cc65/trunk@3788 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
363ff21b9c
commit
24709a67d7
@ -180,22 +180,60 @@ sub StripPath {
|
|||||||
sub DocHeader {
|
sub DocHeader {
|
||||||
my $OUT = shift (@_);
|
my $OUT = shift (@_);
|
||||||
my $Asm = shift (@_);
|
my $Asm = shift (@_);
|
||||||
if (not $Colorize) {
|
print $OUT "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
|
||||||
# Colorization generates invalid HTML. Common browsers display it
|
|
||||||
# correctly, but we don't claim it adheres to some standard ...
|
|
||||||
print $OUT "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n";
|
|
||||||
}
|
|
||||||
print $OUT <<"EOF";
|
print $OUT <<"EOF";
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||||
<meta name="GENERATOR" content="ca65html">
|
<meta name="GENERATOR" content="ca65html">
|
||||||
<title>$Asm</title>
|
<title>$Asm</title>
|
||||||
|
<style type=\"text/css\">
|
||||||
|
body {
|
||||||
|
background-color: $BGColor;
|
||||||
|
color: $TextColor;
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
#top {
|
||||||
|
margin: 2em 0 3em 0;
|
||||||
|
border-bottom: 1px solid grey;
|
||||||
|
}
|
||||||
|
#bottom {
|
||||||
|
margin: 3em 0 1em 0;
|
||||||
|
padding-top: 1em;
|
||||||
|
border-top: 1px solid grey;
|
||||||
|
}
|
||||||
|
img {
|
||||||
|
border: 0;
|
||||||
|
margin: 0;
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
.ctrl {
|
||||||
|
color: $CtrlColor;
|
||||||
|
}
|
||||||
|
.keyword {
|
||||||
|
color: $KeywordColor;
|
||||||
|
}
|
||||||
|
.string {
|
||||||
|
color: $StringColor;
|
||||||
|
}
|
||||||
|
.comment {
|
||||||
|
color: $CommentColor;
|
||||||
|
}
|
||||||
|
a:link {
|
||||||
|
color: #0000d0;
|
||||||
|
}
|
||||||
|
a:visited {
|
||||||
|
color: #000060;
|
||||||
|
}
|
||||||
|
a:active {
|
||||||
|
color: #00d0d0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body bgcolor="$BGColor" text="$TextColor" link="#0000d0" vlink="#000060" alink="#00d0d0">
|
<body>
|
||||||
<p><br><p>
|
<div id=\"top\"><h1>$Asm</h1></div>
|
||||||
<center><h1>$Asm</h1></center>
|
|
||||||
<hr size="1" noshade><p><br><p>
|
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,15 +246,13 @@ sub DocFooter {
|
|||||||
my $Today = localtime;
|
my $Today = localtime;
|
||||||
|
|
||||||
# Print
|
# Print
|
||||||
print $OUT "<p><br><p>\n";
|
print $OUT "<div id=\"bottom\">\n";
|
||||||
print $OUT "<hr size=\"1\" noshade>\n";
|
|
||||||
print $OUT "<address>\n";
|
print $OUT "<address>\n";
|
||||||
if (not $Colorize) {
|
print $OUT "<a href=\"http://validator.w3.org/check?uri=referer\"><img src=\"http://www.w3.org/Icons/valid-xhtml10-blue\" alt=\"Valid XHTML 1.0 Strict\" height=\"31\" width=\"88\" /></a>";
|
||||||
print $OUT "<a href=\"http://validator.w3.org/check/referer\"><img border=\"0\" src=\"http://www.w3.org/Icons/valid-html401\" alt=\"Valid HTML 4.01!\" height=\"31\" width=\"88\" align=\"right\"></a>\n";
|
|
||||||
}
|
|
||||||
print $OUT "$Name; generated on $Today by ca65html<br>\n";
|
print $OUT "$Name; generated on $Today by ca65html<br>\n";
|
||||||
print $OUT "<a href=\"mailto:uz@cc65.org\">uz@cc65.org</a>\n";
|
print $OUT "<a href=\"mailto:uz@cc65.org\">uz@cc65.org</a>\n";
|
||||||
print $OUT "</address>\n";
|
print $OUT "</address>\n";
|
||||||
|
print $OUT "</div>\n";
|
||||||
print $OUT "</body>\n";
|
print $OUT "</body>\n";
|
||||||
print $OUT "</html>\n";
|
print $OUT "</html>\n";
|
||||||
}
|
}
|
||||||
@ -231,7 +267,7 @@ sub DocFooter {
|
|||||||
|
|
||||||
sub ColorizeComment {
|
sub ColorizeComment {
|
||||||
if ($Colorize && $_[0] ne "") {
|
if ($Colorize && $_[0] ne "") {
|
||||||
return "<font color=\"$CommentColor\">$_[0]</font>";
|
return "<span class=\"comment\">$_[0]</span>";
|
||||||
} else {
|
} else {
|
||||||
return $_[0];
|
return $_[0];
|
||||||
}
|
}
|
||||||
@ -241,7 +277,7 @@ sub ColorizeComment {
|
|||||||
|
|
||||||
sub ColorizeCtrl {
|
sub ColorizeCtrl {
|
||||||
if ($Colorize) {
|
if ($Colorize) {
|
||||||
return "<font color=\"$CtrlColor\">$_[0]</font>";
|
return "<span class=\"ctrl\">$_[0]</span>";
|
||||||
} else {
|
} else {
|
||||||
return $_[0];
|
return $_[0];
|
||||||
}
|
}
|
||||||
@ -251,7 +287,7 @@ sub ColorizeCtrl {
|
|||||||
|
|
||||||
sub ColorizeKeyword {
|
sub ColorizeKeyword {
|
||||||
if ($Colorize) {
|
if ($Colorize) {
|
||||||
return "<font color=\"$KeywordColor\">$_[0]</font>";
|
return "<span class=\"keyword\">$_[0]</span>";
|
||||||
} else {
|
} else {
|
||||||
return $_[0];
|
return $_[0];
|
||||||
}
|
}
|
||||||
@ -261,7 +297,7 @@ sub ColorizeKeyword {
|
|||||||
|
|
||||||
sub ColorizeString {
|
sub ColorizeString {
|
||||||
if ($Colorize) {
|
if ($Colorize) {
|
||||||
return "<font color=\"$StringColor\">$_[0]</font>";
|
return "<span class=\"string\">$_[0]</span>";
|
||||||
} else {
|
} else {
|
||||||
return $_[0];
|
return $_[0];
|
||||||
}
|
}
|
||||||
@ -385,7 +421,7 @@ sub Process1 {
|
|||||||
while ($Line = <INPUT>) {
|
while ($Line = <INPUT>) {
|
||||||
|
|
||||||
# Remove the newline
|
# Remove the newline
|
||||||
chop ($Line);
|
chomp ($Line);
|
||||||
|
|
||||||
# Check for a label
|
# Check for a label
|
||||||
if ($Line =~ /^\s*(\@?)([_a-zA-Z]\w*)(:(?!=)|\s*:?=)/) {
|
if ($Line =~ /^\s*(\@?)([_a-zA-Z]\w*)(:(?!=)|\s*:?=)/) {
|
||||||
@ -520,7 +556,7 @@ sub Process2 {
|
|||||||
$LineNo++;
|
$LineNo++;
|
||||||
|
|
||||||
# Remove the newline
|
# Remove the newline
|
||||||
chop ($Line);
|
chomp ($Line);
|
||||||
|
|
||||||
# If requested, convert tabs to spaces
|
# If requested, convert tabs to spaces
|
||||||
if ($CvtTabs) {
|
if ($CvtTabs) {
|
||||||
|
Loading…
Reference in New Issue
Block a user