From d31a74e301ee6a09b29b610a83ff2c1580b9f998 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Sun, 16 Apr 2017 23:52:23 -0700 Subject: doc: add a local.css specifically to be overridden locally Add a file local.css which is referenced *after* nasmdoc.css, thus overriding the latter. This file intentionally has no actual content, which means it can be overridden locally for any desired content, e.g. indexing into web fonts or overriding any of the style. Signed-off-by: H. Peter Anvin --- doc/Makefile.in | 15 +++++++-------- doc/local.css | 1 + doc/rdsrc.pl | 1 + 3 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 doc/local.css diff --git a/doc/Makefile.in b/doc/Makefile.in index c43f029c..4f957da7 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -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 diff --git a/doc/local.css b/doc/local.css new file mode 100644 index 00000000..dfee5220 --- /dev/null +++ b/doc/local.css @@ -0,0 +1 @@ +/* Add site-local nasmdoc style configuration to this file */ diff --git a/doc/rdsrc.pl b/doc/rdsrc.pl index b31d9b7e..78e53951 100644 --- a/doc/rdsrc.pl +++ b/doc/rdsrc.pl @@ -949,6 +949,7 @@ sub html_preamble { print "\n"; print "", $metadata{'title'}, "\n"; print "\n"; + print "\n"; print "\n"; print "\n"; -- cgit v1.2.1 From 984c6011ba642afb3c1e16d79135e830eba13aaa Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 17 Apr 2017 01:38:41 -0700 Subject: doc/genps: make sure we pick up nasmlogo.eps when building cross-dir When building in a different directory, we still want to make sure we pick up nasmlogo.eps. Signed-off-by: H. Peter Anvin --- doc/Makefile.in | 3 ++- doc/genps.pl | 14 ++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/doc/Makefile.in b/doc/Makefile.in index 4f957da7..2ddfd1ee 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -63,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 diff --git a/doc/genps.pl b/doc/genps.pl index e3b799b5..88e57388 100755 --- a/doc/genps.pl +++ b/doc/genps.pl @@ -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; -- cgit v1.2.1 From aa319b93e910736eacb4a492a3128661a76f52b1 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Mon, 17 Apr 2017 02:18:50 -0700 Subject: doc: add the version number to the HTML output Add the subtitle (e.g. "version XXXX...") to the HTML output. Signed-off-by: H. Peter Anvin --- doc/nasmdoc.css | 12 +++++++++++- doc/rdsrc.pl | 3 +++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/doc/nasmdoc.css b/doc/nasmdoc.css index 466ee2ce..af095273 100644 --- a/doc/nasmdoc.css +++ b/doc/nasmdoc.css @@ -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"; diff --git a/doc/rdsrc.pl b/doc/rdsrc.pl index 78e53951..bc066584 100644 --- a/doc/rdsrc.pl +++ b/doc/rdsrc.pl @@ -967,7 +967,10 @@ sub html_preamble { print "
  • Index
  • \n"; print "\n"; + print "
    \n"; print "

    ", $metadata{'title'}, "

    \n"; + print '', $metadata{'subtitle'}, "\n"; + print "
    \n"; } sub html_postamble { -- cgit v1.2.1