ruby - 如何配置 asciidoctor-gradle-plugin 来处理 plantuml?

标签 ruby gradle plantuml asciidoctor

我不懂任何 Ruby,但我喜欢 asciidoctor(和 gradle 插件)。有没有简单的方法让插件生成plantuml图表?

我看了基本asciidoctor-diagrams似乎特定于使用 native/ruby asciidoctor 扩展的功能(我没有也不想安装,因为我喜欢使用 gradle 插件)。

干得漂亮asciidoctor-gradle-plugin文档页面显示它接受 Ruby 模块的 requires 选项,但在 Ruby 中没有任何基础,我不确定这是否是我需要的。

我尝试了阻力最小的路径,即:

asciidoctor {
    logDocuments = true
    separateOutputDirs = false
    sourceDir = file("src")
    outputDir = file("$buildDir/html")
    backends = [ 'html5' ]
    requires "asciidoctor-diagram"
}

针对我的基本 plantuml 测试:

.The PlantUML block extension class
[plantuml, sample-plantuml-diagram, alt="Class diagram", width=135, height=118]
----
class BlockProcessor
class PlantUmlBlock
BlockProcessor <|-- PlantUmlBlock
----

但是得到了:

* What went wrong:
Execution failed for task ':asciidoctor'.
> (LoadError) no such file to load -- asciidoctor-diagram

在配置阶段。

如何配置 asciidoctor-gradle-plugin 来处理 plantuml?

最佳答案

mrhaki to the rescue.我不想完全抄袭他的帖子,但万一链接变坏,gradle 文件中需要满足许多其他依赖项,第一个我没有的是 com. github.jruby-gradle:jruby-gradle-plugin:0.1.5 然后他应用了两个插件,包括 com.github.jruby-gradle.base 并且依赖于 ruby​​ gems (rubygems:asciidoctor-diagram:1.2.0)。我认为他的博客网站非常可靠,所以我不会详细介绍。

关于ruby - 如何配置 asciidoctor-gradle-plugin 来处理 plantuml?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28889458/

相关文章:

ruby - 为什么 Ruby Net::HTTP.get_response 和 Net::HTTP.new(uri.host).request 返回不同的东西?

java - 了解gradle.properties和java-opts

java - 以编程方式将 Jersey REST 服务附加到 Jetty

java - Gradle无法在命令行中构建Android Project,Aapt失败

plantuml - PlantUML 中的网络图未按预期工作?

plantuml - 是否可以在 plantUML 中为 UML 项目使用自定义图像?

plantuml : grouping sequence makes actor appears

ruby-on-rails - 通过更改 html( Bootstrap 轮播)来 Rails 每种方法

ruby - ruby 中是否有 SOAP::Lite 等效库?

ruby - Capistrano错误: could not connect to ssh-agent