asciidoctor / asciidoctorj

:coffee: Java bindings for Asciidoctor. Asciidoctor on the JVM!
http://asciidoctor.org
Apache License 2.0
627 stars 172 forks source link

asciidoctorj and a bootstrap backend #128

Closed Vad1mo closed 10 years ago

Vad1mo commented 10 years ago

Hi, I am using jbake which is using asciidoctorj. My goal is to use a bootstrap backend provided by https://github.com/llaville/asciidoc-bootstrap-backend but when I pass the parameter backend with the zip location I get this error.

(RuntimeError) Couldn't find a view in @views for embedded

So how can I use the asciidoc-bootstrap-backend with asciidoctorj or what alternatives exist?

lordofthejars commented 10 years ago

When I have used templates I have never done by providing zip location, but the directory where the template was unzipped. In case of AsciidoctorJ it only sets the template option and passed it to asciidoctor.

Two questions:

2013/11/28 Vad1mo notifications@github.com

Hi, I am using jbake which is using asciidoctorj. My goal is to use a bootstrap backend provided by https://github.com/llaville/asciidoc-bootstrap-backend but when I pass the parameter backend with the zip location I get this error.

(RuntimeError) Couldn't find a view in @views for embedded

So how can I use the asciidoc-bootstrap-backend with asciidoctorj or what alternatives exist?

— Reply to this email directly or view it on GitHubhttps://github.com/asciidoctor/asciidoctorj/issues/128 .

+----------------------------------------------------------+ Alex Soto Bueno - Computer Engineer www.lordofthejars.com +----------------------------------------------------------+

Vad1mo commented 10 years ago

So you imply that in principal this approach should work?

Like recommended I unzipping the file and tried again butthe result was the same error.

 org.jruby.exceptions.RaiseException: (RuntimeError) Couldn't find a view in @views for embedded
    at RUBY.render(jar:file:/Users/v/.m2/repository/org/asciidoctor/asciidoctor-java-integration/0.1.4/asciidoctor-java-integration-0.1.4.jar!/gems/asciidoctor-0.1.4/lib/asciidoctor/renderer.rb:134)
    at RUBY.render(jar:file:/Users/v/.m2/repository/org/asciidoctor/asciidoctor-java-integration/0.1.4/asciidoctor-java-integration-0.1.4.jar!/gems/asciidoctor-0.1.4/lib/asciidoctor/document.rb:769)
    at RUBY.render(jar:file:/Users/v/.m2/repository/org/asciidoctor/asciidoctor-java-integration/0.1.4/asciidoctor-java-integration-0.1.4.jar!/gems/asciidoctor-0.1.4/lib/asciidoctor.rb:915)
    at RUBY.render(<script>:55)
    at org.jruby.gen.InterfaceImpl1951557908.render(org/jruby/gen/InterfaceImpl1951557908.gen:13)

This are my parameter for theasciidoctor.render(content,options) method when calling the asciidoctor library directly.

//options
{safe=0, backend=/absolute/path/name/to/bootstrap-3.0.1, attributes={source-highlighter=highlightjs}, base_dir=/apn/website/src/main/website/content} 

Could you elaborate more on what should happen when the backend is set?. What files are taken from the provided bootstrap dir. What role does the .conf file play. Would it be enough to only use the .conf file if css/js are already provided by the static website generators?

lordofthejars commented 10 years ago

I will open a discussion in official forum because I will ping jBake creator about this issue, because for example I think that conf file is something related with jBake.

lordofthejars commented 10 years ago

I will try to take a view tomorrow because I think that there is a problem between integration of jBake and Asciidoctorj but I want to try the bootstrap backend alone with Asciidocotj first.

BTW have you tried with another backend? (To discard that the problem is not with the backend.)

Vad1mo commented 10 years ago

I am contributing to jbake. I just created an isolated test case with a custom backend failing.

https://gist.github.com/Vad1mo/7746661

lordofthejars commented 10 years ago

Thank you I will take a look for sure. Hope tomorrow I will find a gap to inspect it. Thank you so much.

2013/12/2 Vad1mo notifications@github.com

I am contributing to jbake. I just created an isolated test case with a custom backend failing.

https://gist.github.com/Vad1mo/7746661

— Reply to this email directly or view it on GitHubhttps://github.com/asciidoctor/asciidoctorj/issues/128#issuecomment-29601755 .

+----------------------------------------------------------+ Alex Soto Bueno - Computer Engineer www.lordofthejars.com +----------------------------------------------------------+

lordofthejars commented 10 years ago

I have seen that this backend is for asciidoc python renderer. For Asciidoctor, custom templates are provided as a Tilt-compatible templates (http://asciidoctor.org/docs/user-manual/#provide-custom-templates). BTW the correct option is template_dirs, not backend which valid values can be docbook, html or manpage.