Skip to content
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

Open
wants to merge 28 commits into
base: develop
Choose a base branch
from

Conversation

der-schmelle2
Copy link
Collaborator

Changes proposed in this pull request:

  • Section about how to place a graphic or logo in the page header (or footer)

@der-schmelle2 der-schmelle2 self-assigned this Jul 1, 2018
Copy link
Owner

@tomschr tomschr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Peter for your contributions! 👍

Don't worry about the excessive comments. I reviewed it thoroughly and that's the result. Hope you don't feel overwhelmed. 😉

If you have questions or don't agree with one of my opinions, let me know and we can discuss this.

xmlns="http://docbook.org/ns/docbook"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Inserting Graphics to your Page Headers or Footers</title>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rephrase it to "Inserting Graphics into Page Headers and Footer"?
Hmn, thinking about if "Logos" instead of "Graphics" would be more appropriate?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.
New title is: "Inserting Logos into Page Headers and Footers"

<keyword>page header</keyword>
<keyword>block</keyword>
<keyword>format</keyword>
<keyword>page</keyword>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add additional keywords like "header" and "footer". I would remove block, it's quite general and as such almost useless.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.
Changed keywords to:

page header
page footer
header
footer
format
page


<section role="solution">
<title>Solution</title>
<para>First of all, you need to create a customization layer in your
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically, this is all nice and correct. However, not everybody read the book from start to end. Usually, users see a topic, jump in and read. That's why you cannot expect they know all the terms and workflows (for example, "customization layer").

I would suggest to structure the solution section like this:

  1. Explain first, why you need logos/graphics in the header or footer. What's the benefits?
  2. Present the user a very general idea what you will show. In your case, mention that the following stylesheet will create a logo on the right side only.
  3. Optionally, you can show the result as a nice graphic. That way, the reader has at least an idea what it is all about.

After you did your "introduction", give the reader a procedure with a step-by-step instruction how to create this solution. You can use Creating Permalinks as a blueprint or the XML file en/xml/html/topic.permalinks.xml.

Appyling that style to this topic would mean:

  1. Give your changes a file name, for example, logo-right-header.xsl. Basically, it can be any name as long as it is easy to remember and reflects its purpose.
  2. Make sure, your stylesheet is syntactically correct and starts with the appropriate root element (xsl:stylesheet).
  3. Apply steps 1-2 from the "Creating Permalinks" topic to your file.
  4. Finish your last step with the phrase: "Use your customization layer to transform your DocBook document into FO."

I guess, it would only need 3 to 4 steps.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

<title>Solution</title>
<para>First of all, you need to create a customization layer in your
customization stylesheet containing the following code:</para>
<programlisting>&lt;!-- Path and name of your graphic file-->
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two issues:

  • add the attribute language="xml" into <programlisting>.
  • Add the missing XSLT header (root element, namespaces etc.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

<para>First of all, you need to create a customization layer in your
customization stylesheet containing the following code:</para>
<programlisting>&lt;!-- Path and name of your graphic file-->
&lt;xsl:param name="header.image.filename">{$img.src.path}your-graphic.svg&lt;/xsl:param>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That won't work because you've included it as text. Text won't be replaced, you need the select attribute:

<xsl:param name="header.image.filename" select="concat($img.src.path, 'your-graphic.svg')"/>

Another idea from an implementation perspective: would it better to separate the logo file name from any path? In other words, the parameter header.image.filename could just hold the base file name (without any paths). The exact location is created in line 88 with the above concat(...) expression. What do you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what you mean. Do you mean this:
<xsl:param name="header.image.filename">your-graphic.svg>/xsl:param>
<xsl:param name="header.image.filename" select="concat($img.src.path, 'your-graphic.svg')"/>

Copy link
Owner

@tomschr tomschr Jul 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My idea was that header.image.filename contains only the file name and nothing else:

<xsl:param name="header.image.filename">your-graphic.svg</xsl:param>

The complete path would be built at the position where it is needed by concatenating it with $img.src.path. Does that make any sense? 😉

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. That makes sense. Thanks!
The complete solution looks like this?
<xsl:param name="img.src.path">./Images/</xsl:param>
<xsl:param name="header.image.filename">your-graphic.svg</xsl:param>
xsl:param name="header.image.filename" select="concat($img.src.path, 'your-graphic.svg')"/>
I‘m not sure if this is correct, because 'your-graphic.svg' after concatenation is incorrect.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost. 😉 These lines are correct:

<xsl:param name="img.src.path">./Images/</xsl:param>
<xsl:param name="header.image.filename">your-graphic.svg</xsl:param>

A little bit deeper you use the parameter header.image.filename in this code:

&lt;xsl:call-template name="fo-external-image"><co xml:id="co.topic.graphic-pageheader.template"/>
     &lt;xsl:with-param name="filename" select="concat($img.src.path, $header.image.filename)"/><co xml:id="co.topic.graphic-pageheader.file"/>>
&lt;/xsl:call-template>

Keep in mind the following changes in comparison to your code:

  • xsl:param inside xsl:call-template has to be xsl:with-param.
  • the parameter for the template fo-external-image has to be filename, not header.image.filename.
  • you pass the complete path in the select attribute of xsl:with-param.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

graphic should be visible on all pages on the right side.</para>
</callout>
<callout arearefs="co.topic.graphic-pageheader.height">
<para>The graphic picture is too big, so we limit his height to 25mm.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rephrase the sentence as:

To avoid pictures which are too big for the headline, we limit its height to 25mm.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

</callout>
<callout arearefs="co.topic.graphic-pageheader.attribute">
<para>We will give the graphic which will be used the attribute.
<emphasis>src</emphasis>.</para>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That isn't an English sentence. 😉 Maybe something like this:

The filename is passed on the <tag class="attribute">src</tag> attribute.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. :-)
Thanks!

