Include with no rendered content causes error

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

Include with no rendered content causes error

tsphillips
I am trying to use an include to define a list of attributes applicable across a number of documents rendered to PDF. The included file (vars.adoc) has nothing but attribute definitions. For example:

// Global Attributes
:key1: value1
:key2: value2

When I do the above, I get the error listed below.  When I put (any) content that is rendered into the include file, everything works fine.

Is this expected behavior? Do include files have to have content that is rendered into the final document?

/Library/Ruby/Gems/2.0.0/gems/prawn-2.1.0/lib/prawn/document.rb:669:in `generate_margin_box': undefined method `margins' for nil:NilClass (NoMethodError)
        from /Library/Ruby/Gems/2.0.0/gems/prawn-2.1.0/lib/prawn/document.rb:308:in `go_to_page'
        from /Library/Ruby/Gems/2.0.0/gems/asciidoctor-pdf-1.5.0.alpha.11/lib/asciidoctor-pdf/prawn_ext/extensions.rb:605:in `delete_page'
        from /Library/Ruby/Gems/2.0.0/gems/asciidoctor-pdf-1.5.0.alpha.11/lib/asciidoctor-pdf/converter.rb:166:in `convert_document'
        from /Library/Ruby/Gems/2.0.0/gems/asciidoctor-pdf-1.5.0.alpha.11/lib/asciidoctor-pdf/converter.rb:96:in `convert'
        from /Library/Ruby/Gems/2.0.0/gems/asciidoctor-1.5.4/lib/asciidoctor/document.rb:1044:in `convert'
        from /Library/Ruby/Gems/2.0.0/gems/asciidoctor-1.5.4/lib/asciidoctor.rb:1503:in `convert'
        from /Library/Ruby/Gems/2.0.0/gems/asciidoctor-1.5.4/lib/asciidoctor/cli/invoker.rb:94:in `block in invoke!'
        from /Library/Ruby/Gems/2.0.0/gems/asciidoctor-1.5.4/lib/asciidoctor/cli/invoker.rb:86:in `each'
        from /Library/Ruby/Gems/2.0.0/gems/asciidoctor-1.5.4/lib/asciidoctor/cli/invoker.rb:86:in `invoke!'
        from /Library/Ruby/Gems/2.0.0/gems/asciidoctor-1.5.4/bin/asciidoctor:14:in `<top (required)>'
        from /usr/bin/asciidoctor:22:in `load'
        from /usr/bin/asciidoctor:22:in `<main>'
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Include with no rendered content causes error

mojavelinux
Administrator

On Thu, May 19, 2016 at 10:51 PM, tsphillips [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Is this expected behavior? Do include files have to have content that is rendered into the final document?

No, they do not need content. Likely, once aggregated, there is a secondary problem occurring. I'll need a more complete example to know what to look for.

Cheers,

-Dan


--
Dan Allen | @mojavelinux | http://google.com/profiles/dan.j.allen
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Include with no rendered content causes error

tsphillips
Thanks -- I tracked down the problem.  There was an automated process that tried to render the include file as a document by itself. The include file did not have a header, so I am supposing that caused the problem. It all works now.

Tom
Loading...