前言

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

Asciidoc是个啥?

看着个介绍吧:https://my.oschina.net/gudaoxuri/blog/524132

怎么编辑Asciidoc

使用AsciidocFX编辑Asciidoc。https://github.com/asciidocfx/AsciidocFX

语法参考

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

怎么将Asciidoc转换成html、pdf或者…?

  • 官方说,大多数Linux发行版都带有转换工具。如果你在用linux,那参考相关的手册即可。
  • 用windows的话,图形化的工具可以参考。AsciidocFX就不错。
  • windows下想用命令行转换的话,可以使用asciidoctor(https://asciidoctor.org)。asciidoctor是ruby开发的,安装ruby后,可以起飞。
  • 如果熟练maven的话,用maven也可以在windows下进行转换。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
有啥不明白的,参考一下示例吧。

给个测试过的示例:
当目录结构是下面这样的时候

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>

注:这个pom.xml在eclipse中会有下面这样的报错。不理报错就好了。

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官网

http://asciidoc.org/

【maven插件】asciidoctor-maven-plugin:编译Asciidoc相关推荐

  1. maven插件打包exec_Exec Maven插件–从Maven Build运行Java程序

    maven插件打包exec Maven exec plugin allows us to execute system and Java programs from the maven command ...

  2. maven插件_Apache Maven WAR Plugin_用overlays合并多个war

    转: http://kyfxbl.iteye.com/blog/1678121 在一个大项目中拆分maven工程时,很有可能会把js.css.jsp等文件放在不同的工程里(根据业务模块划分).因为如果 ...

  3. sonarqube通过sonarqube maven插件分析maven工程使用的mvn命令示例

    mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package -T 1C -Dmaven.test.skip=true -Dmaven. ...

  4. dojo还有人用吗_我的Dojo中有一个Mojo(如何编写Maven插件)

    dojo还有人用吗 我一直忙于在工作中使用Maven的腋窝. 对于很多开发人员,我会听到:"那又怎样." 区别在于,我通常在无法直接访问Internet的环境中工作. 因此,当我说 ...

  5. 我的Dojo中有一个Mojo(如何编写Maven插件)

    我一直忙于在工作中使用Maven的腋窝. 对于很多开发人员,我会听到:"那又怎样." 不同之处在于,我通常在无法直接访问Internet的环境中工作. 因此,当我说我经常使用Mav ...

  6. 自定义maven插件

    文章目录 maven插件介绍 自定义插件 使用 运行 maven插件介绍 maven插件有很多的作用,maven插件简介 说个用的比较多的,就是jetty插件,通过配置jetty可以通过插件一键运行代 ...

  7. maven插件-及插件的使用

    官方文档请参考:https://maven.apache.org/plugins/ Maven插件分类 maven中有两种插件:build和reporting: build:在构建期间运行,配置在bu ...

  8. proguard+springboot+maven插件 代码混淆

    一 背景 Java web项目部署到服务器上以后,尤其针对是在客户的服务器上部署,很容易被"友商"捞到相关的包,通过反编译的手段,我们的代码几乎等同于裸奔在不可管控的服务器上,产品 ...

  9. 构建maven项目插件_如何构建一个Maven插件

    构建maven项目插件 使用Okta的身份管理平台轻松部署您的应用程序 使用Okta的API在几分钟之内即可对任何应用程序中的用户进行身份验证,管理和保护. 今天尝试Okta. 由于其插件生态系统的普 ...

最新文章

  1. 实战|基于图割算法的木材表面缺陷图像分析
  2. MapReduce编程实战之“初识”
  3. IDEA出现错误:找不到或无法加载主类 io.renren.RenrenApplication
  4. 【Tiny4412】烧写最小文件系统到SD卡
  5. Python 爬虫知识点 - 淘宝商品检索结果抓包分析(续一)
  6. preparedstatement打印sql语句_Mybatis是这样防止sql注入的
  7. 台达伺服电机选型手册_机械加工工艺师手册_打包下载
  8. AnimalTFDB 3.0 | 动物转录因子注释和预测的综合资源库
  9. 9.jsonp的实现原理
  10. mac使用allure_制作测试报告,allure,生成
  11. Spark —— RDD、DataFrame 与 Dataset
  12. 陈希孺《概率论与数理统计》读书笔记
  13. 遗传算法 matlab实现 多维变量 二进制编码
  14. mysql 取汉字笔划数_PHP获取汉字笔画数功能【测试可用】
  15. 7、STC12C5A60S2核心芯片说明文档
  16. 智课雅思词汇---八、ject是什么意思
  17. python倒数切片_python切片
  18. Microsoft Visual C++ Runtime Library Runtime Error的一个解决方法
  19. SAP—IDoc操作步骤
  20. java虚拟机JVM内存不够,OutOfMemorry Error

热门文章

  1. iOS开发之自定义弹出的键盘
  2. EhCache的配置
  3. 清除webbrowser cookie/session的6种方法
  4. Spring MapFactoryBean例子
  5. ORACLE查出表所有的触发器及触发器详细信息
  6. ORACLE SQL:经典查询练手第一篇
  7. pandas to_dict 的用法
  8. MySQL的distinct:去重
  9. MySQL的show processlist:正在运行的线程
  10. Go的testing包数据类型M/T/B/PB