<title>Discussion</title>
<para>If you wish to place your graphic within the footer, replace
<tag>header.content</tag>with<tag>footer.content</tag>.</para>
</section>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The discussion is a bit... well, very short. 😉

Usually, I apply the following approach for each topic:

  • First, I state the problem
  • Second, I present a solution which is easy, general, or short.
  • Third, I present further additions. What can the reader do with that solution? Maybe he has further needs, wishes, or problems?

Overall, I try to make the solution more general, but the discussion more specific.

As a reader, I would expect some additional ideas. Some ideas that come to my mind and could be added:

  • Why do I need that? What are the reasons? At least, this is very important to give the reader a purpose.
    This could be layout issues, corporate identity, etc.
  • What should I do when I have a double sided document?
    Your solution does not take into account double sided documents, right?
  • What should I change, if I want my logo appear left on a verso page and right on a recto page?
  • Are there any recommendations prior to this stylesheets in regards to file size, file format etc.?
  • Could I change the logo depending on the chapter?
    For example, the logo file name could be added in the info element of the respective chapter

Of course, you don't have to describe all of them. It's just an idea what can be included.

intentionally left blank'</emphasis> or so.</para>
</callout>
<callout arearefs="co.topic.graphic-pageheader.center">
<para>This is a good place for the chapter title.</para>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you do that? That can be a good place for the discussion.

<title>Solution</title>
<para>First of all, you need to create a customization layer in your
customization stylesheet containing the following code:</para>
<programlisting>&lt;!-- Path and name of your graphic file-->
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Further ideas which makes handling of such files easier:

  • Use <example> around your programlisting element.
    This makes it easier to refer to it and you can give it a title and name (see Creating Permalinks, Example 5.1
  • Outsource your XSLT stylesheet into a separate file and xi:include it in your XML source.
    This helps in making example files and (more important!) gives our readers the chance to download this file
  • Reduces the size of your XML file.

If you like this approach, I'd recommend the following:

  1. Create a directory logo under fo.
  2. Save you XSLT stylesheet in fo/logo/YOUR_STYLESHEET.xsl. Replace the placeholder YOUR_STYLESHEET.xsl with some useful name.
  3. Replace the content of your stylesheet code in your XML file with the following content:
<example xml:id="ex.fo.XXXXX">
   <title>Some good title (<filename>YOUR_STYLESHEET.xsl</filename>)</title>
   <info>
        <output xmlns="urn:x-toms:docbook-ext">
          <filename>logo/YOUR_STYLESHEET.xsl</filename>
        </output>
   </info>
   <programlistingco>
      <areaspec>
            <!-- Add your callouts through <area/> -->
      </areaspec>
      <programlisting language="xml" linenumbering="numbered"
          ><xi:include href="logo/YOUR_STYLESHEET.xsl" parse="text"
          /></programlisting>
   </programlistingco>
</example>

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, but with a similar way. I've placed all necessary files below the folder "graphic-pageheader/".

@tomschr tomschr added the PDF 🖨️ PDF output format label Jul 1, 2018
@tomschr tomschr added this to Todo in Cookbook via automation Jul 1, 2018
@tomschr tomschr moved this from Todo to In progress in Cookbook Jul 10, 2018
@@ -57,7 +57,8 @@
xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns="http://docbook.org/ns/docbook"
xmlns:d="http://docbook.org/ns/docbook" version="1.0">
&lt;!-- Path and name of your graphic file-->
&lt;xsl:param name="header.image.filename">your-graphic.svg&lt;/xsl:param>
&lt;xsl:param name="img.src.path">./graphic-pageheader/>
&lt;xsl:param name="header.image.filename">Opensource.svg&lt;/xsl:param>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This contains a syntax error:

&lt;xsl:param name="img.src.path">./graphic-pageheader&lt;/xsl:param>

* Topics for discussion added

@tomschr Please review the "Solution" section, "Discussion" section will follow
http://docbook.sourceforge.net/release/xsl/1.76.1/doc/fo/img.src.path.html
**his prefix is not applied to any filerefs that start with "/" or contain "//:".**
;-)
Copy link
Owner

