Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Z shell introductory guide source
The patch below has two objectives:
For intro.html:
Almost same as my previous patch. Use conditional ".if \n[HTML]"
so that the same ms file can be used for both pdf and html.
I don't know why we need different macros for html and pdf.
For intro.pdf:
Use -mspdf instead of -ms, and .XN instead of .XS/.XE. This adds an
Index to the pdf that can be accessed via the side panel (side bar)
of PDF viewers (evince, Preview.app, etc.).
-no-kill-null-pages is to retain blank pages after the cover page
and before the TOC; these are useful only for those who actually
print the pdf to double-sided papers.
I will push this if no one has found a better ms->html converter than
groff -ms -Thtml.
# Manpage of grohtml(1) (groff's html driver) says, in the Bugs section,
# "grohtml is still beta code." It may improve in the future, hopefully.
diff --git a/Doc/Makefile.in b/Doc/Makefile.in
index fa2a336ad..318004b64 100644
--- a/Doc/Makefile.in
+++ b/Doc/Makefile.in
@@ -93,7 +93,7 @@ all: man $(runhelp) texi ../META-FAQ
.PHONY: all
everything: all html info zsh_a4.dvi zsh_us.dvi zsh_a4.pdf zsh_us.pdf \
- intro.a4.pdf intro.us.pdf
+ intro.a4.pdf intro.us.pdf intro.html
.PHONY: everything
dvi: zsh.dvi
@@ -121,11 +121,14 @@ zsh.pdf zsh_a4.pdf zsh_us.pdf: $(sdir)/zsh.texi
intro.pdf intro.a4.pdf intro.us.pdf: $(sdir)/intro.ms
if test $@ = intro.us.pdf || \
{ test $@ = intro.pdf && test "$(PAPERSIZE)" = us; }; then \
- pdfroff -ms -P-pletter $(sdir)/intro.ms > $@; \
+ pdfroff -mspdf --no-kill-null-pages -P-pletter $< > $@; \
else \
- pdfroff -ms -P-pa4 $(sdir)/intro.ms > $@; \
+ pdfroff -mspdf --no-kill-null-pages -P-pa4 $< > $@; \
fi
+intro.html: $(sdir)/intro.ms
+ groff -ms -Thtml -P-jintro $< > $@
+
texi: $(sdir)/zsh.texi
.PHONY: texi
diff --git a/Doc/intro.ms b/Doc/intro.ms
index 4dd08f601..49f6cc07f 100644
--- a/Doc/intro.ms
+++ b/Doc/intro.ms
@@ -3,8 +3,32 @@
.if \n(.g \{\
.if "\*(.T"ascii" .ftr C R
.if "\*(.T"latin1" .ftr C R
+.if "\*(.T"html" .nr HTML 1
.nr De \n[.ss]
.\}
+.\" ----- macro defintions -----
+.\" Ds/De: start/end of example
+.\" Sh: section header
+.\" XXX: It seems we can't use the same definition for both pdf and html
+.\" (at least with groff-12.3.0).
+.\"
+.\" for HTML output
+.ie \n[HTML] \{\
+.de Ds
+.DS I .5i
+.ft C
+..
+.de De
+.DE
+.ft R
+..
+.de Sh
+.NH
+\\$1
+..
+.\}
+.\" for other output (such as PDF)
+.el \{\
.de Ds
.DS I .5i
.ft C
@@ -21,12 +45,13 @@
.el .ss
..
.de Sh
-.SH
-\\$1
-.XS
-\\$1
-.XE
+.NH
+.XN \\$1
..
+.\}
+.\"
+.\" ----- Cover page -----
+.if !\n[HTML] \{\
.nr HM 4i
.ce 99
.ps 18
@@ -50,6 +75,9 @@ bas@xxxxxxxxxxx\fP
.sv |1i
.pn 1
.bp
+.\}
+.\"
+.\" ----- main text -----
.TL
An Introduction to the Z Shell
.AU
@@ -2712,6 +2740,7 @@ I (Bas de Bakker) would be happy to receive mail if anyone has any
tricks or ideas to add to this document, or if there are some points
that could be made clearer or covered more thoroughly. Please notify
me of any errors in this document.
+.if !\n[HTML] \{\
.if o \{\
.bp
.sv 1i
@@ -2719,3 +2748,4 @@ me of any errors in this document.
.pn 1
.bp
.PX
+.\}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author