DocBook a konverze
Karel Zak
zakkr na zf.jcu.cz
Středa Únor 28 08:22:30 CET 2001
On Tue, Feb 27, 2001 at 10:33:39PM +0100, Dracula007 wrote:
> Ahoj,
> konecne jsem "zcela" zprovoznil docbook, precetl jsem si knihu od
> O'Reillyho (je super), ale porad se mi nedari rozchodit konverzi do PS
> (napriklad). Chtel jsem to delat pres SGMLTools-Lite 3.0.1, a to prikazem:
>
> # sgmltools -bps docbook/examples/errorcode.example.1.sgm
Mozna by vam mohl pomoci tohoto Makefile projektu Mape -- je tam vse a po
mensich upravach (nastaveni cest a sgml souboru viz. ALLBOOKS, ALLSGML apod.)
by to mohlo i pracovat, nebo to vemte jen jako inspiraci :-)
Ten vlastni prikazy na vyrobu PS:
jade -D ref -D ../graphics \
-d /usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh/print/docbook.dsl \
-t tex book-decl.sgml tutorial.sgml
jadetex tutorial.tex
dvips tutorial.dvi
(v ../graphics jsou obrazky)
*********** Makefile:
ifndef DOCBOOKSTYLE
DOCBOOKSTYLE = /usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh/
endif
ifndef HSTYLE
HSTYLE = $(DOCBOOKSTYLE)/html
endif
ifndef PSTYLE
PSTYLE = $(DOCBOOKSTYLE)/print
endif
HDSL=$(HSTYLE)/docbook.dsl
PDSL=$(PSTYLE)/docbook.dsl
ifndef JADE
JADE = jade
endif
SGMLINCLUDE = -D ref -D ../graphics
ifndef NSGMLS
NSGMLS = nsgmls
endif
ifndef SGMLSPL
SGMLSPL = sgmlspl
endif
# docbook2man generates man pages from docbook refentry source code.
ifndef D2MDIR
# This is where the (patched) docbook2man perl scripts reside on hub.org.
D2MDIR= sgmlspl-specs
endif
D2MSCRIPT= $(D2MDIR)/docbook2man-spec.pl
vpath %.sgml ./ref
ALLBOOKS = tutorial
ALLSGML := $(wildcard $(srcdir)/*.sgml $(srcdir)/ref/*.sgml)
MANSOURCES= $(wildcard ref/*.sgml)
APPLICATIONS=
COMMANDS=
FUNCTIONS=
#APPSOURCES= $(addprefix ref/, $(APPLICATIONS))
#SQLSOURCES= $(addprefix ref/, $(COMMANDS))
APPSOURCES= $(APPLICATIONS)
SQLSOURCES= $(COMMANDS)
XAPPTARGETS= $(APPLICATIONS:.sgml=.1)
APPTARGETS= $(XAPPTARGETS:-ref.1=.1)
XSQLTARGETS= $(COMMANDS:.sgml=.l)
SQLTARGETS= $(XSQLTARGETS:-ref.l=.l)
##
## Man pages
##
.PHONY: man man1 manl
man:
$(MAKE) man1 manl
rm -r *.1 *.l man1 manl
$(MAKE) man1 manl
manpage.refs:
$(MAKE) man
man1: $(APPTARGETS) manpage.refs
rm -rf man1
if [ ! -d man1 ]; then mkdir man1; fi
cp *.1 man1/
manl: $(SQLTARGETS) manpage.refs
rm -rf manl/*
if [ ! -d manl ]; then mkdir manl; fi
cp *.l manl/
%.1: %-ref.sgml
$(NSGMLS) $(NSGMLS_FLAGS) refentry.sgml $< \
| $(SGMLSPL) $(D2MSCRIPT) --lowercase --section 1
%.1: %.sgml
$(NSGMLS) $(NSGMLS_FLAGS) refentry.sgml $< \
| $(SGMLSPL) $(D2MSCRIPT) --lowercase --section 1
%.l: %.sgml
$(NSGMLS) $(NSGMLS_FLAGS) refentry.sgml $< \
| $(SGMLSPL) $(D2MSCRIPT) --lowercase --section l
##
## HTML
##
JADE.html = $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) -d $(HDSL) -V %use-id-as-filename% -t sgml
$(addsuffix .html, $(ALLBOOKS)): %.html: %.sgml $(ALLSGML)
@rm -f *.htm
$(JADE.html) book-decl.sgml $<
ln -sf $*.html index.html
##
## Print
##
# RTF to allow minor editing for hardcopy
$(addsuffix .rtf, $(ALLBOOKS)): %.rtf: %.sgml $(ALLSGML)
$(JADE) $(JADEFLAGS) $(SGMLINCLUDE) -d $(PDSL) -t rtf book-decl.sgml $<
# TeX and DVI
$(addsuffix .tex, $(ALLBOOKS)): %.tex: %.sgml $(ALLSGML)
$(JADE) $(JADEFLAGS) $(SGMLINCLUDE) -d $(PDSL) -t tex book-decl.sgml $<
%.dvi: %.tex
jadetex $<
jadetex $<
# Postscript from TeX
%.ps: %.dvi
dvips -o $@ $<
# Graphics
%.gif:
cp -p ../graphics/$@ .
##
## Check
##
check: $(addprefix check-, $(ALLBOOKS)) check-postgres
# Quick syntax check without style processing
$(addprefix check-, $(ALLBOOKS)): check-%: %.sgml
$(NSGMLS) $(SGMLINCLUDE) -s book-decl.sgml $<
check-postgres: postgres.sgml
$(NSGMLS) $(SGMLINCLUDE) -s $<
##
## Clean
##
clean distclean maintainer-clean:
# HTML
rm -f HTML.manifest *.html *.htm
# man
rm -rf *.1 *.l man1 manl manpage.refs manpage.links manpage.log
# print
rm -f *.rtf *.tex *.dvi *.aux *.log *.ps *.pdf
--
Karel Zak <zakkr na zf.jcu.cz>
http://home.zf.jcu.cz/~zakkr/
C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz
------------- další část ---------------
A non-text attachment was scrubbed...
Name: [žádný popis není k dispozici]
Type: application/pgp-signature
Size: 366 bytes
Desc: [žádný popis není k dispozici]
URL: <http://www.linux.cz/pipermail/linux/attachments/20010228/7d7318d9/attachment.sig>
Další informace o konferenci Linux