【问题标题】:Enable rendering asciidoc operation in InteliJ Idea在 IntelliJ Idea 中启用渲染 asciidoc 操作
【发布时间】:2019-07-24 15:31:43
【问题描述】:

在 InteliJ Idea 中使用 spring-restdocs 记录 rest api 很好,但我错过了 operation 宏的渲染“包含”sn-ps。

== Get Comments sorted

To get sorted according single attribute and with no specific ordering (asc-ending is default), you can refer to this example:

operation::comments/getSortedDescending[snippets='http-request,path-parameters,http-response']

我希望通过 asciidoctor 插件在 InteliJ Idea 中渲染事物时,我可以以某种方式启用 spring-restdocs-asciidoc artefact。

相关问题https://github.com/asciidoctor/asciidoctor-intellij-plugin/issues/310

【问题讨论】:

标签: intellij-idea asciidoc asciidoctor spring-restdocs


【解决方案1】:

我看过 spring-restdocs-asciidoctor。 The operation::[] is an extension 呈现内容。它依赖于需要设置的属性snippets

用于 AsciiDoc 的 IntelliJ 插件支持 ruby extensionsattributes for previews 作为实验选项。

为了让它发挥作用,我做了以下工作:

  • 签出项目
  • 运行 gradlew asciidoctor 以生成 sn-ps
  • 添加文件.asciidoctorconfig设置生成的sn-ps的路径
  • 添加目录.asciidoctor并将扩展名放在该目录中
  • 在 IDE 中确认警告消息“此项目包含 Asciidoctor 扩展...”

每次重新启动 IDE 时都需要确认警告消息。由于它将在本地运行 Ruby 代码,因此这是一个安全问题。也许我们将来会对其进行增强,因此您只需在扩展程序的代码更改后重新确认即可。

更改位于以下分支:https://github.com/ahus1/spring-restdocs/tree/poc_extension_intellij

【讨论】:

  • 它还支持Java扩展,你必须将JAR文件复制到.asciidoctor/lib。在上周末,我正在尝试将 Jamal 预处理集成到 IntelliJ Asciidoc 插件中,它工作正常。
猜你喜欢
  • 2013-09-23
  • 1970-01-01
  • 2011-04-12
  • 2019-12-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-01-12
  • 1970-01-01
相关资源
最近更新 更多