Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Currently I am developing an integration between epub3 and asciidoctorj.
After adding asciidoctor-epub3 gem in classpath (as any other gem) and executed the require command require 'asciidoctor-epub3' I have created the next test: private static final String DOCUMENT = "= Document Title\n"; private Asciidoctor asciidoctor = JRubyAsciidoctor.create(); @Test public void epub3_should_be_generated_when_set() throws FileNotFoundException { asciidoctor.render(DOCUMENT, options().inPlace(true).backend("epub3").asMap()); File expectedFile = new File("target/test-classes/rendersample.html"); System.out.println(IOUtils.readFull(new FileInputStream(expectedFile))); } But next exception is thrown during render. org.jruby.exceptions.RaiseException: (RegexpError) invalid multibyte character: // at org.jruby.RubyString.gsub(org/jruby/RubyString.java:3074) at org.jruby.RubyString.gsub(org/jruby/RubyString.java:3042) at RUBY.generate_id(/home/alsoto/Downloads/asciidoctorj-master/target/test-classes/gems/asciidoctor-epub3-1.0.0.alpha.1/lib/asciidoctor-epub3/converter.rb:820) at RUBY.Epub3(/home/alsoto/Downloads/asciidoctorj-master/target/test-classes/gems/asciidoctor-epub3-1.0.0.alpha.1/lib/asciidoctor-epub3/converter.rb:855) at org.jruby.RubyProc.call(org/jruby/RubyProc.java:271) at RUBY.process(/home/alsoto/Downloads/asciidoctorj-master/target/test-classes/gems/asciidoctor-1.5.0/lib/asciidoctor/extensions.rb:152) at org.jruby.RubyMethod.call(org/jruby/RubyMethod.java:128) at RUBY.parse(/home/alsoto/Downloads/asciidoctorj-master/target/test-classes/gems/asciidoctor-1.5.0/lib/asciidoctor/document.rb:455) at org.jruby.RubyArray.each(org/jruby/RubyArray.java:1613) at RUBY.parse(/home/alsoto/Downloads/asciidoctorj-master/target/test-classes/gems/asciidoctor-1.5.0/lib/asciidoctor/document.rb:454) at RUBY.load(/home/alsoto/Downloads/asciidoctorj-master/target/test-classes/gems/asciidoctor-1.5.0/lib/asciidoctor.rb:1337) at RUBY.convert(/home/alsoto/Downloads/asciidoctorj-master/target/test-classes/gems/asciidoctor-1.5.0/lib/asciidoctor.rb:1415) at RUBY.convert(<script>:66) at org.jruby.gen.InterfaceImpl732902856.convert(org/jruby/gen/InterfaceImpl732902856.gen:13) Any idea of what's happening? The same document is correctly rendered if I use the standard html backend. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Current version of asciidoctorj pushed on github does not contain this code.
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Administrator
|
In reply to this post by asotobu
It may not be related, but there's another critical requirement at the moment for the Asciidoctor EPUB3 backend to work. Due to this issue (https://github.com/asciidoctor/asciidoctor-epub3/issues/7), you must run it on a spine document. A spine document has a header (doctitle, author, etc) and a list of includes that make up the manifest. For example: .master.adoc ---- = Book Title Author Name include::content-document.adoc[] ----
.content-document.adoc ---- = Content Title Author Name [abstract] This is the actual content. == First Section And off we go. ---- Please update the test to use this as the baseline example. If you still get the error, anyway to know which RegExp it is? -Dan On Thu, Aug 14, 2014 at 5:08 AM, asotobu [via Asciidoctor :: Discussion] <[hidden email]> wrote: Currently I am developing an integration between epub3 and asciidoctorj. ... [show rest of quote] Dan Allen | http://google.com/profiles/dan.j.allen |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Same problem :( I am going to see what it is this char. 2014-08-14 13:16 GMT+02:00 mojavelinux [via Asciidoctor :: Discussion] <[hidden email]>:
... [show rest of quote] +----------------------------------------------------------+ Alex Soto Bueno - Computer Engineer www.lordofthejars.com +----------------------------------------------------------+ |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
In reply to this post by mojavelinux
Maybe I will try in another computer as well. 2014-08-14 13:30 GMT+02:00 Alex Soto <[hidden email]>:
... [show rest of quote] +----------------------------------------------------------+ Alex Soto Bueno - Computer Engineer www.lordofthejars.com +----------------------------------------------------------+ |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
In reply to this post by mojavelinux
Dan I have tried in another computer (first was with ubuntu, and this one with MacOSX) and the same problem occurs. Even if I force Ruby to use UTF-8 it stills happens. You can see for yourself in this test: https://github.com/asciidoctor/asciidoctorj/blob/master/src/test/java/org/asciidoctor/WhenANoneStandardBackendIsSet.java This is the latest issue before releasing asciidoctorj. Alex. 2014-08-14 13:37 GMT+02:00 Alex Soto <[hidden email]>:
... [show rest of quote] +----------------------------------------------------------+ Alex Soto Bueno - Computer Engineer www.lordofthejars.com +----------------------------------------------------------+ |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
In reply to this post by mojavelinux
I will continue with the research to see if I found and explanation to this phenomena. 2014-08-14 19:20 GMT+02:00 Alex Soto <[hidden email]>:
... [show rest of quote] +----------------------------------------------------------+ Alex Soto Bueno - Computer Engineer www.lordofthejars.com +----------------------------------------------------------+ |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Administrator
|
In reply to this post by asotobu
I see the problem. It's the word joiner character (aka BOM), which I'm using to fix the text justification in WebKit described here: We may just need to set the constant differently in the JRuby environment. I'm investigating. -Dan
On Thu, Aug 14, 2014 at 11:17 AM, asotobu [via Asciidoctor :: Discussion] <[hidden email]> wrote:
... [show rest of quote] Dan Allen | http://google.com/profiles/dan.j.allen
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Administrator
|
In reply to this post by asotobu
Green bar! Changes coming your way! -Dan On Fri, Aug 15, 2014 at 1:06 AM, Dan Allen <[hidden email]> wrote:
... [show rest of quote] Dan Allen | http://google.com/profiles/dan.j.allen |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Administrator
|
In reply to this post by asotobu
Here's what I changed: - Fixed Asciidoctor EPUB3 to use /\uFEFF/ when stripping out the BOM with gsub (we use the BOM to fix text justification in WebKit)
- Upgraded Saxon to workaround conflict with Nokogiri when using xpath (used by gepub)
- set safe mode to safe in epub3 backend test (required atm)
- set imagesdir to images in epub3 sample document (required atm)
The last two are currently bugs in Asciidoctor EPUB3. You just need to know about them for now.
Cheers!
-Dan
On Fri, Aug 15, 2014 at 2:03 AM, Dan Allen <[hidden email]> wrote:
... [show rest of quote] Dan Allen | http://google.com/profiles/dan.j.allen |
Free forum by Nabble | Edit this page |