undefined method `render_file'

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

undefined method `render_file'

denis
Hello,

I'm trying to use Guard-asciidoctor plugin, and I get the following message at startup:

> [#aaa02a5dde0e] undefined method `render_file' for Guard::Asciidoctor:Class

and my guardfile contains:

guard :asciidoctor do
  #watch(/^.+(\.adoc)$/)
  watch(/^.+(\.adoc)$/) {|m| Asciidoctor.render_file(m[0], :in_place => true, :to_dir => 'html') }
  #watch(/^.+(\.css)$/)
end

Thank for your response !
Denis
Reply | Threaded
Open this post in threaded view
|

Re: undefined method `render_file'

mojavelinux
Administrator
Although it's only deprecated, render_file has been replaced by convert_file.

However, I think the real problem is that you have no required Asciidoctor.

require 'asciidoctor'

-Dan

On Sun, Aug 13, 2017 at 2:10 AM, denis [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hello,

I'm trying to use Guard-asciidoctor plugin, and I get the following message at startup:

> [#aaa02a5dde0e] undefined method `render_file' for Guard::Asciidoctor:Class

and my guardfile contains:

guard :asciidoctor do
  #watch(/^.+(\.adoc)$/)
  watch(/^.+(\.adoc)$/) {|m| Asciidoctor.render_file(m[0], :in_place => true, :to_dir => 'html') }
  #watch(/^.+(\.css)$/)
end

Thank for your response !
Denis


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/undefined-method-render-file-tp5837.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
|

Re: undefined method `render_file'

denis
I solve my problem using:

guard :asciidoctor do
  #watch(/^.+(\.adoc)$/)
  watch(/^.+(\.adoc)$/) {|m| ::Asciidoctor.render_file(m[0], :in_place => true, :to_dir => 'html') }
  #watch(/^.+(\.css)$/)
end

:)
Reply | Threaded
Open this post in threaded view
|

Re: undefined method `render_file'

mojavelinux
Administrator
Ah, yes. I see. The guard file must be running inside a namespace, so you have to break out to the top level.

But the name of the method is still convert_file ;)

-Dan

On Sun, Aug 13, 2017 at 3:05 AM, denis [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I solve my problem using:

guard :asciidoctor do
  #watch(/^.+(\.adoc)$/)
  watch(/^.+(\.adoc)$/) {|m| ::Asciidoctor.render_file(m[0], :in_place => true, :to_dir => 'html') }
  #watch(/^.+(\.css)$/)
end

:)



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/undefined-method-render-file-tp5837p5840.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
|

Re: undefined method `render_file'

denis
I've corrected the method name, where can I find documentation on parameters name to this method ?

I'd like to change the style sheet used....

something like that:
  watch(/^.+(\.adoc)$/) {|m| ::Asciidoctor.convert_file(
    m[0],
    :in_place => my_in_place,
    :to_dir => my_to_dir,
    :stylesheet => my_stylesheet,
    :style_dir => my_stylesdir
    ) }
Reply | Threaded
Open this post in threaded view
|

Re: undefined method `render_file'

mojavelinux
Administrator

On Sun, Aug 13, 2017 at 3:17 AM, denis [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I've corrected the method name, where can I find documentation on parameters name to this method ?

I'd like to change the style sheet used....

something like that:
  watch(/^.+(\.adoc)$/) {|m| ::Asciidoctor.convert_file(
    m[0],
    :in_place => my_in_place,
    :to_dir => my_to_dir,
    :stylesheet => my_stylesheet,
    :style_dir => my_stylesdir
    ) }


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/undefined-method-render-file-tp5837p5842.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