Include not working via Ruby..

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

Include not working via Ruby..

willwade
So I have a folder structure like this:

shared/Glossary.adoc
Book1/Main.adoc

And I have an include in Main.adoc that is:

include::../shared/Glossary.adoc[]

So to convert I do:
cd Book1
asciidoctor Main.adoc

It works! The include gets included.

But I have a guard file that watches the changed Main.adoc and it uses the ruby api to convert it - and it doesnt include the file.. e.g.


require 'asciidoctor'
require 'erb'

guard 'shell', daemon: true do
  watch(/^Main\.adoc$/) {|m|
    Asciidoctor.convert_file(m[0], :in_place => true, safe: :server)
  }
end

(i.e. "Unresolved directive in Main.adoc - include::../shared/Glossary.adoc[])

Any ideas why??
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Include not working via Ruby..

mojavelinux
Administrator
Set the safe option to :safe (or even :unsafe), not :server.

-Dan

On Fri, Dec 2, 2016 at 3:17 AM, willwade [via Asciidoctor :: Discussion] <[hidden email]> wrote:
So I have a folder structure like this:

shared/Glossary.adoc
Book1/Main.adoc

And I have an include in Main.adoc that is:

include::../shared/Glossary.adoc[]

So to convert I do:
cd Book1
asciidoctor Main.adoc

It works! The include gets included.

But I have a guard file that watches the changed Main.adoc and it uses the ruby api to convert it - and it doesnt include the file.. e.g.


require 'asciidoctor'
require 'erb'

guard 'shell', daemon: true do
  watch(/^Main\.adoc$/) {|m|
    Asciidoctor.convert_file(m[0], :in_place => true, safe: :server)
  }
end

(i.e. "Unresolved directive in Main.adoc - include::../shared/Glossary.adoc[])

Any ideas why??


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Include-not-working-via-Ruby-tp5133.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Include not working via Ruby..

willwade
Thanks!
Loading...