@@ -969,9 +969,9 @@ sub write_html {
969
969
select TEXT;
970
970
&html_preamble(0);
971
971
print " <h2 class=\" index\" >Index</h2>\n " ;
972
- print " <ul class=\" index\" >\n " ;
972
+ print " <div class=\" index\" >\n " ;
973
973
&html_index;
974
- print " </ul> \n </body>\n </html>\n " ;
974
+ print " </div> \n \n </body>\n </html>\n " ;
975
975
select STDOUT ;
976
976
close TEXT;
977
977
}
@@ -982,6 +982,7 @@ sub html_preamble {
982
982
print " \" http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\" >\n " ;
983
983
print " <html xmlns=\" http://www.w3.org/1999/xhtml\" >\n " ;
984
984
print " <head>\n " ;
985
+ print " <meta charset=\" UTF-8\" />\n " ;
985
986
print " <title>" , $metadata {' title' }, " </title>\n " ;
986
987
print " <link href=\" nasmdoc.css\" rel=\" stylesheet\" type=\" text/css\" />\n " ;
987
988
print " <link href=\" local.css\" rel=\" stylesheet\" type=\" text/css\" />\n " ;
@@ -1017,11 +1018,12 @@ sub html_postamble {
1017
1018
sub html_index {
1018
1019
my $itag , $a , @ientry , $sep , $w , $wd , $wprev , $line ;
1019
1020
1021
+ print " <ul>\n " ;
1022
+
1020
1023
$chapternode = ' ' ;
1021
1024
foreach $itag (@itags ) {
1022
1025
$ientry = $idxmap {$itag };
1023
- @a = @$ientry ;
1024
- push @a , " n :" ;
1026
+ my @a = (' HDterm' , @$ientry , ' HDref' );
1025
1027
$sep = 0;
1026
1028
foreach $node (@nodes ) {
1027
1029
next if !$idxnodes {$node ,$itag };
@@ -1032,33 +1034,36 @@ sub html_index {
1032
1034
# makes it unnecessarily wide
1033
1035
$nn =~ s / ^.*\s +// g ; # Remove all but the actual index information
1034
1036
1035
- push @a , " n ," if $sep ;
1036
- push @a , " sp " , " x $xn " , " n $nn " , " xe$xn " ;
1037
+ push @a , ' n ,' , ' sp ' if $sep ;
1038
+ push @a , " x $xn " , " n $nn " , " xe$xn " ;
1037
1039
$sep = 1;
1038
1040
}
1039
- print " <li class=\" index\" >\n " ;
1040
- $line = ' ' ;
1041
- do {
1042
- do { $w = &word_html(shift @a ) } while $w eq " \001 " ; # nasty hack
1043
- $wd .= $wprev ;
1044
- if ($w eq ' ' || $w eq ' ' || $w eq undef ) {
1045
- if (length ($line . $wd ) > 75) {
1046
- $line =~ s /\s *$// ; # trim trailing spaces
1047
- print " $line \n " ;
1048
- $line = ' ' ;
1049
- $wd =~ s / ^\s *// ; # trim leading spaces
1041
+ print " <li>\n " ;
1042
+ while (defined ($w = shift (@a ))) {
1043
+ die unless ($w =~ / ^HD(.*)$ / );
1044
+ print " <div class=\" $1 \" >\n " ;
1045
+
1046
+ $line = ' ' ;
1047
+ while ($w ne ' ' && $a [0] !~ / ^HD/ ) {
1048
+ $w = &word_html(shift @a );
1049
+ next if ($w eq " \001 " ); # Nasty hack
1050
+
1051
+ if ($w =~ / ^\s *$ / && length ($line .$w ) > 75) {
1052
+ $line =~ s /\s *$// ; # trim trailing spaces
1053
+ print $line , " \n " ; $line = ' ' ;
1054
+ }
1055
+ $line .= $w ;
1050
1056
}
1051
- $line .= $wd ;
1052
- $wd = ' ' ;
1053
- }
1054
- $wprev = $w ;
1055
- } while ($w ne ' ' && $w ne undef );
1056
- if ($line =~ / \S / ) {
1057
- $line =~ s /\s *$// ; # trim trailing spaces
1058
- print $line , " \n " ;
1057
+ if ($line =~ / \S / ) {
1058
+ $line =~ s /\s *$// ; # trim trailing spaces
1059
+ print $line , " \n " ; $line = ' ' ;
1060
+ }
1061
+ print " </div>\n " ;
1059
1062
}
1060
1063
print " </li>\n " ;
1061
1064
}
1065
+
1066
+ print " </ul>\n " ;
1062
1067
}
1063
1068
1064
1069
sub word_html {
0 commit comments