Commit 5d93eef2 authored by Fred Drake's avatar Fred Drake

move table formatting for grammar productions from HTML to CSS

parent 5b000591
...@@ -108,6 +108,8 @@ div.note .label { margin-right: 0.5em; ...@@ -108,6 +108,8 @@ div.note .label { margin-right: 0.5em;
padding: 0.05in; } padding: 0.05in; }
.grammar-footer { padding: 0.05in; .grammar-footer { padding: 0.05in;
font-size: 85%; } font-size: 85%; }
.grammartoken { font-family: "lucida typewriter", lucidatypewriter,
monospace; }
.productions { background-color: #bbeeff; } .productions { background-color: #bbeeff; }
.productions a:active { color: #ff0000; } .productions a:active { color: #ff0000; }
...@@ -115,7 +117,28 @@ div.note .label { margin-right: 0.5em; ...@@ -115,7 +117,28 @@ div.note .label { margin-right: 0.5em;
.productions a:visited:hover { background-color: #99ccff; } .productions a:visited:hover { background-color: #99ccff; }
.productions a:visited { color: #551a8b; } .productions a:visited { color: #551a8b; }
.productions a:link { color: #0000bb; } .productions a:link { color: #0000bb; }
.productions table { vertical-align: baseline; } .productions table { vertical-align: baseline;
empty-cells: show; }
.productions > table td,
.productions > table th { padding: 2px; }
.productions > table td:first-child,
.productions > table td:last-child {
font-family: "lucida typewriter",
lucidatypewriter,
monospace;
}
/* same as the second selector above, but expressed differently for Opera */
.productions > table td:first-child + td + td {
font-family: "lucida typewriter",
lucidatypewriter,
monospace;
vertical-align: baseline;
}
.productions > table td:first-child + td {
padding-left: 1em;
padding-right: 1em;
}
.productions > table tr { vertical-align: baseline; }
.email { font-family: avantgarde, sans-serif; } .email { font-family: avantgarde, sans-serif; }
.mailheader { font-family: avantgarde, sans-serif; } .mailheader { font-family: avantgarde, sans-serif; }
......
...@@ -791,7 +791,7 @@ sub do_cmd_token{ ...@@ -791,7 +791,7 @@ sub do_cmd_token{
} }
$BackpatchGrammarFiles{"$CURRENT_FILE"} = 1; $BackpatchGrammarFiles{"$CURRENT_FILE"} = 1;
} }
return "<a href=\"$target\">$token</a>" . $_; return "<a class='grammartoken' href=\"$target\">$token</a>" . $_;
} }
sub do_cmd_grammartoken{ sub do_cmd_grammartoken{
...@@ -809,7 +809,7 @@ sub do_env_productionlist{ ...@@ -809,7 +809,7 @@ sub do_env_productionlist{
$DefinedGrammars{$lang} .= $_; $DefinedGrammars{$lang} .= $_;
return ("<dl><dd class=\"grammar\">\n" return ("<dl><dd class=\"grammar\">\n"
. "<div class=\"productions\">\n" . "<div class=\"productions\">\n"
. "<table cellpadding=\"2\">\n" . "<table>\n"
. translate_commands(translate_environments($_)) . translate_commands(translate_environments($_))
. "</table>\n" . "</table>\n"
. "</div>\n" . "</div>\n"
...@@ -828,12 +828,12 @@ sub do_cmd_production{ ...@@ -828,12 +828,12 @@ sub do_cmd_production{
my $lang = $CURRENT_GRAMMAR; my $lang = $CURRENT_GRAMMAR;
local($CURRENT_TOKEN) = $token; local($CURRENT_TOKEN) = $token;
if ($lang eq '*') { if ($lang eq '*') {
return ("<tr valign=\"baseline\">\n" return ("<tr>\n"
. " <td><code>$token</code></td>\n" . " <td>$token</td>\n"
. " <td>&nbsp;::=&nbsp;</td>\n" . " <td>::=</td>\n"
. " <td><code>" . " <td>"
. translate_commands($defn) . translate_commands($defn)
. "</code></td></tr>" . "</td></tr>"
. $_); . $_);
} }
my $target; my $target;
...@@ -844,13 +844,13 @@ sub do_cmd_production{ ...@@ -844,13 +844,13 @@ sub do_cmd_production{
$target = "$CURRENT_FILE\#tok-$lang-$token"; $target = "$CURRENT_FILE\#tok-$lang-$token";
} }
$TokenToTargetMapping{"$CURRENT_GRAMMAR:$token"} = $target; $TokenToTargetMapping{"$CURRENT_GRAMMAR:$token"} = $target;
return ("<tr valign=\"baseline\">\n" return ("<tr>\n"
. " <td><code><a id='tok-$token' xml:id='tok-$token'>" . " <td><a id='tok-$token' xml:id='tok-$token'>"
. "$token</a></code></td>\n" . "$token</a></td>\n"
. " <td>&nbsp;::=&nbsp;</td>\n" . " <td>::=</td>\n"
. " <td><code>" . " <td>"
. translate_commands($defn) . translate_commands($defn)
. "</code></td></tr>" . "</td></tr>"
. $_); . $_);
} }
...@@ -858,9 +858,9 @@ sub do_cmd_productioncont{ ...@@ -858,9 +858,9 @@ sub do_cmd_productioncont{
local($_) = @_; local($_) = @_;
my $defn = next_argument(); my $defn = next_argument();
$defn =~ s/^( +)/'&nbsp;' x length $1/e; $defn =~ s/^( +)/'&nbsp;' x length $1/e;
return ("<tr valign=\"baseline\">\n" return ("<tr>\n"
. " <td>&nbsp;</td>\n" . " <td></td>\n"
. " <td>&nbsp;</td>\n" . " <td></td>\n"
. " <td><code>" . " <td><code>"
. translate_commands($defn) . translate_commands($defn)
. "</code></td></tr>" . "</code></td></tr>"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment