Added support for using jade directly if docbook2html is not installed (based

on Debian patch). Removed outdated jade specific Makefile.
This commit is contained in:
Volker Ruppert 2020-01-27 18:22:12 +00:00
parent 21e035957d
commit 79e1dfafcc
4 changed files with 139 additions and 92 deletions

View File

@ -2140,6 +2140,7 @@ AC_SUBST(BUSM_OBJS)
AC_PATH_PROG(DOCBOOK2HTML, docbook2html, not_found) AC_PATH_PROG(DOCBOOK2HTML, docbook2html, not_found)
AC_CHECK_PROGS([JADE], [jade openjade])
AC_MSG_CHECKING(whether to build docbook documentation) AC_MSG_CHECKING(whether to build docbook documentation)
build_docbook=0 build_docbook=0
AC_ARG_ENABLE(docbook, AC_ARG_ENABLE(docbook,
@ -2148,8 +2149,12 @@ AC_ARG_ENABLE(docbook,
if test "$enableval" = yes; then build_docbook=1; fi if test "$enableval" = yes; then build_docbook=1; fi
], ],
[ [
dnl Not specified. If they have docbook2html, then yes. dnl Not specified. If they have docbook2html or jade, then yes.
if test "$DOCBOOK2HTML" != not_found; then build_docbook=1; fi if test "$DOCBOOK2HTML" != not_found; then
build_docbook=1
else
if test "$JADE" != not_found; then build_docbook=1; fi
fi
] ]
) )
@ -2158,8 +2163,8 @@ if test $build_docbook = 1; then
BUILD_DOCBOOK_VAR=build_docbook BUILD_DOCBOOK_VAR=build_docbook
INSTALL_DOCBOOK_VAR=install_docbook INSTALL_DOCBOOK_VAR=install_docbook
CLEAN_DOCBOOK_VAR=clean_docbook CLEAN_DOCBOOK_VAR=clean_docbook
if test "$DOCBOOK2HTML" = not_found; then if test "$DOCBOOK2HTML" = not_found -a "$JADE" = not_found; then
echo "ERROR: docbook2html must be installed to build the documentation" echo "ERROR: docbook2html or jade must be installed to build the documentation"
exit 1 exit 1
fi fi
else else

View File

@ -9,12 +9,23 @@
prefix = @prefix@ prefix = @prefix@
srcdir = @srcdir@ srcdir = @srcdir@
abs_srcdir = @abs_srcdir@
docdir = $(prefix)/share/doc/bochs docdir = $(prefix)/share/doc/bochs
DOCBOOK2HTML = @DOCBOOK2HTML@
WGET = @WGET@ WGET = @WGET@
TARGZ = bochsdoc.tar.gz TARGZ = bochsdoc.tar.gz
RENDERED_DOC_URL = http://bochs.sf.net/doc/docbook/$(TARGZ) RENDERED_DOC_URL = http://bochs.sf.net/doc/docbook/$(TARGZ)
# docbook-utils build if found
DOCBOOK2HTML = @DOCBOOK2HTML@
ifeq ($(DOCBOOK2HTML), not_found)
# jade build
HTML_STYLESHEET = $(abs_srcdir)/include/docbook-utils.dsl\#html
JADE = @JADE@
JADE_ARGS = -t sgml -i html -d $(HTML_STYLESHEET) # -V nochunks
SGML_VALIDATE = nsgmls -s
DOCBOOK2HTML = $(JADE) $(JADE_ARGS)
endif
DESTDIR= DESTDIR=
# name of the major documentation sections # name of the major documentation sections
@ -39,15 +50,15 @@ all: $(SECTION_HTML)
user/index.html: $(srcdir)/user/user.dbk user/index.html: $(srcdir)/user/user.dbk
-mkdir -p user -mkdir -p user
$(DOCBOOK2HTML) -o user $(srcdir)/user/user.dbk cd user; $(DOCBOOK2HTML) user.dbk
documentation/index.html: $(srcdir)/documentation/documentation.dbk documentation/index.html: $(srcdir)/documentation/documentation.dbk
-mkdir -p documentation -mkdir -p documentation
$(DOCBOOK2HTML) -o documentation $(srcdir)/documentation/documentation.dbk cd documentation; $(DOCBOOK2HTML) documentation.dbk
development/index.html: $(srcdir)/development/development.dbk development/index.html: $(srcdir)/development/development.dbk
-mkdir -p development -mkdir -p development
$(DOCBOOK2HTML) -o development $(srcdir)/development/development.dbk cd development; $(DOCBOOK2HTML) development.dbk
fixperm:: fixperm::
# fix permissions locally so that tar will install things right # fix permissions locally so that tar will install things right

