Date: Mon, 1 Apr 2013 08:16:09 +0000 (UTC) From: Gabor Kovesdan <gabor@FreeBSD.org> To: doc-committers@freebsd.org, svn-doc-projects@freebsd.org Subject: svn commit: r41332 - in projects/xml-tools/share: mk xml xsl Message-ID: <201304010816.r318G9Cj085943@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: gabor Date: Mon Apr 1 08:16:09 2013 New Revision: 41332 URL: http://svnweb.freebsd.org/changeset/doc/41332 Log: - Remove some further unused leftovers - Make sure printed docs generated with DSSSL always use .eps images - And XSLT-based output always uses .png - Fix image conversion Modified: projects/xml-tools/share/mk/doc.images.mk projects/xml-tools/share/xml/freebsd-print.dsl projects/xml-tools/share/xml/freebsd.dtd projects/xml-tools/share/xml/freebsd45.dtd projects/xml-tools/share/xsl/freebsd-common.xsl projects/xml-tools/share/xsl/freebsd-fo.xsl Modified: projects/xml-tools/share/mk/doc.images.mk ============================================================================== --- projects/xml-tools/share/mk/doc.images.mk Sun Mar 31 21:35:32 2013 (r41331) +++ projects/xml-tools/share/mk/doc.images.mk Mon Apr 1 08:16:09 2013 (r41332) @@ -125,6 +125,9 @@ EPS2PNM_RES?= 100 -g`${EPSGEOM} -geom ${EPSGEOMOPTS} ${.TARGET:S/.png$/.eps/}` - \ | ${PNMTOPNG} > ${.TARGET} +.pic.ps: + ${PIC2PS} ${.ALLSRC} > ${.TARGET} + # When ghostscript built with A4=yes is used, ps2epsi's paper size also # becomes the A4 size. However, the ps2epsi fails to convert grops(1) # outputs, which is the letter size, and we cannot change ps2epsi's paper size @@ -166,7 +169,7 @@ ${_curimage}: ${_curimage:S/.png/.eps/} | ${PNMTOPNG} > ${.TARGET} .endfor -.for _curimage in ${_IMAGES_EPS:S/.png$/.eps/} +.for _curimage in ${_IMAGES_PNG:S/.png$/.eps/} ${_curimage}: ${_curimage:S/.eps$/.png/} ${PNGTOPNM} ${PNGTOPNMOPTS} ${.ALLSRC} | \ ${PNMTOPS} ${PNMTOPSOPTS} > ${.TARGET} Modified: projects/xml-tools/share/xml/freebsd-print.dsl ============================================================================== --- projects/xml-tools/share/xml/freebsd-print.dsl Sun Mar 31 21:35:32 2013 (r41331) +++ projects/xml-tools/share/xml/freebsd-print.dsl Mon Apr 1 08:16:09 2013 (r41332) @@ -3,10 +3,6 @@ <!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [ <!ENTITY % output.rtf.images "IGNORE"> <!ENTITY % output.print "IGNORE"> -<!ENTITY % output.print.pdf "IGNORE"> -<!ENTITY % output.print.justify "IGNORE"> -<!ENTITY % output.print.twoside "IGNORE"> -<!ENTITY % output.print.niceheaders "IGNORE"> ]> <style-sheet> @@ -28,310 +24,6 @@ #f) ]]> - <!-- Two-sided Print output ....................................... --> - <![ %output.print.twoside; [ - - ;; From an email by Ian Castle to the DocBook-apps list - - (define ($component$) - (make simple-page-sequence - page-n-columns: %page-n-columns% - page-number-restart?: (or %page-number-restart% -; (book-start?) - (first-chapter?)) - page-number-format: ($page-number-format$) - use: default-text-style - left-header: ($left-header$) - center-header: ($center-header$) - right-header: ($right-header$) - left-footer: ($left-footer$) - center-footer: ($center-footer$) - right-footer: ($right-footer$) - start-indent: %body-start-indent% - input-whitespace-treatment: 'collapse - quadding: %default-quadding% - (make sequence - ($component-title$) - (process-children)) - (make-endnotes))) - - ;; From an email by Ian Castle to the DocBook-apps list - - (define (first-part?) - (let* ((book (ancestor (normalize "book"))) - (nd (ancestor-member (current-node) - (append - (component-element-list) - (division-element-list)))) - (bookch (children book))) - (let loop ((nl bookch)) - (if (node-list-empty? nl) - #f - (if (equal? (gi (node-list-first nl)) (normalize "part")) - (if (node-list=? (node-list-first nl) nd) - #t - #f) - (loop (node-list-rest nl))))))) - - - ;; From an email by Ian Castle to the DocBook-apps list - - (define (first-chapter?) - ;; Returns #t if the current-node is in the first chapter of a book - (if (has-ancestor-member? (current-node) (division-element-list)) - #f - (let* ((book (ancestor (normalize "book"))) - (nd (ancestor-member (current-node) - (append (component-element-list) - (division-element-list)))) - (bookch (children book)) - (bookcomp (expand-children bookch (list (normalize "part"))))) - (let loop ((nl bookcomp)) - (if (node-list-empty? nl) - #f - (if (equal? (gi (node-list-first nl)) (normalize "chapter")) - (if (node-list=? (node-list-first nl) nd) - #t - #f) - (loop (node-list-rest nl)))))))) - - - ; By default, the Part I title page will be given a roman numeral, - ; which is wrong so we have to fix it - - (define (part-titlepage elements #!optional (side 'recto)) - (let ((nodelist (titlepage-nodelist - (if (equal? side 'recto) - (part-titlepage-recto-elements) - (part-titlepage-verso-elements)) - elements)) - ;; partintro is a special case... - (partintro (node-list-first - (node-list-filter-by-gi elements (list (normalize "partintro")))))) - (if (part-titlepage-content? elements side) - (make simple-page-sequence - page-n-columns: %titlepage-n-columns% - ;; Make sure that page number format is correct. - page-number-format: ($page-number-format$) - ;; Make sure that the page number is set to 1 if this is the first part - ;; in the book - page-number-restart?: (first-part?) - input-whitespace-treatment: 'collapse - use: default-text-style - - ;; This hack is required for the RTF backend. If an - ;; external-graphic is the first thing on the page, - ;; RTF doesn't seem to do the right thing (the graphic - ;; winds up on the baseline of the first line of the - ;; page, left justified). This "one point rule" fixes - ;; that problem. - - (make paragraph - line-spacing: 1pt - (literal "")) - - (let loop ((nl nodelist) (lastnode (empty-node-list))) - (if (node-list-empty? nl) - (empty-sosofo) - (make sequence - (if (or (node-list-empty? lastnode) - (not (equal? (gi (node-list-first nl)) - (gi lastnode)))) - (part-titlepage-before (node-list-first nl) side) - (empty-sosofo)) - (cond - ((equal? (gi (node-list-first nl)) (normalize "subtitle")) - (part-titlepage-subtitle (node-list-first nl) side)) - ((equal? (gi (node-list-first nl)) (normalize "title")) - (part-titlepage-title (node-list-first nl) side)) - (else - (part-titlepage-default (node-list-first nl) side))) - (loop (node-list-rest nl) (node-list-first nl))))) - (if (and %generate-part-toc% - %generate-part-toc-on-titlepage% - (equal? side 'recto)) - (make display-group - (build-toc (current-node) - (toc-depth (current-node)))) - (empty-sosofo)) - - ;; PartIntro is a special case - (if (and (equal? side 'recto) - (not (node-list-empty? partintro)) - %generate-partintro-on-titlepage%) - ($process-partintro$ partintro #f) - (empty-sosofo))) - (empty-sosofo)))) - - ]]> - - <!-- Print with justification ..................................... --> - <![ %output.print.justify; [ - - (define %default-quadding% - 'justify) - - (define %hyphenation% - #t) - - - ;; The url.sty package is making all of the links purple/pink. - ;; Someone please fix this! - - (define (urlwrap) - (let ((%factor% (if %verbatim-size-factor% - %verbatim-size-factor% - 1.0))) - (make sequence - font-family-name: %mono-font-family% - font-size: (* (inherited-font-size) %factor%) - (make formatting-instruction data: - (string-append - "\\url|" - (data (current-node)) - "|"))))) - - (define (pathwrap) - (let ((%factor% (if %verbatim-size-factor% - %verbatim-size-factor% - 1.0))) - (make sequence - font-family-name: %mono-font-family% - font-size: (* (inherited-font-size) %factor%) - (make formatting-instruction data: - (string-append - "\\path|" - (data (current-node)) - "|"))))) - - ;; Some others may check the value of %hyphenation% and be - ;; specified below - -; (element email -; (make sequence -; (literal "<") -; (urlwrap) -; (literal ">"))) - - (element filename - (pathwrap)) - - (element varname - (pathwrap)) - - ]]> - - <![ %output.print.niceheaders; [ - - (define niceheader-rule-spacebefore (* (HSIZE 5) %head-before-factor%)) - (define niceheader-rule-spaceafter 0pt) - - (define ($component-title$) - (let* ((info (cond - ((equal? (gi) (normalize "appendix")) - (select-elements (children (current-node)) (normalize "docinfo"))) - ((equal? (gi) (normalize "article")) - (node-list-filter-by-gi (children (current-node)) - (list (normalize "artheader") - (normalize "articleinfo")))) - ((equal? (gi) (normalize "bibliography")) - (select-elements (children (current-node)) (normalize "docinfo"))) - ((equal? (gi) (normalize "chapter")) - (select-elements (children (current-node)) (normalize "docinfo"))) - ((equal? (gi) (normalize "dedication")) - (empty-node-list)) - ((equal? (gi) (normalize "glossary")) - (select-elements (children (current-node)) (normalize "docinfo"))) - ((equal? (gi) (normalize "index")) - (select-elements (children (current-node)) (normalize "docinfo"))) - ((equal? (gi) (normalize "preface")) - (select-elements (children (current-node)) (normalize "docinfo"))) - ((equal? (gi) (normalize "reference")) - (select-elements (children (current-node)) (normalize "docinfo"))) - ((equal? (gi) (normalize "setindex")) - (select-elements (children (current-node)) (normalize "docinfo"))) - (else - (empty-node-list)))) - (exp-children (if (node-list-empty? info) - (empty-node-list) - (expand-children (children info) - (list (normalize "bookbiblio") - (normalize "bibliomisc") - (normalize "biblioset"))))) - (parent-titles (select-elements (children (current-node)) (normalize "title"))) - (info-titles (select-elements exp-children (normalize "title"))) - (titles (if (node-list-empty? parent-titles) - info-titles - parent-titles)) - (subtitles (select-elements exp-children (normalize "subtitle")))) - (make sequence - (make paragraph - font-family-name: %title-font-family% - font-weight: 'bold - font-size: (HSIZE 4) - line-spacing: (* (HSIZE 4) %line-spacing-factor%) - space-before: (* (HSIZE 4) %head-before-factor%) - start-indent: 0pt - first-line-start-indent: 0pt - quadding: %component-title-quadding% - heading-level: (if %generate-heading-level% 1 0) - keep-with-next?: #t - - (if (string=? (element-label) "") - (empty-sosofo) - (literal (gentext-element-name-space (current-node)) - (element-label) - (gentext-label-title-sep (gi))))) - (make paragraph - font-family-name: %title-font-family% - font-weight: 'bold - font-posture: 'italic - font-size: (HSIZE 6) - line-spacing: (* (HSIZE 6) %line-spacing-factor%) -; space-before: (* (HSIZE 5) %head-before-factor%) - start-indent: 0pt - first-line-start-indent: 0pt - quadding: %component-title-quadding% - heading-level: (if %generate-heading-level% 1 0) - keep-with-next?: #t - - (if (node-list-empty? titles) - (element-title-sosofo) ;; get a default! - (with-mode component-title-mode - (make sequence - (process-node-list titles))))) - - (make paragraph - font-family-name: %title-font-family% - font-weight: 'bold - font-posture: 'italic - font-size: (HSIZE 3) - line-spacing: (* (HSIZE 3) %line-spacing-factor%) - space-before: (* 0.5 (* (HSIZE 3) %head-before-factor%)) - space-after: (* (HSIZE 4) %head-after-factor%) - start-indent: 0pt - first-line-start-indent: 0pt - quadding: %component-subtitle-quadding% - keep-with-next?: #t - - (with-mode component-title-mode - (make sequence - (process-node-list subtitles)))) - - (if (equal? (gi) (normalize "index")) - (empty-sosofo) - (make rule - length: %body-width% - display-alignment: 'start - space-before: niceheader-rule-spacebefore - space-after: niceheader-rule-spaceafter - line-thickness: 0.5pt))))) - - (element authorgroup - (empty-sosofo)) - - ]]> - <!-- Print only ................................................... --> <![ %output.print; [ (define withpgpkeys @@ -470,18 +162,10 @@ (notation (attribute-string (normalize "format") objdata))) (node-list-first nl))))) - ;; When selecting a filename to use, don't append the default - ;; extension, instead, just use the bare filename, and let TeX - ;; work it out. jadetex will use the .eps file, while pdfjadetex - ;; will use the .png file automatically. - (define (graphic-file filename) - (let ((ext (file-extension filename))) - (if (or tex-backend ;; TeX can work this out itself - (not filename) - (not %graphic-default-extension%) - (member ext %graphic-extensions%)) - filename - (string-append filename "." %graphic-default-extension%)))) + ;; Printed formats always use .eps images. + (define %graphic-default-extension% + "eps") + ;; Including bitmaps in the PS and PDF output tends to scale them ;; horribly. The solution is to scale them down by 50%. @@ -700,10 +384,6 @@ (process-node-list c))))))))))) ]]> - <![ %output.print.pdf; [ - - ]]> - </style-specification-body> </style-specification> </style-sheet> Modified: projects/xml-tools/share/xml/freebsd.dtd ============================================================================== --- projects/xml-tools/share/xml/freebsd.dtd Sun Mar 31 21:35:32 2013 (r41331) +++ projects/xml-tools/share/xml/freebsd.dtd Mon Apr 1 08:16:09 2013 (r41332) @@ -20,7 +20,6 @@ <!ENTITY % output.html "IGNORE"> <!-- HTML output is being generated --> <!ENTITY % output.html.images "IGNORE"> <!-- HTML with images --> <!ENTITY % output.print "IGNORE"> <!-- Print output is being generated --> -<!ENTITY % output.print.pdf "IGNORE"> <!-- PDF output --> <!-- ..................................................................... --> <!-- Entities for element classes and mixtures ........................... --> Modified: projects/xml-tools/share/xml/freebsd45.dtd ============================================================================== --- projects/xml-tools/share/xml/freebsd45.dtd Sun Mar 31 21:35:32 2013 (r41331) +++ projects/xml-tools/share/xml/freebsd45.dtd Mon Apr 1 08:16:09 2013 (r41332) @@ -1,7 +1,6 @@ <!ENTITY % output.html "IGNORE"> <!-- HTML output is being generated --> <!ENTITY % output.html.images "IGNORE"> <!-- HTML with images --> <!ENTITY % output.print "IGNORE"> <!-- Print output is being generated --> -<!ENTITY % output.print.pdf "IGNORE"> <!-- PDF output --> <!-- XXX: Jade is given a totally parsed document with XML tools so it does not need to pull in entity sets and catalogs Modified: projects/xml-tools/share/xsl/freebsd-common.xsl ============================================================================== --- projects/xml-tools/share/xsl/freebsd-common.xsl Sun Mar 31 21:35:32 2013 (r41331) +++ projects/xml-tools/share/xsl/freebsd-common.xsl Mon Apr 1 08:16:09 2013 (r41332) @@ -19,4 +19,6 @@ <xsl:param name="section.label.includes.component.label" select="1"/> <xsl:param name="generate.index" select="0"/> + + <xsl:param name="graphic.default.extension">png</xsl:param> </xsl:stylesheet> Modified: projects/xml-tools/share/xsl/freebsd-fo.xsl ============================================================================== --- projects/xml-tools/share/xsl/freebsd-fo.xsl Sun Mar 31 21:35:32 2013 (r41331) +++ projects/xml-tools/share/xsl/freebsd-fo.xsl Mon Apr 1 08:16:09 2013 (r41332) @@ -16,15 +16,6 @@ <!-- Redefine variables, and replace templates as necessary here --> - <xsl:param name="freebsd.output.print" - select="'0'"/> - <xsl:param name="freebsd.output.print.pdf" - select="'0'"/> - <xsl:param name="freebsd.output.print.justify" - select="'0'"/> - <xsl:param name="freebsd.output.print.twoside" - select="'0'"/> - <!-- FO specific customisation goes here --> <xsl:param name="use.extensions" select="1"/>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201304010816.r318G9Cj085943>