日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

【maven插件】asciidoctor-maven-plugin:编译Asciidoc

發(fā)布時(shí)間:2024/9/19 编程问答 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【maven插件】asciidoctor-maven-plugin:编译Asciidoc 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

前言

  • maven 3.5.0
  • asciidoctor-maven-plugin 2.0.0-RC.1
  • jdk 1.8
  • eclipse 2019-09 R (4.13.0)

Asciidoc是個(gè)啥?

看著個(gè)介紹吧:https://my.oschina.net/gudaoxuri/blog/524132

怎么編輯Asciidoc

使用AsciidocFX編輯Asciidoc。https://github.com/asciidocfx/AsciidocFX

語法參考

https://asciidoctor.org/docs/asciidoc-syntax-quick-reference/

怎么將Asciidoc轉(zhuǎn)換成html、pdf或者…?

  • 官方說,大多數(shù)Linux發(fā)行版都帶有轉(zhuǎn)換工具。如果你在用linux,那參考相關(guān)的手冊(cè)即可。
  • 用windows的話,圖形化的工具可以參考。AsciidocFX就不錯(cuò)。
  • windows下想用命令行轉(zhuǎn)換的話,可以使用asciidoctor(https://asciidoctor.org)。asciidoctor是ruby開發(fā)的,安裝ruby后,可以起飛。
  • 如果熟練maven的話,用maven也可以在windows下進(jìn)行轉(zhuǎn)換。asciidoctor提供了maven的插件asciidoctor-maven-plugin。

asciidoctor-maven-plugin的使用

asciidoctor官方git地址:https://github.com/asciidoctor/asciidoctor-maven-plugin
asciidoctor示例:https://github.com/asciidoctor/asciidoctor-maven-examples
有啥不明白的,參考一下示例吧。

給個(gè)測(cè)試過的示例:
當(dāng)目錄結(jié)構(gòu)是下面這樣的時(shí)候

pom.xml是這樣的

<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>ethereum_book</groupId><artifactId>ethereum_book</artifactId><version>0.0.1-SNAPSHOT</version><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><maven.compiler.source>1.8</maven.compiler.source><maven.compiler.target>1.8</maven.compiler.target><asciidoctor.maven.plugin.version>2.0.0-RC.1</asciidoctor.maven.plugin.version><asciidoctorj.version>2.1.0</asciidoctorj.version><jruby.version>9.2.8.0</jruby.version></properties><build><defaultGoal>process-resources</defaultGoal><plugins><plugin><groupId>org.asciidoctor</groupId><artifactId>asciidoctor-maven-plugin</artifactId><version>${asciidoctor.maven.plugin.version}</version> <dependencies><!-- Comment this section to use the default jruby artifact provided by the plugin --><dependency><groupId>org.jruby</groupId><artifactId>jruby-complete</artifactId><version>${jruby.version}</version></dependency><!-- Comment this section to use the default AsciidoctorJ artifact provided by the plugin --><dependency><groupId>org.asciidoctor</groupId><artifactId>asciidoctorj</artifactId><version>${asciidoctorj.version}</version></dependency></dependencies><configuration><sourceDirectory>src/docs/asciidoc</sourceDirectory><!-- Attributes common to all output formats --><attributes><endpoint-url>http://example.org</endpoint-url><sourcedir>${project.build.sourceDirectory}</sourcedir><project-version>${project.version}</project-version></attributes></configuration><executions><execution><id>asciidoc-to-html</id><phase>generate-resources</phase><goals><goal>process-asciidoc</goal></goals><configuration><backend>html5</backend><sourceHighlighter>coderay</sourceHighlighter><attributes><imagesdir>./</imagesdir><toc>left</toc><icons>font</icons><sectanchors>true</sectanchors><!-- set the idprefix to blank --><idprefix/><idseparator>-</idseparator><docinfo1>true</docinfo1></attributes></configuration></execution></executions></plugin></plugins></build></project>

注:這個(gè)pom.xml在eclipse中會(huì)有下面這樣的報(bào)錯(cuò)。不理報(bào)錯(cuò)就好了。

Plugin execution not covered by lifecycle configuration: org.asciidoctor:asciidoctor-maven-plugin:2.0.0-RC.1: process-asciidoc (execution: asciidoc-to-html, phase: generate-resources)

參考資料

Asciidoc官網(wǎng)

http://asciidoc.org/

總結(jié)

以上是生活随笔為你收集整理的【maven插件】asciidoctor-maven-plugin:编译Asciidoc的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。