@tomschr tomschr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Peter for the contribution. I have some further things that you could implement. Nothing difficult.

Regarding the Discussion, I would do that later.

xmlns:d="http://docbook.org/ns/docbook">

<!-- Path and name of your graphic file-->
<xsl:param name="img.src.path">./graphic-pageheader/</xsl:param>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should/need to rename this parameter because there is already the same in the original DocBook stylesheets. Maybe something like logo.src.path? By default, it's empty:

<xsl:param name="logo.src.path"/>

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

<fo:external-graphic content-height="1in">
<xsl:attribute name="src">
<xsl:call-template name="fo-external-image">
<xsl:with-param name="filename" select="concat($img.src.path, $header.image.filename)"/>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you would replace img.src.path with logo.src.path.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

<filename>graphic-pageheader/graphic-pageheader.xsl</filename>
</output>
</info>
<programlisting language="xml">&lt;?xml version="1.0" encoding="UTF-8"?>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is dangerous: you have on one side the file graphic-pageheader/graphic-pageheader.xsl and the content inside programlisting. This is risky as it leads to inconsistencies in both files.

I would suggest to use xi:include inside programlisting, you forgot that what I described in comment #44 (comment) 😉 I've corrected the code with your current stylesheet name.

TODO: you need to add correct callouts.

<example xml:id="ex.fo.XXXXX">
   <title>Some good title (<filename>graphic-pageheader.xsl</filename>)</title>
   <info>
        <output xmlns="urn:x-toms:docbook-ext">
          <filename>graphic-pageheader/graphic-pageheader.xsl</filename>
        </output>
   </info>
   <programlistingco>
      <areaspec>
            <!-- Add your callouts through <area/> -->
      </areaspec>
      <programlisting language="xml" linenumbering="numbered"
          ><xi:include href="graphic-pageheader/graphic-pageheader.xsl" parse="text"
          /></programlisting>
   </programlistingco>
</example>

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've experimented with the areaspec element. You can use this snippet:

<areaspec>
     <area xml:id="co.topic.graphic-pageheader.path" coords="8"/>
     <area xml:id="co.topic.graphic-pageheader.content" coords="13"/>
     <area xml:id="co.topic.graphic-pageheader.variables" coords="14"/>
     <area xml:id="co.topic.graphic-pageheader.block" coords="18"/>
     <area xml:id="co.topic.graphic-pageheader.blank" coords="23"/>
     <area xml:id="co.topic.graphic-pageheader.center" coords="35"/>
     <area xml:id="co.topic.graphic-pageheader.right" coords="39"/>
     <area xml:id="co.topic.graphic-pageheader.height" coords="41 64" units="linecolumn"/>
     <area xml:id="co.topic.graphic-pageheader.attribute" coords="42"/>
     <area xml:id="co.topic.graphic-pageheader.template" coords="43 75" units="linecolumn"/>
     <area xml:id="co.topic.graphic-pageheader.file" coords="44 122" units="linecolumn"/>
