Documentation Tools

Changeset 173


Ignore:
Timestamp:
05/23/07 23:16:28 (5 years ago)
Author:
kate
Message:

A makefile for generating roff manpages.

Location:
trunk/Mk
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/Mk/docbook.mk

    • Property svn:keywords set to Id
    r172 r173  
     1# $Id$ 
     2# This Makefile deals with articles written in docbook, and rendering 
     3# those articles to varius formats (namely XHTML and PDF). 
    14 
    25# XSLT 
     
    2326all: xhtml xhtml-single 
    2427 
    25 xhtml: $(XHTMLDIR)/$(NAME)/index.html  
     28xhtml: $(XHTMLDIR)/$(NAME)/index.html 
    2629 
    2730xhtml-single: $(XHTMLDIR)/$(NAME)-single/index.html 
  • trunk/Mk/man.mk

    • Property svn:keywords set to Id
    r172 r173  
     1# $Id$ 
     2# This Makefile provides rules for building manpages with docbook, 
     3# and rendering those pages to various formats (namely roff). 
     4 
     5# XXX are figures supported? We only use roff for ASCII output 
     6# (XHTML or TeX otherwise), so is that relevant? What about 
     7# tables (perhaps with the tbl macros)? 
     8 
     9# Just because I always forget: groff -man -Tascii <file> | less 
    110 
    211# XSLT 
    3 DOCBOOK_XSL =   /usr/local/share/xsl/docbook 
     12# Currently we have no customisations here 
    413XSLT =                  xsltproc --xinclude 
    5 XHTMLSTYLE ?=   ../doctools/xsl/docbook-chunked.xsl 
    6 XHTMLSTYLE_SINGLE ?=    ../doctools/xsl/docbook-single.xsl 
     14MANSTYLE ?=     http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl 
    715 
    8 # PDF via dblatex (so much better than XSL-FO) 
    9 # Requires dblatex, http://dblatex.sf.net  
    10 DBLATEX =               /usr/local/bin/dblatex 
    11 PDFSTYLE =              simple 
     16MANDIR =                ../roff 
     17STYLEOPT=               --stringparam man.hyphenate 1 \ 
     18                                --stringparam man.justify 1 \ 
     19                                --stringparam man.hyphenate.urls 0 \ 
     20                                --stringparam man.break.after.slash 1 \ 
     21                                --stringparam man.hyphenate.filenames 0 \ 
     22                                --stringparam man.hyphenate.computer.inlines 0 \ 
     23                                --stringparam man.links.are.numbered 1 \ 
     24                                --stringparam man.links.list.enabled 1 
    1225 
    13 XHTMLDIR =              ../xhtml 
    14 PDFDIR =                ../pdf 
    15 RESOURCES ?=    ../doctools/resources/*.css ../doctools/resources/*.png 
    16 CSSFILE ?=              docs.css         
    17 STYLEOPT=               --stringparam html.stylesheet $(CSSFILE) \ 
    18                                 --stringparam chunker.output.encoding UTF-8 \ 
    19                                 --stringparam chunk.section.depth 0 \ 
    20                                 --stringparam project_url $(PROJECT_URL) \ 
    21                                 --stringparam project_name $(PROJECT_NAME) 
     26all: man 
    2227 
    23 all: xhtml xhtml-single 
     28man: $(MANDIR)/$(NAME) 
    2429 
    25 xhtml: $(XHTMLDIR)/$(NAME)/index.html  
     30$(MANDIR)/$(NAME): $(MANDIR) 
     31        $(XSLT) $(STYLEOPT) -o $(MANDIR)/$(NAME) $(MANSTYLE) $(SOURCE) 
    2632 
    27 xhtml-single: $(XHTMLDIR)/$(NAME)-single/index.html 
    28  
    29 pdf: $(PDFDIR) 
    30         $(DBLATEX) -T $(PDFSTYLE) $(SOURCE) -o $(PDFDIR)/$(NAME).pdf 
    31  
    32 $(XHTMLDIR)/$(NAME)/index.html: resources 
    33         $(XSLT) $(STYLEOPT) -o $(XHTMLDIR)/$(NAME)/ $(XHTMLSTYLE) $(SOURCE) 
    34  
    35 $(XHTMLDIR)/$(NAME)-single/index.html: resources-single 
    36         $(XSLT) $(STYLEOPT) -o $(XHTMLDIR)/$(NAME)-single/index.html $(XHTMLSTYLE_SINGLE) $(SOURCE) 
    37  
    38 $(PDFDIR)/design.fo: $(PDFDIR) 
    39         $(XSLT) -o $(PDFDIR)/$(NAME).fo $(FOSTYLE) $(SOURCE) 
    40  
    41 $(PDFDIR): 
    42         mkdir -p $(PDFDIR) 
    43  
    44 $(XHTMLDIR)/$(NAME): 
    45         mkdir -p $(XHTMLDIR)/$(NAME) 
    46  
    47 $(XHTMLDIR)/$(NAME)-single: 
    48         mkdir -p $(XHTMLDIR)/$(NAME)-single 
    49  
    50 resources: $(XHTMLDIR)/$(NAME) 
    51         cp -r $(RESOURCES) $(XHTMLDIR)/$(NAME) 
    52  
    53 resources-single: $(XHTMLDIR)/$(NAME)-single 
    54         cp -r $(RESOURCES) $(XHTMLDIR)/$(NAME)-single 
     33$(MANDIR): 
     34        mkdir -p $(MANDIR) 
    5535 
    5636clean:  
    57         rm -rf $(XHTMLDIR)/$(NAME) 
    58         rm -rf $(XHTMLDIR)/$(NAME)-single 
    59         rm -rf $(PDFDIR) 
     37        rm -f $(MANDIR)/$(NAME) 
    6038 
    6139force: 
Note: See TracChangeset for help on using the changeset viewer.