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
|
On Thu, Jul 23, 2015 at 9:27 AM, sean.osterberg [via Asciidoctor :: Discussion] <[hidden email]> wrote: Is it possible for me to get the AsciidoctorJ 1.6.0 snapshot? That's this issue: https://github.com/asciidoctor/asciidoctorj/issues/365 I also think it may be time to consider publishing a 1.6.0-preview.1 release (still based on Asciidoctor core 1.5.2 or 1.5.3). |
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 Robert.Panzer
Dan and Robert
Thanks for the responses, and thanks Robert for taking a look and trying things out. In light of your post, I spent a good chunk of time debugging all of my files that have tab syntax. I figured out what's going on! Some of our pages are 100k characters or more, so I hadn't scrutinized them more thoroughly until now. Embedded deep in these long pages were malformed block headers for the tab syntax -- a problem anybody running a large-scale documentation migration project might run into. For example, an equals sign is missing, a quote isn't closed properly, etc., such as: [tabs] ------ [tab,title"XML"] .... foobar .... ------ Note how there's a missing equals sign after "title." This is the source of the exceptions I've been seeing. I'm surprised it's throwing an exception, however, instead of just throwing an error during parsing. Is this a bug? I got the latest master branch code from the AsciidoctorJ repo (1.5.3-SNAPSHOT) and ran my code using it instead of 1.5.2. I now get more thorough exceptions, and here's what might be useful to you guys: org.asciidoctor.internal.AsciidoctorCoreException: org.jruby.exceptions.RaiseException: (TypeError) exception class/object expected at org.asciidoctor.internal.JRubyAsciidoctor.renderFile(JRubyAsciidoctor.java:345) at org.asciidoctor.internal.JRubyAsciidoctor.renderFile(JRubyAsciidoctor.java:434) at org.asciidoctor.internal.JRubyAsciidoctor.convertFile(JRubyAsciidoctor.java:554) at org.mule.docs.AsciiDocProcessor.convertFile(AsciiDocProcessor.java:38) at org.mule.docs.AsciiDocPage.getPageFromFile(AsciiDocPage.java:54) at org.mule.docs.AsciiDocPage.fromFiles(AsciiDocPage.java:42) at org.mule.docs.Section.getSectionFromDirectory(Section.java:89) at org.mule.docs.Section.fromDirectory(Section.java:71) at org.mule.docs.SiteBuilder.getSections(SiteBuilder.java:41) at org.mule.docs.SiteBuilder.<init>(SiteBuilder.java:26) at org.mule.docs.SiteBuilder.buildSite(SiteBuilder.java:33) at SiteBuilderTest.buildSite_withRealFolders_SuccessfullyBuildsSite(SiteBuilderTest.java:30) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:78) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:212) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:68) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140) Caused by: org.jruby.exceptions.RaiseException: (TypeError) exception class/object expected at RUBY.load(/Users/sean.osterberg/.rvm/gems/ruby-2.2.1/gems/asciidoctor-1.5.2/lib/asciidoctor.rb:1362) at RUBY.convert(/Users/sean.osterberg/.rvm/gems/ruby-2.2.1/gems/asciidoctor-1.5.2/lib/asciidoctor.rb:1458) at RUBY.convert_file(/Users/sean.osterberg/.rvm/gems/ruby-2.2.1/gems/asciidoctor-1.5.2/lib/asciidoctor.rb:1562) at RUBY.convertFile(<script>:68) at org.jruby.gen.InterfaceImpl1014249060.convertFile(org/jruby/gen/InterfaceImpl1014249060.gen:13) |
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
|
On Fri, Jul 24, 2015 at 1:22 PM, sean.osterberg [via Asciidoctor :: Discussion] <[hidden email]> wrote: I got the latest master branch code from the AsciidoctorJ repo (1.5.3-SNAPSHOT) and ran my code using it instead of 1.5.2. I now get more thorough exceptions, and here's what might be useful to you guys: That's the one you want to use. You need to modify the second to last line so that it actually installs the jar (the script is for CI so the jar doesn't have to be installed). $GRADLE_CMD -S -PasciidoctorGemVersion=$ASCIIDOCTOR_VERSION -PuseMavenLocal=true :asciidoctorj:clean :asciidoctorj:publishToMavenLocal -Dan 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 sean.osterberg
> Note how there's a missing equals sign after "title." This is the source of the exceptions I've been seeing. I'm surprised it's throwing an exception, however, instead of just throwing an error during parsing. Is this a bug? I'm not sure why it's throwing an exception at this point either, but most likely a conversion error at the interface of Ruby and Java (something it doesn't expect). We'll know more once we get to the bottom of the stack trace :) It's still stopping at "something went wrong". Cheers, -Dan On Fri, Jul 24, 2015 at 1:45 PM, 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 sean.osterberg
Probably a good opportunity for a test that AsciidoctorJ and handle a malformed attribute value. It's likely specific to an extension as Asciidoctor core will simply drop attributes it can't parse. -Dan On Fri, Jul 24, 2015 at 1:47 PM, 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 |
In reply to this post by mojavelinux
Thanks Dan, I didn't know that about forcing the usage of core! I'll give it another shot.
Regarding the full stack trace, am I correctly assuming that if I actually run my code with 1.5.3, I don't have to install the dev version of Asciidoctor and pass the gemPath to the create() method to get it? In our repo of ~5,000 asciidoc files, I went in and fixed all of the offending tab syntax. Here were the following cases that threw the same exception posted above: * An equals sign didn't follow "title" * A tabs block wasn't properly closed with 6 dashes "------" -- another tabs block started before it was properly closed. * A tab block wasn't properly closed with 4 periods "...." -- another tab block started before it was properly closed. * Missing a closing bracket for a tabs block -- [tab,title="XML" * Misspelled "title" -- [tab,ttile="XML"] It appears that AsciidoctorJ doesn't like any custom blocks if they're malformed in pretty much any way. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Not sure what I'm doing wrong, but I get an error when running the script. I check the pom afterwards and the <version> is empty. To be clear, I also updated the second to last line of the script to write to the local maven repository.
LAPTOP:asciidoctorj sean.osterberg$ sh test-asciidoctor-upstream.sh sed: 1: "pom.xml": extra characters at the end of p command sed: 1: "asciidoctor.gemspec": command a expects \ followed by text [INFO] Scanning for projects... [ERROR] The build could not read 1 project -> [Help 1] [ERROR] [ERROR] The project rubygems:asciidoctor:[unknown-version] (/private/tmp/sean.osterberg/asciidoctorj/build/maven/asciidoctor-master/pom.xml) has 1 error [ERROR] 'version' is missing. @ line 7, column 14 [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException Configuration(s) specified but the install task does not exist in project :asciidoctorj-distribution. :asciidoctorj:clean :asciidoctorj:generatePomFileForMavenNebulaPublication :asciidoctorj:compileJava Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. :asciidoctorj:jrubyPrepareGems FAILURE: Build failed with an exception. * What went wrong: Could not resolve all dependencies for configuration ':asciidoctorj:gems'. > Could not resolve rubygems:asciidoctor:1.5.3.dev. Required by: org.asciidoctor:asciidoctorj:1.5.3-SNAPSHOT > Could not GET 'http://rubygems-proxy.torquebox.org/releases/rubygems/asciidoctor/1.5.3.dev/asciidoctor-1.5.3.dev.pom'. Received status code 500 from server: Internal Server Error > Could not GET 'http://rubygems-proxy.torquebox.org/prereleases/rubygems/asciidoctor/1.5.3.dev/asciidoctor-1.5.3.dev.pom'. Received status code 500 from server: Internal Server Error * Try: Run with --info or --debug option to get more log output. * Exception is: org.gradle.api.artifacts.ResolveException: Could not resolve all dependencies for configuration ':asciidoctorj:gems'. at org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration.rethrowFailure(DefaultLenientConfiguration.java:52) at org.gradle.api.internal.artifacts.ivyservice.DefaultResolvedConfiguration.rethrowFailure(DefaultResolvedConfiguration.java:36) at org.gradle.api.internal.artifacts.ivyservice.SelfResolvingDependencyResolver$FilesAggregatingResolvedConfiguration.rethrowFailure(SelfResolvingDependencyResolver.java:110) at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver$ErrorHandlingResolvedConfiguration.rethrowFailure(ErrorHandlingArtifactDependencyResolver.java:180) at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:444) at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getFiles(DefaultConfiguration.java:205) at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getFiles(Unknown Source) at org.gradle.api.internal.file.AbstractFileCollection.iterator(AbstractFileCollection.java:60) at org.gradle.util.CollectionUtils.filter(CollectionUtils.java:94) at org.gradle.api.internal.file.AbstractFileCollection$3.getFiles(AbstractFileCollection.java:212) at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext$FileTreeConverter.convertInto(DefaultFileCollectionResolveContext.java:191) at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.doResolve(DefaultFileCollectionResolveContext.java:103) at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.resolveAsFileTrees(DefaultFileCollectionResolveContext.java:75) at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext$FileTreeConverter.convertInto(DefaultFileCollectionResolveContext.java:182) at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.doResolve(DefaultFileCollectionResolveContext.java:98) at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.resolveAsFileTrees(DefaultFileCollectionResolveContext.java:75) at org.gradle.api.internal.file.CompositeFileCollection$1.resolve(CompositeFileCollection.java:88) at org.gradle.api.internal.file.CompositeFileCollection.getSourceCollections(CompositeFileCollection.java:143) at org.gradle.api.internal.file.CompositeFileTree.getSourceCollections(CompositeFileTree.java:30) at org.gradle.api.internal.file.CompositeFileCollection.getFiles(CompositeFileCollection.java:38) at org.gradle.api.internal.changedetection.state.DefaultFileCollectionSnapshotter.snapshot(DefaultFileCollectionSnapshotter.java:47) at org.gradle.api.internal.changedetection.rules.TaskUpToDateState.<init>(TaskUpToDateState.java:55) at org.gradle.api.internal.changedetection.changes.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.getStates(DefaultTaskArtifactStateRepository.java:126) at org.gradle.api.internal.changedetection.changes.DefaultTaskArtifactStateRepository$TaskArtifactStateImpl.isUpToDate(DefaultTaskArtifactStateRepository.java:69) at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:52) at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58) at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53) at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:305) at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79) at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63) at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:23) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:88) at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29) at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62) at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23) at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:68) at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32) at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:62) at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:55) at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:149) at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106) at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86) at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:80) at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33) at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:36) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26) at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:51) at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171) at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:237) at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:210) at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35) at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24) at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:206) at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169) at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33) at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22) at org.gradle.launcher.Main.doAction(Main.java:33) at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:54) at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:35) at org.gradle.launcher.GradleMain.main(GradleMain.java:23) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30) at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:127) at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:56) Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve rubygems:asciidoctor:1.5.3.dev. Required by: org.asciidoctor:asciidoctorj:1.5.3-SNAPSHOT at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainDependencyResolver.resolve(RepositoryChainDependencyResolver.java:81) at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainAdapter.resolve(RepositoryChainAdapter.java:69) at org.gradle.api.internal.artifacts.ivyservice.clientmodule.ClientModuleResolver.resolve(ClientModuleResolver.java:44) at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder$ModuleVersionResolveState.resolve(DependencyGraphBuilder.java:577) at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder$ModuleVersionResolveState.getMetaData(DependencyGraphBuilder.java:587) at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder$DependencyEdge.calculateTargetConfigurations(DependencyGraphBuilder.java:272) at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder$DependencyEdge.attachToTargetConfigurations(DependencyGraphBuilder.java:246) at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder.traverseGraph(DependencyGraphBuilder.java:156) at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder.resolveDependencyGraph(DependencyGraphBuilder.java:94) at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder.resolve(DependencyGraphBuilder.java:84) at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDependencyResolver$1.execute(DefaultDependencyResolver.java:122) at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDependencyResolver$1.execute(DefaultDependencyResolver.java:88) at org.gradle.internal.Transformers$4.transform(Transformers.java:136) at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyContextManager.withIvy(DefaultIvyContextManager.java:61) at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyContextManager.withIvy(DefaultIvyContextManager.java:39) at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDependencyResolver.resolve(DefaultDependencyResolver.java:88) at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDependencyResolver$1.run(CacheLockingArtifactDependencyResolver.java:42) at org.gradle.internal.Factories$1.create(Factories.java:22) at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:187) at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:175) at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:106) at org.gradle.cache.internal.DefaultCacheFactory$ReferenceTrackingCache.useCache(DefaultCacheFactory.java:187) at org.gradle.api.internal.artifacts.ivyservice.DefaultCacheLockingManager.useCache(DefaultCacheLockingManager.java:64) at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDependencyResolver.resolve(CacheLockingArtifactDependencyResolver.java:40) at org.gradle.api.internal.artifacts.ivyservice.SelfResolvingDependencyResolver.resolve(SelfResolvingDependencyResolver.java:45) at org.gradle.api.internal.artifacts.ivyservice.ShortcircuitEmptyConfigsArtifactDependencyResolver.resolve(ShortcircuitEmptyConfigsArtifactDependencyResolver.java:55) at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver.resolve(ErrorHandlingArtifactDependencyResolver.java:47) at org.gradle.api.internal.artifacts.ivyservice.DefaultConfigurationResolver.resolve(DefaultConfigurationResolver.java:46) at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveNow(DefaultConfiguration.java:250) at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getResolvedConfiguration(DefaultConfiguration.java:240) at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getResolvedConfiguration(Unknown Source) at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:442) ... 72 more Caused by: org.gradle.api.UncheckedIOException: Could not GET 'http://rubygems-proxy.torquebox.org/releases/rubygems/asciidoctor/1.5.3.dev/asciidoctor-1.5.3.dev.pom'. Received status code 500 from server: Internal Server Error at org.gradle.internal.resource.transport.http.HttpClientHelper.processResponse(HttpClientHelper.java:121) at org.gradle.internal.resource.transport.http.HttpClientHelper.performGet(HttpClientHelper.java:70) at org.gradle.internal.resource.transport.http.HttpResourceAccessor.getResource(HttpResourceAccessor.java:53) at org.gradle.internal.resource.transport.http.HttpResourceAccessor.getResource(HttpResourceAccessor.java:36) at org.gradle.internal.resource.transfer.ProgressLoggingExternalResourceAccessor.getResource(ProgressLoggingExternalResourceAccessor.java:39) at org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor.getResource(DefaultCacheAwareExternalResourceAccessor.java:72) at org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver.downloadStaticResource(DefaultExternalResourceArtifactResolver.java:91) at org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver.resolveMetaDataArtifact(DefaultExternalResourceArtifactResolver.java:57) at org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver.parseMetaDataFromArtifact(ExternalResourceResolver.java:162) at org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver.resolveStaticDependency(ExternalResourceResolver.java:141) at org.gradle.api.internal.artifacts.repositories.resolver.MavenResolver.doResolveComponentMetaData(MavenResolver.java:82) at org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver$RemoteRepositoryAccess.resolveComponentMetaData(ExternalResourceResolver.java:391) at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CacheLockReleasingModuleComponentsRepository$LockReleasingRepositoryAccess$2.run(CacheLockReleasingModuleComponentsRepository.java:65) at org.gradle.internal.Factories$1.create(Factories.java:22) at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:237) at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:308) at org.gradle.cache.internal.DefaultPersistentDirectoryStore.longRunningOperation(DefaultPersistentDirectoryStore.java:114) at org.gradle.cache.internal.DefaultCacheFactory$ReferenceTrackingCache.longRunningOperation(DefaultCacheFactory.java:179) at org.gradle.api.internal.artifacts.ivyservice.DefaultCacheLockingManager.longRunningOperation(DefaultCacheLockingManager.java:56) at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CacheLockReleasingModuleComponentsRepository$LockReleasingRepositoryAccess.resolveComponentMetaData(CacheLockReleasingModuleComponentsRepository.java:63) at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository$ResolveAndCacheRepositoryAccess.resolveComponentMetaData(CachingModuleComponentRepository.java:284) at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.BaseModuleComponentRepositoryAccess.resolveComponentMetaData(BaseModuleComponentRepositoryAccess.java:38) at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.memcache.InMemoryCachedModuleComponentRepository$CachedAccess.resolveComponentMetaData(InMemoryCachedModuleComponentRepository.java:70) at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ComponentMetaDataResolveState.process(ComponentMetaDataResolveState.java:70) at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ComponentMetaDataResolveState.resolve(ComponentMetaDataResolveState.java:62) at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainDependencyResolver.findBestMatch(RepositoryChainDependencyResolver.java:114) at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainDependencyResolver.findBestMatch(RepositoryChainDependencyResolver.java:97) at org.gradle.api.internal.artifacts.ivyservice.ivyresolve.RepositoryChainDependencyResolver.resolve(RepositoryChainDependencyResolver.java:70) ... 103 more BUILD FAILED |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Hi Sean, I don't think that you've done something wrong. Haven't tried it myself at this very moment but HTTP 500 looks more like the server delivering the Ruby gem has some problems. Maybe best to wait a while and retry later. Best regards Robert
... [show rest of quote]
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
Hi Sean,
the AsciidoctorJ 1.6.0 Snapshots are now automatically published to https://oss.jfrog.org. So you can simply use that now without having to build the archives yourself. The Readme describes how to consume these artifacts: https://github.com/asciidoctor/asciidoctorj/blob/asciidoctorj-1.6.0/README.adoc#using-a-snapshot-version The latest snapshot also provides a method `Processor.parseContent()` that should help you getting your extension working with AsciidoctorJ 1.6.0. It should be possible now that you remove your own Parser wrapper and use that method instead. Robert |
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
|
On Sat, Aug 1, 2015 at 8:06 AM, Robert.Panzer [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Keep in mind, though, that at the moment, these snapshots are still based on Asciidoctor 1.5.2. It might be interesting to consider whether the AsciidoctorJ snapshot should depend on the Asciidoctor dev version or the stable release. |
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 sean.osterberg
On Fri, Jul 24, 2015 at 3:40 PM, sean.osterberg [via Asciidoctor :: Discussion] <[hidden email]> wrote: It appears that AsciidoctorJ doesn't like any custom blocks if they're malformed in pretty much any way. I think we should work on making it more robust. This may require a change to AsciidoctorJ and/or a change to Asciidoctor core. These use cases can serve as crucial tests to determine where to add the guards. Cheers, |
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 sean.osterberg
On Fri, Jul 24, 2015 at 4:51 PM, sean.osterberg [via Asciidoctor :: Discussion] <[hidden email]> wrote: ML-SOSTER-OSX-SF:asciidoctorj sean.osterberg$ sh test-asciidoctor-upstream.sh sed: 1: "pom.xml": extra characters at the end of p command sed: 1: "asciidoctor.gemspec": command a expects \ followed by text It looks like the sed script is not compatible with OSX. As a result, the remainder of the script fails to operate correctly. Looks like I need to make the change described here: |
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 sean.osterberg
I've proposed a patch for the test upstream script. See -Dan On Sun, Aug 2, 2015 at 12:34 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 |
Thanks Dan, I didn't even think about an OS X issue.
Two issues I'm hoping you or Robert can help me with: 1) Though the block processor code mostly works fine for 1.5.2 as long as there is no malformed block syntax, I sometimes get the following random exception. Usually this happens after running my code many times: 2015-08-03 14:39:48 INFO AsciiDocProcessor:37 - Processing AsciiDoc file: "/Users/.../content-based-routing-tutorial.adoc" org.jruby.exceptions.RaiseException: (NoMethodError) asciidoctor: FAILED: /Users/.../content-based-routing-tutorial.adoc: Failed to parse source, undefined method `include?' for nil:NilClass at RUBY.load(/Users/sean.osterberg/.rvm/gems/ruby-2.2.1/gems/asciidoctor-1.5.2/lib/asciidoctor.rb:1362) at RUBY.convert(/Users/sean.osterberg/.rvm/gems/ruby-2.2.1/gems/asciidoctor-1.5.2/lib/asciidoctor.rb:1458) at RUBY.convert_file(/Users/sean.osterberg/.rvm/gems/ruby-2.2.1/gems/asciidoctor-1.5.2/lib/asciidoctor.rb:1562) at RUBY.convertFile(<script>:68) at org.jruby.gen.InterfaceImpl1824405898.convertFile(org/jruby/gen/InterfaceImpl1824405898.gen:13) Any idea about this exception? I'm trying to figure out when it appears sometimes and not others. Last time it appeared, I just rebooted my machine and the error went away. It's happening again today and a restart hasn't helped. I realize how lame this sounds, but I don't know what's wrong. 2) I just got 1.6.0-SNAPSHOT per the instructions here and verified the latest bits are coming from the oss.jfrog site instead of my own failed build (I cleared my local maven repo). But when I run my code, I get the same exception when it hits the first tab block: org.asciidoctor.internal.AsciidoctorCoreException: org.jruby.exceptions.RaiseException: (TypeError) exception class/object expected at org.asciidoctor.internal.JRubyAsciidoctor.convertFile(JRubyAsciidoctor.java:529) at org.asciidoctor.internal.JRubyAsciidoctor.convertFile(JRubyAsciidoctor.java:543) at org.asciidoctor.internal.JRubyAsciidoctor.convertFile(JRubyAsciidoctor.java:538) at org.mule.docs.AsciiDocProcessor.convertFile(AsciiDocProcessor.java:38) at org.mule.docs.AsciiDocPage.getPageFromFile(AsciiDocPage.java:56) at org.mule.docs.AsciiDocPage.fromFiles(AsciiDocPage.java:43) at org.mule.docs.Section.getSectionFromDirectory(Section.java:90) at org.mule.docs.Section.fromDirectory(Section.java:72) at org.mule.docs.SiteBuilder.getSections(SiteBuilder.java:42) at org.mule.docs.SiteBuilder.<init>(SiteBuilder.java:27) at org.mule.docs.SiteBuilder.buildSite(SiteBuilder.java:34) at org.mule.docs.SiteBuilderTest.buildSite_withRealFolders_BuildsSite(SiteBuilderTest.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:78) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:212) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:68) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140) Caused by: org.jruby.exceptions.RaiseException: (TypeError) exception class/object expected at RUBY.load(/Users/sean.osterberg/.rvm/gems/ruby-2.2.1/gems/asciidoctor-1.5.2/lib/asciidoctor.rb:1362) at RUBY.convert(/Users/sean.osterberg/.rvm/gems/ruby-2.2.1/gems/asciidoctor-1.5.2/lib/asciidoctor.rb:1458) at RUBY.convert_file(/Users/sean.osterberg/.rvm/gems/ruby-2.2.1/gems/asciidoctor-1.5.2/lib/asciidoctor.rb:1562) at RUBY.convertFile(<script>:68) at org.jruby.gen.InterfaceImpl1826832927.convertFile(org/jruby/gen/InterfaceImpl1826832927.gen:13) EDIT: In case it helps, here's the code for the 1.6.0-SNAPSHOT block processor (from which I removed the calls to the Ruby runtime): public class TabProcessor extends BlockProcessor { private AsciiDocParser parser; private AsciiDocProcessor processor; private static Map<String, Object> CONFIG = new HashMap<String, Object>() {{ put("contexts", Arrays.asList(":listing")); put("content_model", ":compound"); }}; public TabProcessor(String name, Map<String, Object> config) { super(name, CONFIG); } @Override public Object process(AbstractBlock parent, Reader reader, Map<String, Object> attributes) { Map<String, Object> inherited = new HashMap<String, Object>(); AbstractBlock container = createBlock(parent, "open", (String)null, inherited, new HashMap<Object, Object>()); Map<String, String> titleAndId = new LinkedHashMap<String, String>(); int count = 0; while (reader.hasMoreLines()) { Block child = parser.nextBlock(reader, parent, new HashMap<String, Object>()); if (child != null) { String tabTitle = child.title(); String uniqueId = Utilities.cleanPageFileNames(tabTitle) + "-" + Utilities.getRandomAlphaNumericString(5); titleAndId.put(tabTitle, uniqueId); String singleTabHtmlOpen; if (count == 0) { singleTabHtmlOpen = "<div class=\"tab-pane in active fade no-padding\" id=\"" + uniqueId + "\">"; } else { singleTabHtmlOpen = "<div class=\"tab-pane fade no-padding\" id=\"" + uniqueId + "\">"; } String converted = processor.convertAsciiDocString(child.content().toString()); converted = Utilities.getOnlyContentDivFromHtml(converted); converted = singleTabHtmlOpen + converted + "</div>"; Block block = createBlock(parent, "pass", converted, inherited, new HashMap<Object, Object>()); count++; // NOTE workaround missing append method on the AbstractBlock interface //JavaEmbedUtils.invokeMethod(rubyRuntime, container, "append", new Object[]{block}, Object.class); container.blocks().add(block); } } String tabsOpen = "<div class=\"panel panel-default no-padding\">\n" + " <div class=\"panel-heading no-padding\">\n" + " <!-- Nav tabs -->\n" + " <ul class=\"nav nav-tabs\" role=\"tablist\">\n"; List<Map.Entry<String,String>> randAccess = new ArrayList<Map.Entry<String,String>>(titleAndId.entrySet()); for (int i = 0; i < titleAndId.size(); i++) { if (i == 0) { tabsOpen += "<li class=\"active\">"; tabsOpen += "<a href=\"#" + randAccess.get(i).getValue() + "\" role=\"tab\" data-toggle=\"tab\">" + randAccess.get(i).getKey() + "</a></li>\n"; } else { tabsOpen += "<li><a href=\"#" + randAccess.get(i).getValue() + "\" role=\"tab\" data-toggle=\"tab\">" + randAccess.get(i).getKey() + "</a></li>\n"; } } tabsOpen += "</ul>\n</div>\n<div class=\"panel-body tab-content no-padding\">"; String tabsClose = "</div></div>"; String containerContents = tabsOpen + container.content().toString() + tabsClose; AbstractBlock containerNew = createBlock(parent, "pass", containerContents, inherited, new HashMap<Object, Object>()); container = containerNew; return container; } } |
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
|
Sean, In your case, the snapshot from Bintray isn't going to help get to the bottom of things. It still uses Asciidoctor 1.5.2, which is masking the true origin of the stacktrace. Now that Robert has merged the fix to the test-asciidoctor-upstream.sh shell script, can you try using it again? That should build successfully (don't forget to add the publishToMavenLocal task) and we'll get to the real source of the error. Cheers, -Dan On Mon, Aug 3, 2015 at 3:38 PM, sean.osterberg [via Asciidoctor :: Discussion] <[hidden email]> wrote: Thanks Dan, I didn't even think about an OS X issue. ... [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 |
This post was updated on Aug 04, 2015; 12:36am.
Ahh, I misunderstood the earlier post. I also should have known when the libpath was pointing to 1.5.2.
Thanks for updating the script for us OS X users. I got the latest build of AsciidoctorJ, updated the script to point to the local maven repo, and referenced 1.6.0-SNAPSHOT in my pom file. Here's the new exception I'm getting: Aug 03, 2015 5:22:39 PM org.asciidoctor.internal.JRubyAsciidoctor convertFile SEVERE: (NoMethodError) undefined method `exception' for java.lang.NullPointerException:Java::JavaLang::NullPointerException org.asciidoctor.internal.AsciidoctorCoreException: org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `exception' for java.lang.NullPointerException:Java::JavaLang::NullPointerException at org.asciidoctor.internal.JRubyAsciidoctor.convertFile(JRubyAsciidoctor.java:529) at org.asciidoctor.internal.JRubyAsciidoctor.convertFile(JRubyAsciidoctor.java:543) at org.asciidoctor.internal.JRubyAsciidoctor.convertFile(JRubyAsciidoctor.java:538) at org.mule.docs.AsciiDocProcessor.convertFile(AsciiDocProcessor.java:38) at org.mule.docs.AsciiDocPage.getPageFromFile(AsciiDocPage.java:56) at org.mule.docs.AsciiDocPage.fromFiles(AsciiDocPage.java:43) at org.mule.docs.Section.getSectionFromDirectory(Section.java:90) at org.mule.docs.Section.fromDirectory(Section.java:72) at org.mule.docs.SiteBuilder.getSections(SiteBuilder.java:42) at org.mule.docs.SiteBuilder.<init>(SiteBuilder.java:27) at org.mule.docs.SiteBuilder.buildSite(SiteBuilder.java:34) at org.mule.docs.SiteBuilderTest.buildSite_withRealFolders_BuildsSite(SiteBuilderTest.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:78) at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:212) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:68) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140) Caused by: org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `exception' for java.lang.NullPointerException:Java::JavaLang::NullPointerException at RUBY.load(/Users/sean.osterberg/.m2/repository/org/asciidoctor/asciidoctorj/1.6.0-SNAPSHOT/asciidoctorj-1.6.0-SNAPSHOT.jar!/gems/asciidoctor-1.5.3.dev/lib/asciidoctor.rb:1364) at RUBY.convert(/Users/sean.osterberg/.m2/repository/org/asciidoctor/asciidoctorj/1.6.0-SNAPSHOT/asciidoctorj-1.6.0-SNAPSHOT.jar!/gems/asciidoctor-1.5.3.dev/lib/asciidoctor.rb:1462) at RUBY.convert_file(/Users/sean.osterberg/.m2/repository/org/asciidoctor/asciidoctorj/1.6.0-SNAPSHOT/asciidoctorj-1.6.0-SNAPSHOT.jar!/gems/asciidoctor-1.5.3.dev/lib/asciidoctor.rb:1576) at RUBY.convertFile(<script>:68) at org.jruby.gen.InterfaceImpl1688185319.convertFile(org/jruby/gen/InterfaceImpl1688185319.gen:13) |
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
|
Excellent! Now we're on Asciidoctor 1.5.3.dev! Okay, so we need one more step. Now Java wants to truncate the stacktrace. Can you enable full stacktraces? Also, can you use JRuby 9000, which actually has better stacktraces at the Ruby/Java boundary. When you post the full stackgtrace, can you put it in a gist or pastebin so that it doesn't make a super long email message? One other approach is to send the project to my e-mail (as well as Robert's) so we can debug it locally. I'm interested in the error, but I'm also interested in documenting how we can reveal errors more clearly when they happen. These libraries like to truncate to save space and thus confuse us all. Cheers, -Dan On Mon, Aug 3, 2015 at 6:20 PM, sean.osterberg [via Asciidoctor :: Discussion] <[hidden email]> wrote: Ahh, I misunderstood the earlier post. I also should have known when the libpath was pointing to 1.5.2. ... [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 |
Thanks Dan, I'll do those things. I'll send a link to a repository as well.
That said, I'm 99% sure the problem I'm having is related to how I'm processing the blocks using the new build. For 1.5.2 I was using a processor that called the Ruby runtime: IRubyObject parserRubyClass = rubyRuntime.evalScriptlet("Asciidoctor::Parser"); processor = AsciiDocProcessor.getProcessorInstance(); this.parser = (AsciiDocParser) JavaEmbedUtils.rubyToJava(rubyRuntime, parserRubyClass, AsciiDocParser.class); And then parser.nextBlock() was called. I removed the calls to the parser but I'm not sure how to get the same functionality using AsciidoctorJ. The error of my ways will soon be clear with the repository -- stay tuned. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
I was able to get things working with some help from Robert and Dan. The end result (and successful code) for injecting tabs was like so, using the latest AsciidoctorJ 1.6.0-SNAPSHOT build (which uses 1.5.2). The code will be cleaned up, but it might be a helpful example for some.
Registering the Processor: JavaExtensionRegistry extensionRegistry = asciidoctor.javaExtensionRegistry(); extensionRegistry.block("tabs", TabProcessor.class); Code for the Processor: import org.asciidoctor.ast.AbstractBlock; import org.asciidoctor.ast.Block; import org.asciidoctor.extension.BlockProcessor; import org.asciidoctor.extension.ContentModel; import org.asciidoctor.extension.Contexts; import org.asciidoctor.extension.Reader; import java.util.*; @Contexts(Contexts.CONTEXT_LISTING) @ContentModel(ContentModel.COMPOUND) public class TabProcessor extends BlockProcessor { private AsciiDocProcessor processor; public TabProcessor() { processor = AsciiDocProcessor.getProcessorInstance(); } @Override public Object process(AbstractBlock parent, Reader reader, Map<String, Object> attributes) { Map<String, Object> inherited = new HashMap<String, Object>(); AbstractBlock container = createBlock(parent, "open", (String)null, inherited, new HashMap<Object, Object>()); Map<String, String> titleAndId = new LinkedHashMap<String, String>(); int count = 0; parseContent(container, reader.readLines()); for (int i = 0; i < container.getBlocks().size(); i++) { AbstractBlock child = container.getBlocks().get(i); String tabTitle = child.getTitle(); String uniqueId = Utilities.cleanPageFileNames(tabTitle) + "-" + Utilities.getRandomAlphaNumericString(5); titleAndId.put(tabTitle, uniqueId); String singleTabHtmlOpen; if (count == 0) { singleTabHtmlOpen = "<div class=\"tab-pane in active fade no-padding\" id=\"" + uniqueId + "\">"; } else { singleTabHtmlOpen = "<div class=\"tab-pane fade no-padding\" id=\"" + uniqueId + "\">"; } String converted = processor.convertAsciiDocString(child.content().toString()); converted = Utilities.getOnlyContentDivFromHtml(converted); converted = singleTabHtmlOpen + converted + "</div>"; Block block = createBlock(parent, "pass", converted, inherited, new HashMap<Object, Object>()); count++; container.getBlocks().set(i, block); } String tabsOpen = "<div class=\"panel panel-default no-padding\">\n" + " <div class=\"panel-heading no-padding\">\n" + " <!-- Nav tabs -->\n" + " <ul class=\"nav nav-tabs\" role=\"tablist\">\n"; List<Map.Entry<String,String>> randAccess = new ArrayList<Map.Entry<String,String>>(titleAndId.entrySet()); for (int i = 0; i < titleAndId.size(); i++) { if (i == 0) { tabsOpen += "<li class=\"active\">"; tabsOpen += "<a href=\"#" + randAccess.get(i).getValue() + "\" role=\"tab\" data-toggle=\"tab\">" + randAccess.get(i).getKey() + "</a></li>\n"; } else { tabsOpen += "<li><a href=\"#" + randAccess.get(i).getValue() + "\" role=\"tab\" data-toggle=\"tab\">" + randAccess.get(i).getKey() + "</a></li>\n"; } } tabsOpen += "</ul>\n</div>\n<div class=\"panel-body tab-content no-padding\">"; String tabsClose = "</div></div>"; String containerContents = tabsOpen + container.getContent().toString() + tabsClose; return createBlock(parent, "pass", containerContents, inherited, new HashMap<Object, Object>()); } } |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
There's is the problem of using an unreleased version. But I think it would make a great addition for https://github.com/robertpanzer/asciidoctorj-extensions-lab. What do you think @Robert? Does make sense to have a branch for it and merge once is 1.6.0 is released? |
Free forum by Nabble | Edit this page |