</areaspec>

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added your recommendation, but I'm not sure if it's correct. :-)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I modified the line numbers a little bit because I've added a comment line.

</section>
<section role="discussion">
<title>Discussion</title>
<para>These points will be submitted later</para>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you could describe:

  • Put logo(s) inside a different directory and assign it with your new parameter logo.src.path.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

/></para>
</listitem>
<listitem>
<para>Parameter description for <tag>xsl:attribute</tag><link
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why you've add this, but IMHO this isn't really needed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

/></para>
</listitem>
<listitem>
<para>Parameter description for <tag>xsl:with-param</tag>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, I would also remove it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

See changed lines for more information
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:d="http://docbook.org/ns/docbook">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are missing the fo namespace. The root element has to be:

<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">

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Funny! I've taken the proposed header from your topic.permalinks.xml.... ;-)
I'll correct this and the previous recommendations.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but the permalinks topic is for HTML. 😉

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

<tag>imagedata</tag> command does not need a
path if all files are in the same folder. You
can write something like this:</para>
<para>&lt;imagedata fileref="pic02.pdf"/>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use screen instead of para.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer appreciale, because we are now using logo.src.path instead of img.src.path.

Copy link
Owner

@tomschr tomschr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good, I have a small comment.

linkend="ex.fo.graphic-pageheader"/> into your
customization layer:</para>
<example xml:id="ex.fo.graphic-pageheader">
<title>Placing a logo in the right page header (<filename>graphic-pageheader.xsl</filename>)</title>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use title style here: "Placing a Logo in the Right Page Header"

</example>
<calloutlist>
<callout arearefs="co.topic.graphic-pageheader.path">
<para>This setting is unique for your logo.</para>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rephrase it as: "The directory path to your logos"

