Last active
May 14, 2018 15:29
-
-
Save peterfleck/e33c8f99667987dcb84ebf7f5c0a5b05 to your computer and use it in GitHub Desktop.
Revisions
-
peterfleck revised this gist
May 14, 2018 . 1 changed file with 23 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -100,4 +100,26 @@ The Docbook guide can be found here [https://tdg.docbook.org/](https://tdg.docbo <xsl:template match="processing-instruction('hard-pagebreak')"> <fo:block break-after="page"/> </xsl:template> ```` ## HTML Copy RDFa attributes ``` <xsl:template name="common.html.attributes"> <xsl:param name="inherit" select="0"/> <xsl:param name="class" select="local-name(.)"/> <xsl:apply-templates select="." mode="common.html.attributes"> <xsl:with-param name="class" select="$class"/> <xsl:with-param name="inherit" select="$inherit"/> </xsl:apply-templates> <xsl:apply-templates select="." mode="rdfa.html.attributes"/> </xsl:template> <xsl:template match="*" mode="rdfa.html.attributes"> <xsl:copy-of select="@vocab"/> <xsl:copy-of select="@typeof"/> <xsl:copy-of select="@property"/> <xsl:copy-of select="@resource"/> <xsl:copy-of select="@Prefix"/> </xsl:template> ``` -
peterfleck revised this gist
May 14, 2018 . 1 changed file with 9 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -92,4 +92,12 @@ The Docbook guide can be found here [https://tdg.docbook.org/](https://tdg.docbo </xsl:otherwise> </xsl:choose> </xsl:template> ``` ## Page-break ``` <xsl:template match="processing-instruction('hard-pagebreak')"> <fo:block break-after="page"/> </xsl:template> ```` -
peterfleck revised this gist
May 14, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -49,7 +49,7 @@ The Docbook guide can be found here [https://tdg.docbook.org/](https://tdg.docbo ``` ## Inlines ### Add extras to `<emphasis>` ``` <xsl:template match="d:emphasis"> -
peterfleck revised this gist
May 14, 2018 . 1 changed file with 73 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,9 +4,10 @@ The Docbook guide can be found here [https://tdg.docbook.org/](https://tdg.docbo ## Paragraphs ### Indent paragraphs and allow alignment ``` <xsl:attribute-set name="normal.para.spacing"> <xsl:attribute name="space-before.optimum">0em</xsl:attribute> <xsl:attribute name="space-before.minimum">0em</xsl:attribute> <xsl:attribute name="space-before.maximum">0em</xsl:attribute> @@ -22,4 +23,73 @@ The Docbook guide can be found here [https://tdg.docbook.org/](https://tdg.docbo <fo:block text-indent="0em"> <xsl:apply-imports/> </fo:block> </xsl:template> <xsl:attribute-set name="para.properties" use-attribute-sets="normal.para.spacing"> <xsl:attribute name="text-align"> <xsl:choose> <xsl:when test="@role = 'left'">left</xsl:when> <xsl:when test="@role = 'justify'">justify</xsl:when> <xsl:when test="@role = 'right'">right</xsl:when> <xsl:when test="@role = 'center'">center</xsl:when> <xsl:otherwise>inherit</xsl:otherwise> </xsl:choose> </xsl:attribute> <xsl:attribute name="text-indent"> <xsl:choose> <xsl:when test="@role = 'indent'">5mm</xsl:when> <xsl:when test="@role = 'double-indent'">10mm</xsl:when> <xsl:when test="@role = 'print-no-indent'">0in</xsl:when> <xsl:when test="@role = 'no-indent'">0in</xsl:when> <xsl:otherwise>inherit</xsl:otherwise> </xsl:choose> </xsl:attribute> </xsl:attribute-set> ``` ## Inlines ### Add extras to <emphasis> ``` <xsl:template match="d:emphasis"> <xsl:choose> <xsl:when test="@role='bold' or @role='strong'"> <xsl:call-template name="inline.boldseq"/> </xsl:when> <xsl:when test="@role='underline'"> <fo:inline text-decoration="underline"> <xsl:call-template name="inline.charseq"/> </fo:inline> </xsl:when> <xsl:when test="@role='strikethrough' or @role='line-through'"> <fo:inline text-decoration="line-through"> <xsl:call-template name="inline.charseq"/> </fo:inline> </xsl:when> <xsl:when test="@role='overline'"> <fo:inline text-decoration="overline"> <xsl:call-template name="inline.charseq"/> </fo:inline> </xsl:when> <xsl:when test="@role='double'"> <fo:inline border-after-style="double" border-after-width="1mm"> <xsl:call-template name="inline.charseq"/> </fo:inline> </xsl:when> <xsl:otherwise> <xsl:variable name="depth" select="count(ancestor::d:emphasis [not(contains(' bold strong underline strikethrough ', concat(' ', @role, ' ')))] )"/> <xsl:choose> <xsl:when test="$depth mod 2 = 1"> <fo:inline font-style="normal"> <xsl:apply-templates/> </fo:inline> </xsl:when> <xsl:otherwise> <xsl:call-template name="inline.italicseq"/> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </xsl:template> ``` -
peterfleck created this gist
May 14, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ # Docbook Snippets The Docbook guide can be found here [https://tdg.docbook.org/](https://tdg.docbook.org/) ## Paragraphs ### Indent paragraphs ``` <xsl:attribute-set name="normal.para.spacing"> <xsl:attribute name="space-before.optimum">0em</xsl:attribute> <xsl:attribute name="space-before.minimum">0em</xsl:attribute> <xsl:attribute name="space-before.maximum">0em</xsl:attribute> </xsl:attribute-set> <xsl:template match="d:para[preceding-sibling::d:para]"> <fo:block text-indent="5mm"> <xsl:apply-imports/> </fo:block> </xsl:template> <xsl:template match="d:para[1] | d:para[preceding-sibling::*[1][not(self::d:para)]]" priority="6"> <fo:block text-indent="0em"> <xsl:apply-imports/> </fo:block> </xsl:template>```