diff options
author | Lars Thorsen <[email protected]> | 2017-10-04 07:18:04 +0200 |
---|---|---|
committer | Lars Thorsen <[email protected]> | 2017-10-06 10:55:08 +0200 |
commit | d26187bcd2c12cfc126367f510a812b7b47899f2 (patch) | |
tree | 590e737ae01d35533487f32a3cc87f36a93fb5a2 /lib/erl_docgen/priv | |
parent | 3f4aac5b00959d3f0ddfaf54a3163cd75053dd24 (diff) | |
download | otp-d26187bcd2c12cfc126367f510a812b7b47899f2.tar.gz otp-d26187bcd2c12cfc126367f510a812b7b47899f2.tar.bz2 otp-d26187bcd2c12cfc126367f510a812b7b47899f2.zip |
[erl_docgen] Change pdf to have the same style as html for code,warning,note
Diffstat (limited to 'lib/erl_docgen/priv')
-rw-r--r-- | lib/erl_docgen/priv/xsl/db_pdf.xsl | 70 | ||||
-rw-r--r-- | lib/erl_docgen/priv/xsl/db_pdf_params.xsl | 128 |
2 files changed, 101 insertions, 97 deletions
diff --git a/lib/erl_docgen/priv/xsl/db_pdf.xsl b/lib/erl_docgen/priv/xsl/db_pdf.xsl index 99263847fb..a9abd0270f 100644 --- a/lib/erl_docgen/priv/xsl/db_pdf.xsl +++ b/lib/erl_docgen/priv/xsl/db_pdf.xsl @@ -687,7 +687,7 @@ <fo:block xsl:use-attribute-sets="cover.inner.copyrightnotice"> <xsl:value-of select="/book/header/legalnotice"/> - <!-- + <!-- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -744,12 +744,12 @@ <fo:bookmark internal-destination="{generate-id(header/title)}" starting-state="hide"> <fo:bookmark-title><xsl:value-of select="header/title"/></fo:bookmark-title> - + <xsl:call-template name="bookmarks2"> <xsl:with-param name="entries" select="chapter[header/title]"/> </xsl:call-template> - + </fo:bookmark> </xsl:for-each> </xsl:if> @@ -1122,52 +1122,60 @@ <!-- Note --> <xsl:template match="note"> <xsl:param name="partnum"/> - <fo:block xsl:use-attribute-sets="note"> - <fo:block xsl:use-attribute-sets="note-warning-title"> - <xsl:text>Note:</xsl:text> - </fo:block> - <xsl:apply-templates> - <xsl:with-param name="partnum" select="$partnum"/> - </xsl:apply-templates> + <fo:block xsl:use-attribute-sets="note-warning"> + <fo:block xsl:use-attribute-sets="note-title"> + <xsl:text>Note:</xsl:text> + </fo:block> + <fo:block xsl:use-attribute-sets="note-warning-content"> + <xsl:apply-templates> + <xsl:with-param name="partnum" select="$partnum"/> + </xsl:apply-templates> + </fo:block> </fo:block> </xsl:template> <!-- Warning --> <xsl:template match="warning"> <xsl:param name="partnum"/> - <fo:block xsl:use-attribute-sets="warning"> - <fo:block xsl:use-attribute-sets="note-warning-title"> - <xsl:text>Warning:</xsl:text> - </fo:block> - <xsl:apply-templates> - <xsl:with-param name="partnum" select="$partnum"/> - </xsl:apply-templates> + <fo:block xsl:use-attribute-sets="note-warning"> + <fo:block xsl:use-attribute-sets="warning-title"> + <xsl:text>Warning:</xsl:text> + </fo:block> + <fo:block xsl:use-attribute-sets="note-warning-content"> + <xsl:apply-templates> + <xsl:with-param name="partnum" select="$partnum"/> + </xsl:apply-templates> + </fo:block> </fo:block> </xsl:template> <!-- Do --> <xsl:template match="do"> <xsl:param name="partnum"/> - <fo:block xsl:use-attribute-sets="do"> - <fo:block xsl:use-attribute-sets="note-warning-title"> - <xsl:text>Do:</xsl:text> - </fo:block> - <xsl:apply-templates> - <xsl:with-param name="partnum" select="$partnum"/> - </xsl:apply-templates> + <fo:block xsl:use-attribute-sets="note-warning"> + <fo:block xsl:use-attribute-sets="note-title"> + <xsl:text>Do:</xsl:text> + </fo:block> + <fo:block xsl:use-attribute-sets="note-warning-content"> + <xsl:apply-templates> + <xsl:with-param name="partnum" select="$partnum"/> + </xsl:apply-templates> + </fo:block> </fo:block> </xsl:template> <!-- Dont --> <xsl:template match="dont"> <xsl:param name="partnum"/> - <fo:block xsl:use-attribute-sets="dont"> - <fo:block xsl:use-attribute-sets="note-warning-title"> - <xsl:text>Don't:</xsl:text> - </fo:block> - <xsl:apply-templates> - <xsl:with-param name="partnum" select="$partnum"/> - </xsl:apply-templates> + <fo:block xsl:use-attribute-sets="note-warning"> + <fo:block xsl:use-attribute-sets="warning-title"> + <xsl:text>Don't:</xsl:text> + </fo:block> + <fo:block xsl:use-attribute-sets="note-warning-content"> + <xsl:apply-templates> + <xsl:with-param name="partnum" select="$partnum"/> + </xsl:apply-templates> + </fo:block> </fo:block> </xsl:template> diff --git a/lib/erl_docgen/priv/xsl/db_pdf_params.xsl b/lib/erl_docgen/priv/xsl/db_pdf_params.xsl index d9a150d2d9..99da29c2ac 100644 --- a/lib/erl_docgen/priv/xsl/db_pdf_params.xsl +++ b/lib/erl_docgen/priv/xsl/db_pdf_params.xsl @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- +<!-- # # %CopyrightBegin% # - # Copyright Ericsson AB 2009-2016. All Rights Reserved. + # Copyright Ericsson AB 2009-2017. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ # limitations under the License. # # %CopyrightEnd% - + --> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" @@ -45,7 +45,7 @@ <xsl:param name="page-width">210mm</xsl:param> <!-- Paper size: US Letter (279x216 mm) --> - <!-- + <!-- <xsl:param name="page-height">11in</xsl:param> <xsl:param name="page-width">8.5in</xsl:param> --> @@ -248,86 +248,82 @@ </xsl:attribute-set> <xsl:attribute-set name="code"> - <xsl:attribute name="background-color">#e0e0ff</xsl:attribute> + <xsl:attribute name="background-color">#f1f3f5</xsl:attribute> + <xsl:attribute name="border-style">solid</xsl:attribute> + <xsl:attribute name="border-color">#dee2e6</xsl:attribute><!-- dee2e6--> + <xsl:attribute name="border-width">0.3mm</xsl:attribute> <xsl:attribute name="font-family">DejaVuSansMono, monospace</xsl:attribute> <xsl:attribute name="font-size">0.8em</xsl:attribute> - <xsl:attribute name="keep-together.within-page">auto</xsl:attribute> + <xsl:attribute name="keep-together.within-page">3</xsl:attribute> <xsl:attribute name="linefeed-treatment">preserve</xsl:attribute> - <xsl:attribute name="padding-before">0em</xsl:attribute> - <xsl:attribute name="padding-after">1em</xsl:attribute> - <xsl:attribute name="space-after">1em</xsl:attribute> - <xsl:attribute name="space-before">2em</xsl:attribute> - <xsl:attribute name="margin-left">0.5em</xsl:attribute> - <xsl:attribute name="margin-right">0.5em</xsl:attribute> + <xsl:attribute name="padding-before">1.5mm</xsl:attribute> + <xsl:attribute name="padding-after">1mm</xsl:attribute> + <xsl:attribute name="padding-left">1mm</xsl:attribute> + <xsl:attribute name="padding-right">1mm</xsl:attribute> + <xsl:attribute name="margin-left">1mm</xsl:attribute> + <xsl:attribute name="margin-right">1mm</xsl:attribute> <xsl:attribute name="white-space-collapse">false</xsl:attribute> <xsl:attribute name="white-space-treatment">preserve</xsl:attribute> <xsl:attribute name="wrap-option">no-wrap</xsl:attribute> + <xsl:attribute name="space-after">0.5em</xsl:attribute> + <xsl:attribute name="space-before">0.5em</xsl:attribute> </xsl:attribute-set> - - <xsl:attribute-set name="toc.level1"> <xsl:attribute name="space-before">1em</xsl:attribute> - </xsl:attribute-set> - -<xsl:attribute-set name="note"> - <xsl:attribute name="background-color">#d0fed0</xsl:attribute> - <xsl:attribute name="space-after">1em</xsl:attribute> - <xsl:attribute name="space-before">2em</xsl:attribute> - <xsl:attribute name="text-align">justify</xsl:attribute> - <xsl:attribute name="padding-before">1em</xsl:attribute> - <xsl:attribute name="padding-after">0.3em</xsl:attribute> - <xsl:attribute name="padding-left">0.5em</xsl:attribute> - <xsl:attribute name="padding-right">0.5em</xsl:attribute> - <xsl:attribute name="margin-left">0.5em</xsl:attribute> - <xsl:attribute name="margin-right">0.5em</xsl:attribute> - <xsl:attribute name="keep-together.within-page">always</xsl:attribute> </xsl:attribute-set> -<xsl:attribute-set name="warning"> - <xsl:attribute name="background-color">#ffd6d6</xsl:attribute> - <xsl:attribute name="space-after">1em</xsl:attribute> - <xsl:attribute name="space-before">2em</xsl:attribute> - <xsl:attribute name="text-align">justify</xsl:attribute> - <xsl:attribute name="padding-before">1em</xsl:attribute> - <xsl:attribute name="padding-after">0.3em</xsl:attribute> - <xsl:attribute name="padding-left">0.5em</xsl:attribute> - <xsl:attribute name="padding-right">0.5em</xsl:attribute> - <xsl:attribute name="margin-left">0.5em</xsl:attribute> - <xsl:attribute name="margin-right">0.5em</xsl:attribute> - <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + <xsl:attribute-set name="note-title"> + <xsl:attribute name="space-before">0.5em</xsl:attribute> + <xsl:attribute name="border-style">solid</xsl:attribute> + <xsl:attribute name="border-bottom-width">0mm</xsl:attribute> + <xsl:attribute name="border-color">#495057</xsl:attribute> + <xsl:attribute name="background-color">#2b8a3e</xsl:attribute> + <xsl:attribute name="font-weight">bold</xsl:attribute> + <xsl:attribute name="color">#fefefe</xsl:attribute> + <xsl:attribute name="padding-before">1mm</xsl:attribute> + <xsl:attribute name="padding-after">0.5mm</xsl:attribute> + <xsl:attribute name="padding-left">1mm</xsl:attribute> + <xsl:attribute name="padding-right">1mm</xsl:attribute> + <xsl:attribute name="margin-left">1mm</xsl:attribute> + <xsl:attribute name="margin-right">1mm</xsl:attribute> + <xsl:attribute name="font-size">1.33em</xsl:attribute> </xsl:attribute-set> -<xsl:attribute-set name="do"> - <xsl:attribute name="background-color">#d0fed0</xsl:attribute> - <xsl:attribute name="space-after">1em</xsl:attribute> - <xsl:attribute name="space-before">2em</xsl:attribute> - <xsl:attribute name="text-align">justify</xsl:attribute> - <xsl:attribute name="padding-before">1em</xsl:attribute> - <xsl:attribute name="padding-after">0.3em</xsl:attribute> - <xsl:attribute name="padding-left">0.5em</xsl:attribute> - <xsl:attribute name="padding-right">0.5em</xsl:attribute> - <xsl:attribute name="margin-left">0.5em</xsl:attribute> - <xsl:attribute name="margin-right">0.5em</xsl:attribute> + <xsl:attribute-set name="note-warning"> <xsl:attribute name="keep-together.within-page">always</xsl:attribute> </xsl:attribute-set> -<xsl:attribute-set name="dont"> - <xsl:attribute name="background-color">#ffd6d6</xsl:attribute> - <xsl:attribute name="space-after">1em</xsl:attribute> - <xsl:attribute name="space-before">2em</xsl:attribute> - <xsl:attribute name="text-align">justify</xsl:attribute> - <xsl:attribute name="padding-before">1em</xsl:attribute> - <xsl:attribute name="padding-after">0.3em</xsl:attribute> - <xsl:attribute name="padding-left">0.5em</xsl:attribute> - <xsl:attribute name="padding-right">0.5em</xsl:attribute> - <xsl:attribute name="margin-left">0.5em</xsl:attribute> - <xsl:attribute name="margin-right">0.5em</xsl:attribute> - <xsl:attribute name="keep-together.within-page">always</xsl:attribute> + <xsl:attribute-set name="warning-title"> + <xsl:attribute name="space-before">0.5em</xsl:attribute> + <xsl:attribute name="border-style">solid</xsl:attribute> + <xsl:attribute name="border-bottom-width">0mm</xsl:attribute> + <xsl:attribute name="border-color">#495057</xsl:attribute> + <xsl:attribute name="background-color">#c92a2a</xsl:attribute> + <xsl:attribute name="font-weight">bold</xsl:attribute> + <xsl:attribute name="color">#fefefe</xsl:attribute> + <xsl:attribute name="padding-before">1mm</xsl:attribute> + <xsl:attribute name="padding-after">0.5mm</xsl:attribute> + <xsl:attribute name="padding-left">1mm</xsl:attribute> + <xsl:attribute name="padding-right">1mm</xsl:attribute> + <xsl:attribute name="margin-left">1mm</xsl:attribute> + <xsl:attribute name="margin-right">1mm</xsl:attribute> + <xsl:attribute name="font-size">1.33em</xsl:attribute> </xsl:attribute-set> - <xsl:attribute-set name="note-warning-title"> - <xsl:attribute name="font-size">1.33em</xsl:attribute> + <xsl:attribute-set name="note-warning-content"> + <xsl:attribute name="space-after">0.5em</xsl:attribute> + <xsl:attribute name="border-style">solid</xsl:attribute> + <xsl:attribute name="border-top-width">0mm</xsl:attribute> + <xsl:attribute name="border-color">#495057</xsl:attribute> + <xsl:attribute name="background-color">#f8f9fa</xsl:attribute> + <xsl:attribute name="text-align">justify</xsl:attribute> + <xsl:attribute name="padding-before">1mm</xsl:attribute> + <xsl:attribute name="padding-after">0.5mm</xsl:attribute> + <xsl:attribute name="padding-left">1mm</xsl:attribute> + <xsl:attribute name="padding-right">1mm</xsl:attribute> + <xsl:attribute name="margin-left">1mm</xsl:attribute> + <xsl:attribute name="margin-right">1mm</xsl:attribute> </xsl:attribute-set> <xsl:attribute-set name="module-header"> @@ -354,7 +350,7 @@ <xsl:attribute name="keep-with-next.within-page">always</xsl:attribute> <xsl:attribute name="space-after">0.25em</xsl:attribute> <!-- xsl:attribute name="space-before">1.5em</xsl:attribute --> - </xsl:attribute-set> + </xsl:attribute-set> <xsl:attribute-set name="type-listblock"> <xsl:attribute name="provisional-distance-between-starts">1.8em</xsl:attribute> |