asciidoctor 安装试用
备注:
asciidoctor 是asciidoc 的增强,使用简单,模板比较丰富,对于持续集成方面的开发也是一个不错的工具
1. 安装
a. 环境准备
MRI Ruby 1.8.7, 1.9.3, 2.0, 2.1, 2.2 & 2.3
JRuby 1.7 in Ruby 1.8 and 1.9 modes, 9000
Rubinius 2.2.x
实际上 需要的是ruby jruby ,其他的不是必须的
b. 安装
yum insatll -y ruby
jruby 安装包下载安装
wget https://repo1.maven.org/maven2/org/jruby/jruby-dist/9.1.15.0/jruby-dist-9.1.15.0-bin.tar.gz
后面配置环境变量即可
gem install asciidoctor 如果慢,可以替换 gem 源 gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/
2. 使用
参考源码 https://github.com/mraible/infoq-mini-book.git
实际上只需要src/docs 文件
asciidoctor index.adoc
生成的效果

3. pdf 格式生成
a. 安装插件
gem install asciidoctor-pdf
b. 使用方式
asciidoctor-pdf index.adoc
生成效果

4. docker 使用
a. 镜像拉取
docker pull asciidoctor/docker-asciidoctor
b. 启动
docker run -it -v your directory:/documents/ asciidoctor/docker-asciidoctor
c. 运行生成对应类似文档
已经包含的工具集
asciidoctor asciidoctor-epub3 asciidoctor-revealjs
asciidoctor-confluence asciidoctor-pdf asciidoctor-safe
比如:
pdf: asciidoctor-pdf index.adoc
5. 总结
实际上spring 项目使用asciidoctor 构建的还是比较多的,对于大家在进行微服务以及持续集成中结合
swagger,或者类似的api 文档生活工具,可以方便高效的进行系统的开发设计,提高生产力
6. 参考资料
https://github.com/mraible/infoq-mini-book.git
http://asciidoctor.org/
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)