Create INSTALL file via XSLT
authorPeter Eisentraut
Mon, 27 Feb 2017 15:44:59 +0000 (10:44 -0500)
committerPeter Eisentraut
Wed, 8 Mar 2017 13:41:23 +0000 (08:41 -0500)
As before, create an INSTALL.html file for processing with lynx, but use
xsltproc and a new XSLT stylesheet instead of jade and DSSSL.

Replacing jade with xsltproc removes jade from the requirements for
distribution building.

Reviewed-by: Magnus Hagander
doc/src/sgml/.gitignore
doc/src/sgml/Makefile
doc/src/sgml/stylesheet-text.xsl [new file with mode: 0644]
doc/src/sgml/stylesheet.dsl

index 2f0329c15f9c57af392b1b817c3defbc964f8645..cdeace2991e7b2d37e3690546965b21d4dd039a9 100644 (file)
@@ -7,6 +7,7 @@
 /man-stamp
 # Other popular build targets
 /INSTALL
+/INSTALL.xml
 /postgres-US.pdf
 /postgres-A4.pdf
 /postgres.html
index fe7ca65cd4b28d55acb857cd68836cc8366bb2c1..774d35de20ee613660c6d096326321e75f4e5c09 100644 (file)
@@ -217,10 +217,9 @@ postgres.pdf:
 
 
 ##
-## Semi-automatic generation of some text files.
+## Generation of some text files.
 ##
 
-JADE.text = $(JADE) $(JADEFLAGS) $(SGMLINCLUDE) $(CATALOG) -d stylesheet.dsl -i output-text -t sgml
 ICONV = iconv
 LYNX = lynx
 
@@ -233,10 +232,15 @@ LYNX = lynx
 # locale support and is very picky about locale name spelling.  The
 # below has been finely tuned to run on FreeBSD and Linux/glibc.
 INSTALL: % : %.html
-   $(PERL) -p -e 's/g' $< | LC_ALL=en_US.ISO8859-1 $(LYNX) -force_html -dump -nolist -stdin | $(ICONV) -f latin1 -t us-ascii//TRANSLIT > $@
+   $(PERL) -p -e 's,g' $< | LC_ALL=en_US.ISO8859-1 $(LYNX) -force_html -dump -nolist -stdin | $(ICONV) -f latin1 -t us-ascii//TRANSLIT > $@
 
-INSTALL.html: standalone-install.sgml installation.sgml version.sgml
-   $(JADE.text) -V nochunks standalone-install.sgml installation.sgml > $@
+INSTALL.html: %.html : stylesheet-text.xsl %.xml
+   $(XMLLINT) --noout --valid $*.xml
+   $(XSLTPROC) $(XSLTPROCFLAGS) $(XSLTPROC_HTML_FLAGS) $^ >$@
+
+INSTALL.xml: standalone-install.sgml installation.sgml version.sgml
+   $(OSX) -D. -x lower $(filter-out version.sgml,$^) >[email protected]
+   $(call mangle-xml,chapter)
 
 
 ##
@@ -247,12 +251,15 @@ INSTALL.html: standalone-install.sgml installation.sgml version.sgml
 # if we try to do "make all" in a VPATH build without the explicit
 # $(srcdir) on the postgres.sgml dependency in this rule.  GNU make bug?
 postgres.xml: $(srcdir)/postgres.sgml $(ALMOSTALLSGML)
-   $(OSX) -D. -x lower -i include-xslt-index $< >postgres.xmltmp
-   $(PERL) -p -e 's/\[(aacute|acirc|aelig|agrave|amp|aring|atilde|auml|bull|copy|eacute|egrave|gt|iacute|lt|mdash|nbsp|ntilde|oacute|ocirc|oslash|ouml|pi|quot|scaron|uuml) *\]/\&\1;/gi;' \
-              -e '$$_ .= qq{\n} if $$. == 1;' \
-      $@
-   rm postgres.xmltmp
-# ' hello Emacs
+   $(OSX) -D. -x lower -i include-xslt-index $< >[email protected]
+   $(call mangle-xml,book)
+
+define mangle-xml
+$(PERL) -p -e 's/\[(aacute|acirc|aelig|agrave|amp|aring|atilde|auml|bull|copy|eacute|egrave|gt|iacute|lt|mdash|nbsp|ntilde|oacute|ocirc|oslash|ouml|pi|quot|scaron|uuml) *\]/\&\1;/gi;' \
+           -e '$$_ .= qq{\n} if $$. == 1;' \
+  <[email protected] > $@
+endef
 
 ifeq ($(STYLE),website)
 XSLTPROC_HTML_FLAGS += --param website.stylesheet 1