View File

@ -1,84 +0,0 @@
###################################################################
# doc/docbook/Makefile
# $Id$
#
# Builds documentation in various formats from SGML source, and
# allows easy update to the Bochs web site.
#
###################################################################
# name of the major documentation sections
SECTIONS=user documentation development
# these files get installed in addition to the sections
EXTRAS=README index.html images include
# complete list of what to install
INSTALL_LIST=$(SECTIONS) $(EXTRAS)
# ssh to this server to install the docs
REMOTE_HOST=shell.sf.net
# path of preexisting install in, on the remote server. Each section
# will go into a subdirectory of $REMOTE_PATH, as in
# $REMOTE_PATH/user.
REMOTE_PATH=/home/groups/b/bo/bochs/htdocs/doc/docbook
# -x means don't try to forward X authorization, it won't work for SF
SSH=ssh -x
# docbook defines and stuff
DSSSL_ROOT=/usr/share/sgml/docbook/stylesheet/dsssl/modular/
HTML_STYLESHEET=$(DSSSL_ROOT)/html/docbook.dsl
JADE=jade
JADE_ARGS=-t sgml -d $(HTML_STYLESHEET) # -V nochunks
SGML_VALIDATE=nsgmls -s
all: all_html
all_html: user/book1.html documentation/book1.html development/book1.html
user/book1.html: user/user.dbk
rm -f user/*.htm*
export i=user; cd $$i; $(JADE) $(JADE_ARGS) $$i.dbk
cp user/book1.htm user/book1.html
documentation/book1.html: documentation/documentation.dbk
rm -f documentation/*.htm*
export i=documentation; cd $$i; $(JADE) $(JADE_ARGS) $$i.dbk
cp documentation/book1.htm documentation/book1.html
development/book1.html: development/development.dbk
rm -f development/*.htm*
export i=development; cd $$i; $(JADE) $(JADE_ARGS) $$i.dbk
cp development/book1.htm development/book1.html
validate::
for i in $(SECTIONS); do $(SGML_VALIDATE) $$i/$$i.dbk; done
# install the stuff on the remote server using ssh. The bryce->bdenney
# stuff is just because Bryce's local username and sourceforge
# username don't match. If your usernames match then the "whoami"
# will work ok.
webinst: #all
# fix <TITLE> tags in all html files
./fixtitles.pl `find . -name '*.htm'`
./fixtitles.pl `find . -name '*.html'`
# fix permissions locally so that tar will install things right
chmod 664 `find $(INSTALL_LIST) -type f -print`
chmod 775 `find $(INSTALL_LIST) -type d -print`
# copy to remote
@echo Installing documentation on $(REMOTE_PATH)
case "`whoami`" in \
bryce) sfuser=bdenney;; \
daemian) sfuser=vasudeva;; \
*) sfuser=`whoami`;; \
esac; \
tar cf - $(INSTALL_LIST) | \
$(SSH) $$sfuser@$(REMOTE_HOST) "cd $(REMOTE_PATH) && umask 002 && tar xvf -"
clean:
#remove generated files
for S in $(SECTIONS); do \
rm -f $$S/*.htm* $$S/*.ps $$S/*.pdf $$S/*.out $$S/*.rtf $$S/*.tex $$S/*.fot; \
done

View File

@ -0,0 +1,115 @@
<!-- This file defines the DocBook-utils Style Sheet for DocBook
Eric Bischoff <eric@caldera.de>
-->
<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
<!ENTITY % html "IGNORE">
<![%html; [
<!ENTITY % print "IGNORE">
<!ENTITY docbook.dsl PUBLIC "-//Norman Walsh//DOCUMENT DocBook HTML Stylesheet//EN" CDATA dsssl>
]]>
<!ENTITY % print "INCLUDE">
<![%print; [
<!ENTITY docbook.dsl PUBLIC "-//Norman Walsh//DOCUMENT DocBook Print Stylesheet//EN" CDATA dsssl>
]]>
]>
<STYLE-SHEET>
<STYLE-SPECIFICATION ID="UTILS" USE="DOCBOOK">
<STYLE-SPECIFICATION-BODY>
;; ===================================================================
;; Generic Parameters
;; (Generic currently means: both print and html)
(define %chapter-autolabel% #t)
(define %section-autolabel% #t)
(define (toc-depth nd) 3)
</STYLE-SPECIFICATION-BODY>
</STYLE-SPECIFICATION>
<STYLE-SPECIFICATION ID="PRINT" USE="UTILS">
<STYLE-SPECIFICATION-BODY>
;; ===================================================================
;; Print Parameters
;; Call: jade -d docbook-utils.dsl#print
; === Page layout ===
;; (define %paper-type% "A4") ;; use A4 paper - comment this out if needed
; === Media objects ===
(define preferred-mediaobject-extensions ;; this magic allows to use different graphical
(list "eps")) ;; formats for printing and putting online
(define acceptable-mediaobject-extensions
'())
(define preferred-mediaobject-notations
(list "EPS"))
(define acceptable-mediaobject-notations
(list "linespecific"))
; === Rendering ===
(define %head-after-factor% 0.2) ;; not much whitespace after orderedlist head
(define ($paragraph$) ;; more whitespace after paragraph than before
(make paragraph
first-line-start-indent: (if (is-first-para)
%para-indent-firstpara%
%para-indent%)
space-before: (* %para-sep% 4)
space-after: (/ %para-sep% 4)
quadding: %default-quadding%
hyphenate?: %hyphenation%
language: (dsssl-language-code)
(process-children)))
</STYLE-SPECIFICATION-BODY>
</STYLE-SPECIFICATION>
<STYLE-SPECIFICATION ID="HTML" USE="UTILS">
<STYLE-SPECIFICATION-BODY>
;; ===================================================================
;; HTML Parameters
;; Call: jade -d docbook-utils.dsl#html
; === File names ===
(define %root-filename% "index") ;; name for the root html file
(define %html-ext% ".html") ;; default extension for html output files
(define %html-prefix% "") ;; prefix for all filenames generated (except root)
(define %use-id-as-filename% #t) ;; if #t uses ID value, if present, as filename
;; otherwise a code is used to indicate level
;; of chunk, and general element number
;; (nth element in the document)
(define use-output-dir #f) ;; output in separate directory?
(define %output-dir% "HTML") ;; if output in directory, it's called HTML
; === HTML settings ===
(define %html-pubid% "-//W3C//DTD HTML 4.01 Transitional//EN") ;; Nearly true :-(
(define %html40% #t)
; === Media objects ===
(define preferred-mediaobject-extensions ;; this magic allows to use different graphical
(list "png" "jpg" "jpeg")) ;; formats for printing and putting online
(define acceptable-mediaobject-extensions
(list "bmp" "gif" "eps" "epsf" "avi" "mpg" "mpeg" "qt"))
(define preferred-mediaobject-notations
(list "PNG" "JPG" "JPEG"))
(define acceptable-mediaobject-notations
(list "EPS" "BMP" "GIF" "linespecific"))
; === Rendering ===
(define %admon-graphics% #f) ;; use symbols for Caution|Important|Note|Tip|Warning
; === Books only ===
(define %generate-book-titlepage% #t)
(define %generate-book-toc% #t)
(define ($generate-chapter-toc$) #f) ;; never generate a chapter TOC in books
; === Articles only ===
(define %generate-article-titlepage% #t)
(define %generate-article-toc% #t) ;; make TOC
</STYLE-SPECIFICATION-BODY>
</STYLE-SPECIFICATION>
<EXTERNAL-SPECIFICATION ID="DOCBOOK" DOCUMENT="docbook.dsl">
</STYLE-SHEET>