Skip to content

Commit

Permalink
Added a basic docbook template that should be used when creating new …
Browse files Browse the repository at this point in the history
…docbooks.

Allows for building and installing in different directories for automated builds.
Admin guide will be updated shortly with the new Makefile.


git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@5033 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
amyreese committed Feb 23, 2008
1 parent fa7188f commit 5a0f449
Show file tree
Hide file tree
Showing 6 changed files with 1,232 additions and 0 deletions.
112 changes: 112 additions & 0 deletions docbook/template/Makefile
@@ -0,0 +1,112 @@
# Makefile for DocBoook compilation
#
# $Id: Makefile,v 1.5 2004/10/01 12:54:37 giallu Exp $
#
#
# Some things to remember:
# - The main DocBook name is $BOOK.sgml
# - All other files should have .sgml extension
# - Images should go into ./images directory
# - Images should be in png format
#

# Output directory
BUILD_DIR:=build

# Installation directory
INSTALL_DIR:=install

# Book name: will be used to build the input filename ($BOOK.sgml)
# and the output filename ($BOOK.html, $BOOK.pdf and so on)
BOOK:=template

# Stylesheet name. Original file from:
# /usr/share/sgml/docbook/utils-0.6.11/docbook-utils.dsl
#
STYLE=stylesheet.dsl

FILES:=$(BOOK).sgml $(wildcard *.sgml) $(STYLE) builddate

IMAGES:=$(wildcard images/*.png)
EPSS:=$(IMAGES:.png=.eps)

default: help

all: html pdf
#all: html html_onefile text pdf ps sgml.gz html.tar.gz

html: $(BUILD_DIR)/$(BOOK)/$(BOOK).html

html_onefile: $(BUILD_DIR)/$(BOOK).html

pdf: $(BUILD_DIR)/$(BOOK).pdf

ps: $(BUILD_DIR)/$(BOOK).ps

rtf: $(BUILD_DIR)/$(BOOK).rtf

text: $(BUILD_DIR)/$(BOOK).txt

builddate:
echo -n $$(LANG="en_US";date "+%e %B %Y") > $@

html.tar.gz: html
(for i in $(files); do \
tar -cf $$i.tar $$i; \
gzip -f $$i.tar; \
done; )

$(BUILD_DIR)/$(BOOK)/$(BOOK).html: $(FILES) $(IMAGES)
jw -d $(STYLE)#html -f docbook -b html -o $(BUILD_DIR)/$(BOOK) $<
-cp -r images $(BUILD_DIR)/$(BOOK)/

$(BUILD_DIR)/$(BOOK).pdf: $(FILES) $(IMAGES)
jw -d $(STYLE)#print -f docbook -b pdf -o $(BUILD_DIR) $<

$(BUILD_DIR)/$(BOOK).html: $(FILES) $(IMAGES)
jw -d $(STYLE)#html -f docbook -b html -o $(BUILD_DIR) -u $<

$(BUILD_DIR)/$(BOOK).ps: $(FILES) $(EPSS)
jw -d $(STYLE) -f docbook -b ps -o $(BUILD_DIR) $<

$(BUILD_DIR)/$(BOOK).rtf: $(FILES) $(IMAGES)
jw -d $(STYLE) -f docbook -b rtf -o $(BUILD_DIR) $<

$(BUILD_DIR)/$(BOOK).txt: $(FILES)
jw -f docbook -b txt -o $(BUILD_DIR) $<

# pattern rules to convert PNGs to EPS
#
%.eps : %.png
pngtopnm $< | pnmtops -noturn > $@


.PHONY: valid install clean dist help
valid:
nsgmls -s $(BOOK).sgml

install:
-mkdir -p $(INSTALL_DIR)
-cp -r $(BUILD_DIR)/$(BOOK) $(BUILD_DIR)/$(BOOK).pdf $(BUILD_DIR)/$(BOOK).html $(BUILD_DIR)/$(BOOK).ps $(BUILD_DIR)/$(BOOK).rtf $(BUILD_DIR)/$(BOOK).txt $(INSTALL_DIR)

clean:
-$(RM) *.log *.dvi *.aux *.tex *.out
-$(RM) $(GENERATED_IMG) builddate
-$(RM) -r $(BUILD_DIR)/$(BOOK)
-$(RM) $(BUILD_DIR)/$(BOOK).html $(BUILD_DIR)/$(BOOK).ps $(BUILD_DIR)/$(BOOK).pdf $(BUILD_DIR)/$(BOOK).rtf $(BUILD_DIR)/$(BOOK).txt

# Rebuild everything
dist: clean all

help:
@echo "Usage: make <target>"
@echo "Available targets are:"
@echo " help Show this text"
@echo " html Convert to HTML (split pages)"
@echo " html_onefile Convert to HTML (single page)"
@echo " pdf Convert to PDF"
@echo " rtf Convert to RTF"
@echo " ps Convert to Postscript"
@echo " text Convert to plain text"
@echo " clean Remove output and temporary files"
@echo " valid Check book correctness with nsgmls"
13 changes: 13 additions & 0 deletions docbook/template/chapter.sgml
@@ -0,0 +1,13 @@
<chapter>
<title>Generic Chapter</title>

<section>
<title>Generic Section</title>

<para>
This is a generic paragraph.
</para>
</section>

</chapter>

1 change: 1 addition & 0 deletions docbook/template/file-entities.ent
@@ -0,0 +1 @@
<!ENTITY chapter SYSTEM "chapter.sgml">

0 comments on commit 5a0f449

Please sign in to comment.