@@ -386,13 +393,13 @@ check-tabs:
 # This allows removing some files from the distribution tarballs while
 # keeping the dependencies satisfied.
 .SECONDARY: postgres.xml $(GENERATED_SGML) HTML.index
-.SECONDARY: INSTALL.html
+.SECONDARY: INSTALL.html INSTALL.xml
 .SECONDARY: %-A4.tex-ps %-US.tex-ps %-A4.tex-pdf %-US.tex-pdf
 
 clean:
 # text --- these are shipped, but not in this directory
    rm -f INSTALL
-   rm -f INSTALL.html
+   rm -f INSTALL.html INSTALL.xml
 # single-page output
    rm -f postgres.html postgres.txt
 # print
@@ -400,7 +407,7 @@ clean:
 # index
    rm -f HTML.index $(GENERATED_SGML)
 # XSLT
-   rm -f postgres.xml postgres.xmltmp htmlhelp.hhp toc.hhc index.hhk *.fo
+   rm -f postgres.xml *.tmp htmlhelp.hhp toc.hhc index.hhk *.fo
 # EPUB
    rm -f postgres.epub
 # Texinfo
diff --git a/doc/src/sgml/stylesheet-text.xsl b/doc/src/sgml/stylesheet-text.xsl
new file mode 100644 (file)
index 0000000..476b871
--- /dev/null
@@ -0,0 +1,98 @@
+
+
+                version='1.0'
+                xmlns="http://www.w3.org/TR/xhtml1/transitional"
+                exclude-result-prefixes="#default">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  
  • +    
    +    
    +
    +    
    +  
    +
    +
    +
    +
    +
    +  *
    +  
    +  *
    +
    +
    +
    +  
    +  
    +  
    +
    +
    +
    +  
    +
    +
    +
    +
    +  
    +    
    +      
    +    
    +    
    +
    +    
    +      

    +        
    +          
    +          :
    +        
    +      

    +    
    +
    +    
    +  
    +
    +
    +
    +
    +
    +                    |sect1/info/title
    +                    |sect1info/title"
    +              mode="titlepage.mode" priority="2">
    +  
    +  
    +
    +
    +
    +                    |sect2/info/title
    +                    |sect2info/title"
    +              mode="titlepage.mode" priority="2">
    +  
    +  
    +
    +
    +
    +                    |sect3/info/title
    +                    |sect3info/title"
    +              mode="titlepage.mode" priority="2">
    +  
    +  
    +
    +
    +
    index 61d2963b17ce21b3b7b2d7201403bfda1660c04f..05cab9a5f3dd651abc01ccd296309e9b46cca256 100644 (file)
    @@ -4,7 +4,6 @@
     
     
     
    -
     
     
     
     
     ]]>
     
    -
    -
    -]]>
    -
     ]>
     
     
     
     ]]> 
     
    -
    -
    -
    -
    -
    -
    -
    -(define %section-autolabel% #f)
    -(define %chapter-autolabel% #f)
    -(define $generate-chapter-toc$ (lambda () #f))
    -
    -;; For text output, produce "ASCII markup" for emphasis and such.
    -
    -(define ($asterix-seq$ #!optional (sosofo (process-children)))
    -  (make sequence
    -    (literal "*")
    -    sosofo
    -    (literal "*")))
    -
    -(define ($dquote-seq$ #!optional (sosofo (process-children)))
    -  (make sequence
    -    (literal (gentext-start-quote))
    -    sosofo
    -    (literal (gentext-end-quote))))
    -
    -(element (para command) ($dquote-seq$))
    -(element (para emphasis) ($asterix-seq$))
    -(element (para filename) ($dquote-seq$))
    -(element (para option) ($dquote-seq$))
    -(element (para replaceable) ($dquote-seq$))
    -(element (para userinput) ($dquote-seq$))
    -
    -]]> 
    -