Merge branch 'master' of ssh://repo.or.cz/nasm

This commit is contained in:
H. Peter Anvin 2017-04-17 13:57:59 -07:00
commit ef1ea87c3c
5 changed files with 35 additions and 14 deletions

View File

@ -24,6 +24,10 @@ PDFOPT = @PDFOPT@
RM_F = rm -f
RM_RF = rm -rf
CP_F = cp -f
CP_UF = cp -ufv
# Auxiliary files referenced by the HTML files
HTMLAUX = nasmdoc.css local.css nasmlogw.png
SRCS = nasmdoc.src inslist.src changes.src version.src
OUT = html nasmdoc.txt nasmdoc.pdf
@ -36,9 +40,10 @@ inslist.src: inslist.pl ../x86/insns.dat
$(PERL) $(srcdir)/inslist.pl $(srcdir)/../x86/insns.dat
.PHONY: html
html: $(SRCS) rdsrc.pl nasmdoc.css nasmlogw.png
html: $(HTMLAUX)
mkdir -p html
$(MAKE) html/nasmdoc0.html html/nasmdoc.css html/nasmlogw.png
for f in $(HTMLAUX); do $(CP_UF) "$(srcdir)/$$f" html/; done
$(MAKE) html/nasmdoc0.html
RDSRC = $(PERL) $(srcdir)/rdsrc.pl -I$(srcdir)/
@ -46,12 +51,6 @@ html/nasmdoc0.html: $(SRCS) rdsrc.pl
$(RM_F) html/*.html
$(RDSRC) -ohtml html nasmdoc.src
html/nasmdoc.css: nasmdoc.css
$(CP_F) $(srcdir)/nasmdoc.css html/nasmdoc.css
html/nasmlogw.png: nasmlogw.png
$(CP_F) $(srcdir)/nasmlogw.png html/nasmlogw.png
nasmdoc.dip: $(SRCS) rdsrc.pl
$(RDSRC) dip nasmdoc.src
@ -64,7 +63,8 @@ version.src: $(top_srcdir)/version.pl $(top_srcdir)/version
nasmdoc.ps: nasmdoc.dip genps.pl afmmetrics.ph ttfmetrics.ph \
pswidth.ph nasmlogo.eps psfonts.ph head.ps
$(PERL) $(srcdir)/genps.pl -headps $(srcdir)/head.ps nasmdoc.dip \
$(PERL) $(srcdir)/genps.pl -epsdir "$(srcdir)" \
-headps $(srcdir)/head.ps nasmdoc.dip \
> nasmdoc.ps
nasmdoc.pdf: nasmdoc.ps pspdf.pl

View File

@ -92,6 +92,10 @@ require 'findfont.ph'; # Find fonts in the system
# Canned header file
$headps = 'head.ps';
# Directories
$fontsdir = 'fonts';
$epsdir = File::Spec->curdir();
#
# Parse the command line
#
@ -107,11 +111,13 @@ while ( $arg = shift(@ARGV) ) {
$psbool{$parm} = $true;
} elsif ( $true && defined($psconf{$parm}) ) {
$psconf{$parm} = shift(@ARGV);
} elsif ( $parm =~ /^(title|subtitle|year|author|license)$/ ) {
} elsif ( $true && $parm =~ /^(title|subtitle|year|author|license)$/ ) {
$metadata{$parm} = shift(@ARGV);
} elsif ( $parm =~ /^fontsdir$/ ) {
} elsif ( $true && $parm eq 'fontsdir' ) {
$fontsdir = shift(@ARGV);
} elsif ( $parm eq 'headps' ) {
} elsif ( $true && $parm eq 'epsdir' ) {
$epsdir = shift(@ARGV);
} elsif ( $true && $parm eq 'headps' ) {
$headps = shift(@ARGV);
} else {
die "$0: Unknown option: $arg\n";
@ -1161,7 +1167,7 @@ print "sti show\n";
# and DocumentFonts in the header of the EPSF and add those to the
# global header.
if ( defined($metadata{epslogo}) &&
open(EPS, '<', $metadata{epslogo}) ) {
open(EPS, '<', File::Spec->catfile($epsdir, $metadata{epslogo})) ) {
my @eps = ();
my ($bbllx,$bblly,$bburx,$bbury) = (undef,undef,undef,undef);
my $line;

1
doc/local.css Normal file
View File

@ -0,0 +1 @@
/* Add site-local nasmdoc style configuration to this file */

View File

@ -3,8 +3,18 @@ body {
"arial", "sans-serif";
background: white;
}
h1 {
div.title {
text-align: center;
font-weight: bold;
margin: 0.67em 0;
}
h1 {
font-size: 2em;
margin: 0;
}
span.subtitle {
font-size: 1.25em;
font-style: italic;
}
code, pre {
font-family: "source code pro", "liberation mono", "monospace";

View File

@ -949,6 +949,7 @@ sub html_preamble {
print "<head>\n";
print "<title>", $metadata{'title'}, "</title>\n";
print "<link href=\"nasmdoc.css\" rel=\"stylesheet\" type=\"text/css\" />\n";
print "<link href=\"local.css\" rel=\"stylesheet\" type=\"text/css\" />\n";
print "</head>\n";
print "<body>\n";
@ -966,7 +967,10 @@ sub html_preamble {
print "<li class=\"last\"><a class=\"index\" href=\"nasmdoci.html\">Index</a></li>\n";
print "</ul>\n";
print "<div class=\"title\">\n";
print "<h1>", $metadata{'title'}, "</h1>\n";
print '<span class="subtitle">', $metadata{'subtitle'}, "</span>\n";
print "</div>\n";
}
sub html_postamble {