</section>
<section role="discussion">
<title>Discussion</title>
<para>In line 8 of our style sheet (
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be careful with phrases like "In line X...". Usually, this can be outdated very soon. Better refer to the callout bug (you can use <xref linkend="..."/>).

be independent of the global image source path
<tag>img.src.path</tag> parameter for pictures, graphics and so
on. This new parameter is used in line 45 to build the path
for our logo.</para>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this is written more from an implementation point of view. If you change to the user's view, it could like this:

The stylesheet <filename>graphic-pageheader.xsl</filename> creates a logo in the right edge of your page
and uses the parameter <parameter>logo.src.path</parameter> to find the logo. By default, a logo is stored
in <filename>logos/<filename>. If your logos are in a different location, change it with your the XSLT processor.
For example, the following line uses ...

Copy link
Owner

@tomschr tomschr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found only some minor things. 😉

linkend="co.topic.graphic-pageheader.file"/> to find the right
logo.
<screen>&lt;xsl:param name="logo.src.path">logos/&lt;/xsl:param>
</screen></para>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the linebreak between line 193 and 194.

/></para>
</listitem>
</itemizedlist>
<para>__________</para>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what the purpose of this line.

<screen>&lt;xsl:param name="logo.src.path">logo/&lt;/xsl:param>
</screen></para>
<para/>
<para>These points will be submitted later</para>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still confused by this line. Is it a comment for you? Then it should go into a <remark>. Is it for the readers? If you want to add additional references for other topics? In that case, refer to them with an xref in the "See Also" section.

<para>The <emphasis>Opensource</emphasis>-Logo is a trademark which is
owned by <link xlink:href="https://opensource.org"/>. This site is
not affiliated with or endorsed by the Open Source
Initiative.</para>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmn, thinking if this line is better covered with a legalnotice. For the time being, just let it here.

linkend="co.topic.graphic-pageheader.file"/> to find the right
logo.
<screen>&lt;xsl:param name="logo.src.path">logo/&lt;/xsl:param>
</screen></para>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Remove the linebreak between line 195 and 196.
  • Put your screen outside of the para.

* Removed the remark for further Topics.
* Line 206 is a distinction for the OSI Logo Trademark. This is a requirement if you use the OSI logo. If you would like to use another logo, let me know.
<para>Logo and chapter title in the page header</para>
</listitem>
</itemizedlist>
This parameter is used within the position test procedure<xref linkend="co.topic.graphic-pageheader.file"/> to find the right
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On minor detail: Remove the word "procedure" as it is already covered within the xref. Otherwise looks good!

@tomschr
Copy link
Owner

tomschr commented Jul 16, 2018

@der-schmelle2 I've created a PDF of your topic, see topic.graphic-pageheader.pdf. The layout of the PDF can be improved, but let's focus on the content.

From what I've seen it looks good, but I would suggest the following changes:

  • Use the element filename for pagesetup.xsl (first paragraph in the Solution section).
  • I'm not sure if the the 2nd sentence in the 2nd paragraph is true.
  • Step 2 and step 3 both start with the same sentence. Please adjust. 😉
  • style sheet -> stylesheet

Hope that helps.

If you fix the above issues, I'll merge it into develop. 😉 Thanks! 👍

@@ -1,1688 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link
Owner

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? 😉

Copy link
Collaborator Author

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

Copy link
Owner

@tomschr tomschr Jul 16, 2018

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:

$ git config --global core.excludesfile '~/.gitignore'
$ echo DocBook-Cookbook.xpr >> ~/.gitignore

Copy link
Collaborator Author

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. 😊

@der-schmelle2
Copy link
Collaborator Author

Hole section rewritten. Description of template header.table added.

Copy link
Owner

@tomschr tomschr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, great work! Some comments about the file, mostly typos and some questions.

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"/>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This URL looks strange. Shouldn't it be ".../fo/docbook.xsl"?

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="20.0">
<project version="20.1">
Copy link
Owner

@tomschr tomschr Sep 26, 2018

Choose a reason for hiding this comment

The 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?

inch high to avoid conflicts with the body text area. Furthermore,
we will place the document title on the opposite of the logo,
centered to the logo high. The template for our solution is obtained
from 'pagesetup.xsl' style sheet.</para>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Use the element filename around pagesetup.xsl.
  • style sheet -> stylesheet

or a simple forwarding of parts of your document.</para>
<para>First of all you need to create a customization layer as described
in the following steps. If you have a customization layer style
sheet, you can skip the first step, otherwise follow the steps to
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • style sheet -> stylesheet

linkend="dbc.common.dbcustomize"/>.</para>
</step>
<step>
<para>Include the style sheet from <xref
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style sheet -> stylesheet

style sheet in the next step.</para>
</step>
<step>
<para>Include the style sheet <xref
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style sheet -> stylesheet

<para>Include the style sheet <xref
linkend="ex.fo.graphic-pageheader"/> into your
customization layer and modify it to fit your needs.</para>
<para>Subsequent, we will explain the options we will focus on:</para>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, this paragraph is unnecessary.

</callout>
<callout arearefs="co.topic.graphic-pageheader.center">
<para>In this demo, the center position has no content,
but you can add a page number for example.</para>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rephase the above paragraph slightly to mention the element <fo:page-number/>:

... but you can add the page number with the element
<tag class="emptytag">fo:page-number</tag>, for example.

<para>The stylesheet <filename>graphic-pageheader.xsl</filename> creates
a logo in the right edge of your page and uses the parameter
<parameter>logo.src.path</parameter> to find the logo. By
default, a logo is stored in <filename>logo/</filename>. If your
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • a logo -> the logo
  • in the ... directory.

a logo in the right edge of your page and uses the parameter
<parameter>logo.src.path</parameter> to find the logo. By
default, a logo is stored in <filename>logo/</filename>. If your
logos are in a different location, change it with your XSLT
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can there be plural (logos)? Isn't only one logo used/placed in the header/footer?

@tomschr
Copy link
Owner

tomschr commented Sep 26, 2018

@der-schmelle2: Here is the PDF of this topic. The layout is not pretty and the callouts are still missing. However, it should give you a better overview.

Inserting Text and Logos into Page Headers and Footers

<listitem xml:id="li.fo.external-graphics">
<para>Full parameter description for
<tag>fo:external-graphic</tag><link
xlink:href="http://www.w3.org/TR/xsl/#fo_external-graphic"
Copy link
Owner

@tomschr tomschr Sep 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct the tag element and remove link:

<tag xlink:href="http://www.w3.org/TR/xsl/#fo_external-graphic">fo:external-graphic</tag>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PDF 🖨️ PDF output format
Projects
Cookbook
  
In progress
Development

Successfully merging this pull request may close these issues.

None yet

2 participants