Content not showing in running header/footer (asciidoctor-pdf, maven, windows)

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Content not showing in running header/footer (asciidoctor-pdf, maven, windows)

siemsen
Hi, I'm currently evaluating asciidoc as possible new format for our project documentation. Most things worked like a charm with only a little effort. Still there is one problem I haven't found a solution for yet: when converting my document to pdf (with asciidoctorj-pdf-maven plugin) my running header and footer has no content. I studied the theming guide and I already see border lines at the top and bottom of my pages as I configured them in the yaml. I can change the layout of those border lines, e.g. make the border appear dashed. But the content I enter is never rendered. I have set <pagenums/> as attribute in the configuration of the asciidoctor-maven-plugin. In the footer of my document there is a border line (configured by the yaml) and the page number (not configured by me - this is the default when the content is empty). Here is an extract from my theme.yaml:
header:
  height: 1in
  line_height: 1
  border_color: CCCCCC
  border_width: 0.5
  border_style: dashed
  recto:
    center:
      content: '{document-title}'
  verso:
    center:
      content: $header_recto_center_content
This is my toolchain:
  • Windows 7
  • Java 6
  • Maven 3.0.4
  • asciidoctor-maven-plugin 1.5.3
  • jruby version: 1.7.26
  • asciidoctor-j-pdf: 1.5.0-alpha.11
  • asciidoctor-j:1.5.4
I also tried this toolchain with the same effects as above:
  • Windows 7
  • Java 8
  • Maven 3.0.4
  • jruby version: 9.0.5.0
  • prawn-version: 2.0.2
  • asciidoctor-j-pdf: 1.5.0-alpha.11
  • asciidoctor-j:1.5.4.1
Is there anything I am missing? Many thanks, Eike.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Content not showing in running header/footer (asciidoctor-pdf, maven, windows)

abelsromero
Given the setup you mention I assume you already saw the example (https://github.com/asciidoctor/asciidoctor-maven-examples/tree/master/asciidoctor-pdf-with-theme-example).
I am no expert, but I have played with it and I've seen some syntax differences that in my case allowed me to make your extract work. Still, according to the documentation (https://github.com/asciidoctor/asciidoctor-pdf/blob/master/docs/theming-guide.adoc)  I think that your extract should also work.

Instead of :
header:
  ...
  recto:
    center:
      content: '{document-title}'
I used
header:
  ...
  recto_content:
   center: '{document-title}'
I also added the footer from the example and it showed fine.

Right now I don't have a Ruby environment and I won't be able to replicate this directly in Ruby until tomorrow.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Content not showing in running header/footer (asciidoctor-pdf, maven, windows)

abelsromero
Forgot to mention, I tried the example from the documentation:

header:
  height: 0.75in
  line_height: 1
  recto:
    center:
      content: '(C) ACME -- v{revnumber}, {docdate}'
  verso:
    center:
      content: $header_recto_center_content
footer:
  height: 0.75in
  line_height: 1
  recto:
    right:
      content: '{section-or-chapter-title} | *{page-number}*'
  verso:
    left:
      content: '*{page-number}* | {chapter-title}'
And the text did not show either.

My setup:
Windows 7
Java 8
Maven 3.3.9
jruby version: 9.0.5.0
prawn-version: 2.1.0 (the last)
asciidoctor-j-pdf: 1.5.0-alpha.11
asciidoctor-j:1.5.4.1
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Content not showing in running header/footer (asciidoctor-pdf, maven, windows)

siemsen
Aaaahhh, you made my day!

Your solution
recto : content : right
 instead of
 recto : right : content
 works in both of my environments. The sequence in the theming guide (and also some examples I found on the internet) is wrong - at least for the current version, maybe it was correct with earlier versions.

Many thanks for your help !
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Content not showing in running header/footer (asciidoctor-pdf, maven, windows)

mojavelinux
Administrator
The version of AsciidoctorJ PDF is significantly behind the upstream version, hence the behavior difference from what the documentation describes. We're working on getting that released. Until then, you need to use the legacy configuration you discovered (or configure the build to use the upstream gem directly).

So keep the first running content configuration on hand because you'll need it soon.

Cheers,

-Dan
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Content not showing in running header/footer (asciidoctor-pdf, maven, windows)

abelsromero
Just in case you want to work on the final version or, just as part of the evaluation add that "Java integration does not limit usage of last version" :P, I created an example using the gem directly and you extract.
And obviously it works as the documentation says.

https://github.com/abelsromero/asciidoctor-maven-examples/tree/pdf-gem-usage/asciidoctor-pdf-with-theme-example

Steps are simple, using the original example:
1 · Removed AsciidoctorJ dependency from plugin
2 · Added asciidoctor-pdf (gem) depedency
3 · Enjoy
Note there's no need to use the <require> attribute here because this is done by AsciidoctorJ automatically.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Content not showing in running header/footer (asciidoctor-pdf, maven, windows)

siemsen
Thanks for your help, now I am able to generate documents as I need them and I am aware of parts to modify later when we are able to use a newer asciidoctor-pdf version.

Since we're stuck with java 6 in our toolchain at the moment I can not switch right away to using the ruby gems directly as you suggested, abelsromero, so I will use the legacy configuration and syntax until we can make the move to a more current java (newer jruby needs at least java 7).

My sincere thanks for your kind help!

Eike  
Loading...