-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Graphic or logo in the header #44
base: develop
Are you sure you want to change the base?
Changes from 25 commits
7ed9c20
e911f56
3877f83
9dad7d6
f89141f
f9c4c33
ffcf757
c324c08
6f34d84
4b4d7c8
283b9bc
339280c
17aa61d
547da13
c6a9877
0e48460
bad3751
a5f09fd
4ad0914
5afd918
b554bf2
73982f8
7750465
39ac4fe
56f952d
ac67984
8667d2d
6e644b9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,3 +34,7 @@ tmp/ | |
|
||
*.zip | ||
*.tar.* | ||
|
||
DocBook-Cookbook\.xpr | ||
|
||
*.xpr |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project version="20.0"> | ||
<project version="20.1"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file shouldn't be modified in this PR. Unfortunately, oXygen does it automatically. Can you revert the change of this file? |
||
<meta> | ||
<filters directoryPatterns="" filePatterns="" positiveFilePatterns="" showHiddenFiles="false"/> | ||
<options> | ||
<serialized version="20.0" xml:space="preserve"> | ||
<serialized version="20.1" xml:space="preserve"> | ||
<serializableOrderedMap> | ||
<entry> | ||
<String>document.types</String> | ||
|
@@ -503,7 +503,11 @@ | |
</entry> | ||
<entry> | ||
<String>editor.font</String> | ||
<String>DejaVu Sans Mono,0,13</String> | ||
<String>Source Code Pro,0,16</String> | ||
</entry> | ||
<entry> | ||
<String>editor.line.wrap</String> | ||
<Boolean>true</Boolean> | ||
</entry> | ||
<entry> | ||
<String>editor.print.margin.columns</String> | ||
|
@@ -538,19 +542,19 @@ | |
</entry> | ||
<entry> | ||
<String>font.for.author.v12</String> | ||
<String>Droid Serif,0,15</String> | ||
<String>Source Sans Pro,0,16</String> | ||
</entry> | ||
<entry> | ||
<String>font.for.gui</String> | ||
<String>DejaVu Sans Condensed,0,13</String> | ||
<String>Monospaced,0,14</String> | ||
</entry> | ||
<entry> | ||
<String>font.for.schema</String> | ||
<String>Droid Sans,0,15</String> | ||
<String>Source Serif Pro,0,16</String> | ||
</entry> | ||
<entry> | ||
<String>font.for.text</String> | ||
<String>Droid Sans,0,14</String> | ||
<String>Monospaced,0,14</String> | ||
</entry> | ||
<entry> | ||
<String>key.editor.document.type.association.option.pane</String> | ||
|
@@ -1615,6 +1619,8 @@ | |
<folder name="fo"> | ||
<file name="en/xml/fo/topic.design-titlepages.xml"/> | ||
<file name="en/xml/fo/topic.empty-header-and-footer.xml"/> | ||
<file name="en/xml/fo/topic.graphic-pageheader.xml"/> | ||
<file name="en/xml/fo/topic.graphic-titlepage.xml"/> | ||
<file name="en/xml/fo/topic.hyphenating-urls.xml"/> | ||
<file name="en/xml/fo/topic.initials.xml"/> | ||
<file name="en/xml/fo/topic.line-height.xml"/> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xsl:stylesheet version="1.0" | ||
xmlns:fo="http://www.w3.org/1999/XSL/Format" | ||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
xmlns:d="http://docbook.org/ns/docbook"> | ||
|
||
<xsl:import href="https://cdn.docbook.org/release/xsl/current/xhtml/docbook.xsl"/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This URL looks strange. Shouldn't it be ".../fo/docbook.xsl"? |
||
|
||
<xsl:include href="graphic-pageheader.xsl"/> | ||
|
||
</xsl:stylesheet> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,295 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xsl:stylesheet version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format" | ||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
xmlns:xs="http://www.w3.org/2001/XMLSchema" | ||
xmlns:d="http://docbook.org/ns/docbook"> | ||
|
||
<!-- Path to your logo file --> | ||
<xsl:param name="logo.src.path">logo/</xsl:param> | ||
<!-- Name of your logo file --> | ||
<xsl:param name="header.image.filename">Opensource.svg</xsl:param> | ||
<!-- Header rule yes (1) / no (0) --> | ||
<xsl:param name="header.rule" select="0"/> | ||
|
||
<xsl:template name="header.table"> | ||
<xsl:param name="pageclass" select="''"/> | ||
<xsl:param name="sequence" select="''"/> | ||
<xsl:param name="gentext-key" select="''"/> | ||
|
||
<!-- default is a single table style for all headers --> | ||
<!-- Customize it for different page classes or sequence location --> | ||
|
||
<xsl:variable name="column1"> | ||
<xsl:choose> | ||
<xsl:when test="$double.sided = 0">1</xsl:when> | ||
<xsl:when test="$sequence = 'first' or $sequence = 'odd'" | ||
>1</xsl:when> | ||
<xsl:otherwise>3</xsl:otherwise> | ||
</xsl:choose> | ||
</xsl:variable> | ||
|
||
<xsl:variable name="column3"> | ||
<xsl:choose> | ||
<xsl:when test="$double.sided = 0">3</xsl:when> | ||
<xsl:when test="$sequence = 'first' or $sequence = 'odd'" | ||
>3</xsl:when> | ||
<xsl:otherwise>1</xsl:otherwise> | ||
</xsl:choose> | ||
</xsl:variable> | ||
|
||
<xsl:variable name="candidate"> | ||
<fo:table xsl:use-attribute-sets="header.table.properties"> | ||
<xsl:call-template name="head.sep.rule"> | ||
<xsl:with-param name="pageclass" select="$pageclass"/> | ||
<xsl:with-param name="sequence" select="$sequence"/> | ||
<xsl:with-param name="gentext-key" select="$gentext-key"/> | ||
</xsl:call-template> | ||
|
||
<fo:table-column column-number="1"> | ||
<xsl:attribute name="column-width"> | ||
<xsl:text>proportional-column-width(</xsl:text> | ||
<xsl:call-template name="header.footer.width"> | ||
<xsl:with-param name="location" | ||
>header</xsl:with-param> | ||
<xsl:with-param name="position" select="$column1"/> | ||
<xsl:with-param name="pageclass" select="$pageclass"/> | ||
<xsl:with-param name="sequence" select="$sequence"/> | ||
<xsl:with-param name="gentext-key" | ||
select="$gentext-key"/> | ||
</xsl:call-template> | ||
<xsl:text>)</xsl:text> | ||
</xsl:attribute> | ||
</fo:table-column> | ||
<fo:table-column column-number="2"> | ||
<xsl:attribute name="column-width"> | ||
<xsl:text>proportional-column-width(</xsl:text> | ||
<xsl:call-template name="header.footer.width"> | ||
<xsl:with-param name="location" | ||
>header</xsl:with-param> | ||
<xsl:with-param name="position" select="2"/> | ||
<xsl:with-param name="pageclass" select="$pageclass"/> | ||
<xsl:with-param name="sequence" select="$sequence"/> | ||
<xsl:with-param name="gentext-key" | ||
select="$gentext-key"/> | ||
</xsl:call-template> | ||
<xsl:text>)</xsl:text> | ||
</xsl:attribute> | ||
</fo:table-column> | ||
<fo:table-column column-number="3"> | ||
<xsl:attribute name="column-width"> | ||
<xsl:text>proportional-column-width(</xsl:text> | ||
<xsl:call-template name="header.footer.width"> | ||
<xsl:with-param name="location" | ||
>header</xsl:with-param> | ||
<xsl:with-param name="position" select="$column3"/> | ||
<xsl:with-param name="pageclass" select="$pageclass"/> | ||
<xsl:with-param name="sequence" select="$sequence"/> | ||
<xsl:with-param name="gentext-key" | ||
select="$gentext-key"/> | ||
</xsl:call-template> | ||
<xsl:text>)</xsl:text> | ||
</xsl:attribute> | ||
</fo:table-column> | ||
|
||
<fo:table-body> | ||
<fo:table-row> | ||
<xsl:attribute | ||
name="block-progression-dimension.minimum"> | ||
<xsl:value-of select="$header.table.height"/> | ||
</xsl:attribute> | ||
<fo:table-cell text-align="start" display-align="center"> | ||
<xsl:if test="$fop.extensions = 0"> | ||
<xsl:attribute name="relative-align" | ||
>baseline</xsl:attribute> | ||
</xsl:if> | ||
<fo:block> | ||
<xsl:call-template name="header.content"> | ||
<xsl:with-param name="pageclass" | ||
select="$pageclass"/> | ||
<xsl:with-param name="sequence" | ||
select="$sequence"/> | ||
<xsl:with-param name="position" | ||
select="$direction.align.start"/> | ||
<xsl:with-param name="gentext-key" | ||
select="$gentext-key"/> | ||
</xsl:call-template> | ||
</fo:block> | ||
</fo:table-cell> | ||
<fo:table-cell text-align="center" | ||
display-align="center"> | ||
<xsl:if test="$fop.extensions = 0"> | ||
<xsl:attribute name="relative-align" | ||
>baseline</xsl:attribute> | ||
</xsl:if> | ||
<fo:block> | ||
<xsl:call-template name="header.content"> | ||
<xsl:with-param name="pageclass" | ||
select="$pageclass"/> | ||
<xsl:with-param name="sequence" | ||
select="$sequence"/> | ||
<xsl:with-param name="position" | ||
select="'center'"/> | ||
<xsl:with-param name="gentext-key" | ||
select="$gentext-key"/> | ||
</xsl:call-template> | ||
</fo:block> | ||
</fo:table-cell> | ||
<fo:table-cell text-align="right" display-align="center"> | ||
<xsl:if test="$fop.extensions = 0"> | ||
<xsl:attribute name="relative-align" | ||
>baseline</xsl:attribute> | ||
</xsl:if> | ||
<fo:block> | ||
<xsl:call-template name="header.content"> | ||
<xsl:with-param name="pageclass" | ||
select="$pageclass"/> | ||
<xsl:with-param name="sequence" | ||
select="$sequence"/> | ||
<xsl:with-param name="position" | ||
select="$direction.align.end"/> | ||
<xsl:with-param name="gentext-key" | ||
select="$gentext-key"/> | ||
</xsl:call-template> | ||
</fo:block> | ||
</fo:table-cell> | ||
</fo:table-row> | ||
</fo:table-body> | ||
</fo:table> | ||
</xsl:variable> | ||
|
||
<!-- Really output a header? --> | ||
<xsl:choose> | ||
<xsl:when | ||
test=" | ||
$pageclass = 'titlepage' and $gentext-key = 'book' | ||
and $sequence = 'first'"> | ||
<!-- no, book titlepages have no headers at all --> | ||
</xsl:when> | ||
<xsl:when test="$sequence = 'blank' and $headers.on.blank.pages = 0"> | ||
<!-- no output --> | ||
</xsl:when> | ||
<xsl:otherwise> | ||
<xsl:copy-of select="$candidate"/> | ||
</xsl:otherwise> | ||
</xsl:choose> | ||
</xsl:template> | ||
|
||
<xsl:template name="header.content"> | ||
<xsl:param name="pageclass" select="''"/> | ||
<xsl:param name="sequence" select="''"/> | ||
<xsl:param name="position" select="''"/> | ||
<xsl:param name="gentext-key" select="''"/> | ||
|
||
<fo:block> | ||
<xsl:choose> | ||
<xsl:when test="$pageclass = 'titlepage'"> | ||
<!-- No footer on titlepages --> | ||
</xsl:when> | ||
<xsl:otherwise> | ||
<!-- Not a titlepage --> | ||
<xsl:choose> | ||
<xsl:when test="$double.sided = 0"> | ||
<!-- Start single-sided --> | ||
<xsl:choose> | ||
<xsl:when test="$position = 'left'"> | ||
<!-- Nothing or maybe a customer logo --> | ||
<fo:block> | ||
<xsl:apply-templates select="." | ||
mode="titleabbrev.markup"/> | ||
</fo:block> | ||
</xsl:when> | ||
<xsl:when test="$position = 'center'"> | ||
<!-- Nothing --> | ||
</xsl:when> | ||
<xsl:when test="$position = 'right'"> | ||
<fo:block> | ||
<fo:external-graphic | ||
content-height="10mm"> | ||
<xsl:attribute name="src"> | ||
<xsl:call-template | ||
name="fo-external-image"> | ||
<xsl:with-param name="filename" | ||
select="concat($logo.src.path, $header.image.filename)" | ||
/> | ||
</xsl:call-template> | ||
</xsl:attribute> | ||
</fo:external-graphic> | ||
</fo:block> | ||
</xsl:when> | ||
</xsl:choose> | ||
</xsl:when> | ||
<!-- End single-sided --> | ||
<xsl:otherwise> | ||
<!-- Start double-sided --> | ||
<xsl:choose> | ||
<xsl:when test="$position = 'left'"> | ||
<xsl:choose> | ||
<xsl:when | ||
test="$sequence = 'even' or $sequence = 'blank'"> | ||
<fo:block> | ||
<fo:external-graphic | ||
content-height="10mm"> | ||
<xsl:attribute name="src"> | ||
<xsl:call-template | ||
name="fo-external-image"> | ||
<xsl:with-param name="filename" | ||
select="concat($logo.src.path, $header.image.filename)" | ||
/> | ||
</xsl:call-template> | ||
</xsl:attribute> | ||
</fo:external-graphic> | ||
</fo:block> | ||
</xsl:when> | ||
<xsl:otherwise> | ||
<!-- Start left (odd) --> | ||
<fo:block> | ||
<xsl:apply-templates select="." | ||
mode="titleabbrev.markup"/> | ||
</fo:block> | ||
<!-- Nothing --> | ||
</xsl:otherwise> | ||
</xsl:choose> | ||
</xsl:when> | ||
<!-- End left (odd) --> | ||
<xsl:when test="$position = 'center'"> | ||
<!-- Nothing --> | ||
</xsl:when> | ||
<!-- Start right (even) --> | ||
<xsl:when test="$position = 'right'"> | ||
<xsl:choose> | ||
<xsl:when | ||
test=" | ||
$sequence = 'even' or | ||
$sequence = 'blank'"> | ||
<fo:block> | ||
<xsl:apply-templates select="." | ||
mode="titleabbrev.markup"/> | ||
</fo:block> | ||
</xsl:when> | ||
<xsl:otherwise> | ||
<fo:block> | ||
<fo:external-graphic | ||
content-height="10mm"> | ||
<xsl:attribute name="src"> | ||
<xsl:call-template | ||
name="fo-external-image"> | ||
<xsl:with-param name="filename" | ||
select="concat($logo.src.path, $header.image.filename)" | ||
/> | ||
</xsl:call-template> | ||
</xsl:attribute> | ||
</fo:external-graphic> | ||
</fo:block> | ||
</xsl:otherwise> | ||
</xsl:choose> | ||
</xsl:when> | ||
</xsl:choose> | ||
</xsl:otherwise> | ||
<!-- Double-sided --> | ||
</xsl:choose> | ||
</xsl:otherwise> | ||
<!--Not a title page--> | ||
</xsl:choose> | ||
</fo:block> | ||
</xsl:template> | ||
</xsl:stylesheet> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@der-schmelle2 Did you delete this file by accident? 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Tom,
I'm sorry for that.
Today I'm working on a new Windows Laptop with oXygenXML and Gitkraken. Gitkraken told me that I had changed the Docbook-Cookbook.xpr (which was correct). I set this file to ignore and Gitkraken tied to delete it. I don't know why it was deleted from the repo.
Maybe it's a better idea to stash the file.
Peter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem, don't worry. Such things can happen. 😃 It's easy to fix.
If you want to ignore the file, you can use a "global Git ignore" file like this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Tom,
thanks for the PDF output.
As discussed today I'll rewrite the hole section under a new feature branch due to more knowledge I received today. 😊