asciidoctor / asciidoctorj Goto Github PK
View Code? Open in Web Editor NEW:coffee: Java bindings for Asciidoctor. Asciidoctor on the JVM!
Home Page: http://asciidoctor.org
License: Apache License 2.0
:coffee: Java bindings for Asciidoctor. Asciidoctor on the JVM!
Home Page: http://asciidoctor.org
License: Apache License 2.0
Extract Asciidoctor Ruby class to external file, now this class is embedded as String inside code.
Add leveloffset attribute. Related with asciidoctor/asciidoctor#212
AttributesBuilder should include methods for:
Although in current version you can set them using options(...) method.
Update JRuby version to 1.7.4
Add linkattrs attribute so target window can be set on links. Related with asciidoctor/asciidoctor#214
Add Reader/Writer support in Asciidoctor interface, this will imply some research over how to deal with Java streams in JRuby.
I've added asciidoctor.jar and jruby-complete.jar to the classpath of my osgi bundle and runs this code:
asciidoctor = Factory.create();
Creates the following exception:
org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- asciidoctor
at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1027)
at RUBY.require(classpath:/METAINF/jruby.home/lib/ruby/shared/rubygems/custom_require.rb:36)
at RUBY.(root)(<script>:2)
I've tried finding info on running jruby in osgi but they all seem to bump into this issue when external resources needs loading.
the Asciidoctor Java integration could preload specified libraries when it boots JRuby, removing the possibility of any problems or warnings.
Related with Issue
To enable Mac(ros) (http://asciidoctor.org/news/#return-of-the-mac-ros-making-it-clear-what-readers-are-supposed-to-press) experimental attribute must be set to true.
Refactor AsciidocDirectoryWalker name following conventions. Whenever referring to AsciiDoc, we should use uppercase the D
Add stylesheets and stylesdir attributes
Hi,
imagesDir is of type File so when rendering a html document the path is absolute which is an issue when moving the doc.
org.asciidoctor.AttributesBuilder#imagesDir shouldn't call getAbsolutePath or should even use a string
render method fails if to_dir or to_file are set by throwing a Ruby Exception.
Add support for new icons specs allowing the use of font-awesome. Related with asciidoctor/asciidoctor#115
Improve performance during startup:
http://discuss.asciidoctor.org/Faster-JRuby-execution-td130.html
One of the key features of Asciidoctor is the ability to retrieve information from the header of an AsciiDoc document without parsing or rendering the entire document.
This feature is activated by setting the :parse_header_only
option to true
. In Asciidoctor, this option is used with the Asciidoctor#load
method to return a Document
object that only contains header information. This information includes the document title, built-in attributes and attributes from the header.
For example, consider the following document:
= Sample Document
Doc Writer <[email protected]>
v1.0, 2013-05-20: First draft
Preamble...
When loading the document in "parse header only" mode:
doc = Asciidoctor.load_file('sample.adoc', :parse_header_only = true);
the Document
contains the following information:
pp doc.blocks.size
=> 0
pp doc.doctitle
=> "Sample Document"
pp doc.attributes
=> {"encoding"=>"UTF-8",
"sectids"=>"",
"notitle"=>"",
"toc-placement"=>"auto",
"stylesheet"=>"",
"linkcss"=>"",
"caution-caption"=>"Caution",
"important-caption"=>"Important",
"note-caption"=>"Note",
"tip-caption"=>"Tip",
"warning-caption"=>"Warning",
"appendix-caption"=>"Appendix",
"example-caption"=>"Example",
"figure-caption"=>"Figure",
"table-caption"=>"Table",
"toc-title"=>"Table of Contents",
"docfile"=>"sample.adoc",
"docdir"=>"",
"docname"=>"sample",
"docdate"=>"2013-05-20",
"doctime"=>"23:36:24 MDT",
"docdatetime"=>"2013-05-20 23:36:24 MDT",
"asciidoctor"=>"",
"asciidoctor-version"=>"0.1.2",
"safe-mode-name"=>"secure",
"safe-mode-secure"=>"",
"safe-mode-level"=>20,
"embedded"=>"",
"include-depth"=>10,
"backend"=>"html5",
"doctype"=>"article",
"backend-html5"=>"",
"basebackend"=>"html",
"basebackend-html"=>"",
"html5-article"=>"",
"html-article"=>"",
"outfilesuffix"=>".html",
"filetype"=>"html",
"filetype-html"=>"",
"localdate"=>"2013-05-20",
"localtime"=>"23:38:10 MDT",
"localdatetime"=>"2013-05-20 23:38:10 MDT",
"stylesdir"=>".",
"iconsdir"=>"./images/icons",
"firstname"=>"Doc",
"author"=>"Doc Writer",
"authorinitials"=>"DW",
"lastname"=>"Writer",
"email"=>"[email protected]",
"authorcount"=>1,
"authors"=>"Doc Writer",
"revdate"=>"2013-05-20",
"revnumber"=>"1.0",
"revremark"=>"First draft"}
We see there is lots of good information about the document, yet no time is spent parsing below the header. I could see this being very useful for applications that need to scan for documents by title, author, date, etc.
In order to support this feature, the Asciidoctor Java integration would need to be able to represent an Asciidoctor Document in Java. In the meantime, this could be a lightweight object that just holds the doctitle and attributes.
I'm using the Gradle plugin for Asciidoctor and tried to use the copycss
attribute as it seems the easiest way to get hold of the stylesheet. But the attribute results in the exception at the end of this report.
I don't think this is a problem with the Gradle plugin but the Java integration. Perhaps JRuby's stat()
method can't handle files inside archives? If that's the case, perhaps the JARs need unpacking first?
Caused by: org.jruby.exceptions.RaiseException: (Errno::ENOENT) /Users/pledbrook/dev/tools/ratpack/ratpack-docs/jar:file:/Users/pledbrook/.gradle/caches/artifacts-23/filestore/org.asciidoctor/asciidoctor-java-integration/0.1.2/jar/34e5c3a38e59337da992243afb25185c56462866/asciidoctor-java-integration-0.1.2.jar!/gems/asciidoctor-0.1.2/stylesheets/asciidoctor.css
at org.jruby.RubyFile.stat(org/jruby/RubyFile.java:810)
at RUBY.fu_each_src_dest(jar:file:/Users/pledbrook/.gradle/caches/artifacts-23/filestore/org.jruby/jruby-complete/1.7.3/jar/2273e4c2a2abdd4b25a21bc513bfc05cfba31f3b/jruby-complete-1.7.3.jar!/META-INF/jruby.home/lib/ruby/1.9/fileutils.rb:1524)
at RUBY.fu_each_src_dest0(jar:file:/Users/pledbrook/.gradle/caches/artifacts-23/filestore/org.jruby/jruby-complete/1.7.3/jar/2273e4c2a2abdd4b25a21bc513bfc05cfba31f3b/jruby-complete-1.7.3.jar!/META-INF/jruby.home/lib/ruby/1.9/fileutils.rb:1538)
at RUBY.fu_each_src_dest(jar:file:/Users/pledbrook/.gradle/caches/artifacts-23/filestore/org.jruby/jruby-complete/1.7.3/jar/2273e4c2a2abdd4b25a21bc513bfc05cfba31f3b/jruby-complete-1.7.3.jar!/META-INF/jruby.home/lib/ruby/1.9/fileutils.rb:1522)
at RUBY.cp(jar:file:/Users/pledbrook/.gradle/caches/artifacts-23/filestore/org.jruby/jruby-complete/1.7.3/jar/2273e4c2a2abdd4b25a21bc513bfc05cfba31f3b/jruby-complete-1.7.3.jar!/META-INF/jruby.home/lib/ruby/1.9/fileutils.rb:395)
at RUBY.render(jar:file:/Users/pledbrook/.gradle/caches/artifacts-23/filestore/org.asciidoctor/asciidoctor-java-integration/0.1.2/jar/34e5c3a38e59337da992243afb25185c56462866/asciidoctor-java-integration-0.1.2.jar!/gems/asciidoctor-0.1.2/lib/asciidoctor.rb:851)
at RUBY.render_file(jar:file:/Users/pledbrook/.gradle/caches/artifacts-23/filestore/org.asciidoctor/asciidoctor-java-integration/0.1.2/jar/34e5c3a38e59337da992243afb25185c56462866/asciidoctor-java-integration-0.1.2.jar!/gems/asciidoctor-0.1.2/lib/asciidoctor.rb:870)
at RUBY.render_file(<script>:8)
at org.jruby.gen.InterfaceImpl1066952373.render_file(org/jruby/gen/InterfaceImpl1066952373.gen:13)
at org.asciidoctor.gradle.AsciidoctorTask$_gititdone_closure1.doCall(AsciidoctorTask.groovy:87)
at org.asciidoctor.gradle.AsciidoctorTask.gititdone(AsciidoctorTask.groovy:74)
at org.gradle.util.ReflectionUtil.invoke(ReflectionUtil.groovy:23)
Remove copycss hack for Asciidoctor 0.1.2 because version 0.1.3 will implement copycss in different way so can be integrated better with java part.
Updates asciidoctor dependency to 0.1.3
Setting default attributes during AttributesBuilder creation, so instead of setting one by one all attributes, you can add them all at once during the creation of AttributesBuilder.
Update Asciidoctor gem to 0.1.2
Add toc attribute
Adapt boolean attributes to Asciidoctor values. In Asciidoctor a boolean attribute can appear or not, but does not hold true/false values.
if attribute is present value should be an empty string, if not present (false) then value should be null.
This is just an idea I got while trying to integrate asciidoctor into an eclipse builder and found that asciidoctor is pretty fast, but sometimes does take more than a few seconds to complete rendering my docs - and probably will take even longer when users will real big docs come along.
Would it be possible to somehow get programmatic feedback on how far asciidoctor is in its rendering ? and optimally be able to cancel rendering so it doesn't use unnecessary CPU ?
Usecase here is that I plan to add a builder to eclipse that will detect changes to files, start building when a resource (or directory with .adoc files) haven't been saved in a grace period (~1-5s) and then start the rendering - but if the user then starts saving the current running rendering is going to be useless and it would be great to just cancel it instead of having to wait for it to finish.
I can't just start a new rendering since the old one might overwrite files (I could of course overcome this by rendering to a separate file and just move it of to later but it would be nicer if I could just cancel the rendering.
Add IRC notifications from Travis
From what I can see, the gems are all included in the distributed jar from this project.
But at the same time, they are declared in the POM file in such a way that maven projects that depend on this one will try to resolve the gems, and fail if they can't be resolved.
I'd suggest fixing this by adding scope=provided to the gem dependencies.
Doesn't make sense to both have the gems in the jar and have downstream projects resolve them again on their own?
As of Asciidoctor 0.1.1, the backend
and doctype
can be set as options rather than attributes. If used in both places, the option takes precedence.
Add the backend
and doctype
to the [OptionsBuilder](https://github.com/asciidoctor/asciidoctor-java-integration/blob/master/src/main/java/org/asciidoctor/OptionsBuilder.java](OptionsBuilder) class.
We're trying to retrofit the asciidcotor-gradle-plugin with asciidoctor-java-integration however we've encountered a problem. The following build.gradle
fails
repositories {
mavenCentral()
mavenRepo(name: 'rubygems-release', url: 'http://rubygems-proxy.torquebox.org/releases')
}
dependencies {
deployerJars 'org.apache.maven.wagon:wagon-webdav:1.0-beta-2',
'org.apache.maven:maven-ant-tasks:2.1.0'
compile gradleApi()
compile 'org.jruby:jruby-complete:1.7.2'
compile 'org.asciidoctor:asciidoctor-java-integration:0.1.1'
testCompile 'org.spockframework:spock-core:0.6-groovy-1.8'
}
The following error gets printed with --stacktrace
gradle build --stacktrace
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration ':compile'.
> java.lang.NullPointerException (no error message)
* 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 ':compile'.
at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver.wrapException(ErrorHandlingArtifactDependencyResolver.java:51)
at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver.access$000(ErrorHandlingArtifactDependencyResolver.java:29)
at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver$BrokenResolvedConfiguration.rethrowFailure(ErrorHandlingArtifactDependencyResolver.java:131)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:461)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getFiles(DefaultConfiguration.java:202)
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.api.plugins.GroovyBasePlugin.findGroovyJarFile(GroovyBasePlugin.java:172)
at org.gradle.api.plugins.GroovyBasePlugin.getGroovyClasspath(GroovyBasePlugin.java:143)
at org.gradle.api.plugins.GroovyBasePlugin.access$000(GroovyBasePlugin.java:50)
at org.gradle.api.plugins.GroovyBasePlugin$1$1.call(GroovyBasePlugin.java:78)
at org.gradle.api.internal.ConventionAwareHelper$2.getValue(ConventionAwareHelper.java:87)
at org.gradle.api.internal.ConventionAwareHelper$MappedPropertyImpl.getValue(ConventionAwareHelper.java:147)
at org.gradle.api.internal.ConventionAwareHelper.getConventionValue(ConventionAwareHelper.java:117)
at org.gradle.api.tasks.compile.GroovyCompile_Decorated.getGroovyClasspath(Unknown Source)
at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:216)
at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:122)
at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:147)
at org.gradle.api.tasks.compile.GroovyCompile_Decorated.invokeMethod(Unknown Source)
at org.gradle.util.ReflectionUtil.invoke(ReflectionUtil.groovy:23)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$PropertyInfo.getValue(AnnotationProcessingTaskFactory.java:369)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$Validator$1.call(AnnotationProcessingTaskFactory.java:182)
at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.doResolve(DefaultFileCollectionResolveContext.java:120)
at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.resolveAsFileTrees(DefaultFileCollectionResolveContext.java:75)
at org.gradle.api.internal.file.collections.BuildDependenciesOnlyFileCollectionResolveContext$BuildableFileTreeInternalConverter.convertInto(BuildDependenciesOnlyFileCollectionResolveContext.java:50)
at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.doResolve(DefaultFileCollectionResolveContext.java:98)
at org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.resolveAsFileCollections(DefaultFileCollectionResolveContext.java:82)
at org.gradle.api.internal.file.collections.BuildDependenciesOnlyFileCollectionResolveContext.resolveAsBuildables(BuildDependenciesOnlyFileCollectionResolveContext.java:43)
at org.gradle.api.internal.file.CompositeFileCollection.addDependencies(CompositeFileCollection.java:136)
at org.gradle.api.internal.file.CompositeFileCollection$3.resolve(CompositeFileCollection.java:124)
at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext$TaskGraphImpl.getNodeValues(CachingTaskDependencyResolveContext.java:86)
at org.gradle.api.internal.CachingDirectedGraphWalker$GraphWithEmpyEdges.getNodeValues(CachingDirectedGraphWalker.java:173)
at org.gradle.api.internal.CachingDirectedGraphWalker.doSearch(CachingDirectedGraphWalker.java:95)
at org.gradle.api.internal.CachingDirectedGraphWalker.findValues(CachingDirectedGraphWalker.java:63)
at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.doResolve(CachingTaskDependencyResolveContext.java:74)
at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.resolve(CachingTaskDependencyResolveContext.java:63)
at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.getDependencies(CachingTaskDependencyResolveContext.java:53)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.addToTaskGraph(DefaultTaskExecutionPlan.java:72)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.addTasks(DefaultTaskGraphExecuter.java:72)
at org.gradle.execution.TaskNameResolvingBuildConfigurationAction.configure(TaskNameResolvingBuildConfigurationAction.java:51)
at org.gradle.execution.DefaultBuildExecuter.configure(DefaultBuildExecuter.java:42)
at org.gradle.execution.DefaultBuildExecuter.access$100(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:48)
at org.gradle.execution.ExcludedTaskFilteringBuildConfigurationAction.configure(ExcludedTaskFilteringBuildConfigurationAction.java:46)
at org.gradle.execution.DefaultBuildExecuter.configure(DefaultBuildExecuter.java:42)
at org.gradle.execution.DefaultBuildExecuter.access$100(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:48)
at org.gradle.execution.DefaultTasksBuildExecutionAction.configure(DefaultTasksBuildExecutionAction.java:38)
at org.gradle.execution.DefaultBuildExecuter.configure(DefaultBuildExecuter.java:42)
at org.gradle.execution.DefaultBuildExecuter.select(DefaultBuildExecuter.java:35)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:155)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:38)
at org.gradle.launcher.exec.InProcessGradleLauncherActionExecuter.execute(InProcessGradleLauncherActionExecuter.java:39)
at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:45)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:42)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:24)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
at org.gradle.launcher.daemon.server.exec.StartStopIfBuildAndStop.execute(StartStopIfBuildAndStop.java:33)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
at org.gradle.launcher.daemon.server.exec.ReturnResult.execute(ReturnResult.java:34)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:70)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:68)
at org.gradle.util.Swapper.swap(Swapper.java:38)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:68)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:59)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:45)
at org.gradle.launcher.daemon.server.DaemonStateCoordinator.runCommand(DaemonStateCoordinator.java:186)
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy.doBuild(StartBuildOrRespondWithBusy.java:49)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
at org.gradle.launcher.daemon.server.exec.HandleStop.execute(HandleStop.java:36)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
at org.gradle.launcher.daemon.server.exec.CatchAndForwardDaemonFailure.execute(CatchAndForwardDaemonFailure.java:32)
at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)
at org.gradle.launcher.daemon.server.exec.DefaultDaemonCommandExecuter.executeCommand(DefaultDaemonCommandExecuter.java:48)
at org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.handleCommand(DefaultIncomingConnectionHandler.java:155)
at org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.receiveAndHandleCommand(DefaultIncomingConnectionHandler.java:128)
at org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.run(DefaultIncomingConnectionHandler.java:116)
at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)
Caused by: java.lang.NullPointerException
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder$ModuleVersionSelectorResolveState.resolve(DependencyGraphBuilder.java:947)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder$DependencyEdge.getArtifacts(DependencyGraphBuilder.java:370)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder$DependencyEdge.attachToParents(DependencyGraphBuilder.java:380)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder$ConfigurationNode.attachToParents(DependencyGraphBuilder.java:831)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder.assembleResult(DependencyGraphBuilder.java:160)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder.resolve(DependencyGraphBuilder.java:72)
at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDependencyResolver.resolve(DefaultDependencyResolver.java:78)
at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDependencyResolver$1.create(CacheLockingArtifactDependencyResolver.java:39)
at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDependencyResolver$1.create(CacheLockingArtifactDependencyResolver.java:37)
at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:124)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:130)
at org.gradle.api.internal.artifacts.ivyservice.DefaultCacheLockingManager.useCache(DefaultCacheLockingManager.java:53)
at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDependencyResolver.resolve(CacheLockingArtifactDependencyResolver.java:37)
at org.gradle.api.internal.artifacts.ivyservice.SelfResolvingDependencyResolver.resolve(SelfResolvingDependencyResolver.java:41)
at org.gradle.api.internal.artifacts.ivyservice.ShortcircuitEmptyConfigsArtifactDependencyResolver.resolve(ShortcircuitEmptyConfigsArtifactDependencyResolver.java:46)
at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver.resolve(ErrorHandlingArtifactDependencyResolver.java:39)
at org.gradle.api.internal.artifacts.ivyservice.DefaultConfigurationResolver.resolve(DefaultConfigurationResolver.java:42)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveNow(DefaultConfiguration.java:240)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getResolvedConfiguration(DefaultConfiguration.java:230)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getResolvedConfiguration(Unknown Source)
at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:459)
... 87 more
BUILD FAILED
Total time: 1.088 secs
We tried a local build of a.j.i however gradle failed to find the jar/pom int he local repository as well. same error :-(
When using the OptionsBuilder and AttributesBuilder classes to define options and attributes, respectively, it's necessary to call "asMap()" when passing the result to the Asciidoctor API.
For example:
asciidoctor.render(source, OptionsBuilder.options().safe(SafeMode.SAFE).asMap());
We should hide this detail from the client.
One solution is to overload the Asciidoctor API methods to accept the builder types. The implementation would immediately call asMap()
to select the state of the collection at the time of the call.
public String render(String content, OptionsBuilder options) {
return render(content, options.asMap());
}
With the addition of this method, it's possible to drop the explicit call to asMap()
in the client code:
asciidoctor.render(source, OptionsBuilder.options().safe(SafeMode.SAFE));
Another (less elegant) solution, would be to have the builder types implement Map. However, my instinct tells me that's not a good option.
Promote indent attribute. Related with issue asciidoctor/asciidoctor#365
Allow attributes argument of render/load APIs to be a string or array, related with asciidoctor/asciidoctor#289
Add icons, iconsdir and scriptsdir attributes. Icons attribute can be set or unset, but also a String can be provided.
The baseDir
is a very important security feature of Asciidoctor. In all safe mode levels, it establishes the working directory. In safe mode levels SERVER and above, it establishes a jail that restricts the processor from seeing files in directories outside that path. Without this jail, the safe mode control has reduced capacity.
Given the importance of this option, it should be promoted as a named option in the OptionsBuilder fluent API. We should also recommend its usage in the docs. When Asciidoctor is run from Java, especially in a Servlet environment, the base directory is often not what the developer expects it to be. It is a very good practice to establish the base directory, regardless of safe mode level.
In order to use this project as a dependency of other projects, artifact should be released to Maven Central Repo
Add a method which renders a collection of files.
Add copycss attribute to Attribute class.
Promote numbered attribute to Attribute class.
Register project to Travis CI in order to have project integrated with a Continuous Integration system.
java.io.File#listFiles can returns null
org.asciidoctor.DirectoryWalker#walkDirectory is not protected against it
Caused by: java.lang.NullPointerException
at org.asciidoctor.DirectoryWalker.walkDirectory(DirectoryWalker.java:38)
at org.asciidoctor.DirectoryWalker.scan(DirectoryWalker.java:28)
at org.asciidoc.maven.AsciidoctorMojo.scanSourceFiles(AsciidoctorMojo.java:143)
at org.asciidoc.maven.AsciidoctorMojo.execute(AsciidoctorMojo.java:123)
at org.asciidoc.maven.AsciidoctorRefreshMojo.executeAndReturnDuration(AsciidoctorRefreshMojo.java:135)
at org.asciidoc.maven.AsciidoctorRefreshMojo.doWork(AsciidoctorRefreshMojo.java:81)
at org.asciidoc.maven.AsciidoctorHttpMojo.doWork(AsciidoctorHttpMojo.java:27)
at org.asciidoc.maven.AsciidoctorRefreshMojo.execute(AsciidoctorRefreshMojo.java:63)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
... 20 more
Change renderFile argument to File instead of String, so user is will not be confused between using render or renderFile method.
Adding a Main class to the Asciidoctor Java integration would make it possible to run Asciidoctor from the commandline without ever having to install Ruby.
This Main class should accept all the arguments that the asciidoctor
command accepts. It could parse the options directly or pass them to the Asciidoctor::Cli::Options class for parsing.
The Main class should be specified in the JAR so that a user can execute the Asciidoctor Java integration as an application. For example:
java -jar asciidoctor-java-integration.jar -b html5 -a toc sample.adoc
See http://asciidoctor.org/man/asciidoctor for a list of arguments.
We also might want to provide a shell script named asciidoctorj
that wraps the java -jar
command and makes it feel more like commandline tool.
when I do
ad.render(astring);
image::mypicture.png
are not rendered - it is just passed through.
My guess it is because it cannot find the file...how do I tell asciidoctor which "dir" context the string should be rendered in ?
or even better could it provide a callback and let me resolve the locations ?
By default Asciidoctor renders only the specified Asciidoctor file. Adding a full scan of directory and subdirectories of all asciidoctor files and render them could be a feature that shall be useful for large projects where documentation can be spread across different directories.
When running on windows ( asciidoctor-maven-plugin), I receive the following issue
Caused by: org.jruby.exceptions.RaiseException: (IOError) target directory does not exist: C:/opensource/StatelessPrime/angularJS/AngularPrime/trunk/C:/opensource/StatelessPrime/angularJS/AngularPrime/trunk/C:/opensource/StatelessPrime/angularJS/AngularPrime/trunk/target/generated-docs
at RUBY.render(jar:file:c:/maven_repository/org/asciidoctor/asciidoctor-java-integration/0.1.2/asciidoctor-java-integration-0.1.2.jar!/gems/asciidoctor-0.1.2/lib/asciidoctor.rb:811)
While doing some work on the gradle plugin we swutched back and forth between render() and renderFile() without changing the value of the first argument. Of course we got a weird error when calling renderFile() as rhe filename did not exist (arg vale was asciidoc content). However, if the first arg was a File the IDE wouls had told us immediately.
Implementing a better way to setting parameters to Asciidoctor instead of /apart from a Map.
Adding Options and Attributes POJO to set Asciidoctor configuration so users can create configuration options from a Map or from a POJO.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.