asciidoc html java_gradle asciidoc 使用
备注: 主要说明asciidoc 代码
src/docs 主要是文档以及需要的图片资源
└── asciidoc
├── chapters
├── images
└── styles
├── epub
│ └── fonts
└── fonts
build.gradle gradle 构建 task
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.github.ben-manes:gradle-versions-plugin:0.15.0'
classpath 'com.bluepapa32:gradle-watch-plugin:0.1.5'
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.3'
classpath 'org.asciidoctor:asciidoctorj-epub3:1.5.0-alpha.7'
classpath 'org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.16'
classpath 'org.jruby:jruby-complete:9.1.12.0'
}
}
apply plugin: 'java'
apply plugin: 'org.asciidoctor.convert'
apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'com.bluepapa32.watch'
version = '4.1.0-SNAPSHOT'
asciidoctorj {
version = '1.5.6'
}
import org.asciidoctor.gradle.AsciidoctorTask
def attrs = ['sourcedir' : '../../../main/webapp',
'source-highlighter': 'coderay',
'epub3-stylesdir' : './styles/epub',
// NOTE don't include leading ./ because it messes up paths in the epub files
'imagesdir' : 'images',
'toc' : 'left',
'icons' : 'font',
'sectanchors' : '',
'idprefix' : '',
'idseparator' : '-']
tasks.withType(AsciidoctorTask) { task ->
attributes attrs
sources {
include 'index.adoc'
}
}
task html(type: AsciidoctorTask, description: 'Generates single page HTML') {
backends 'html5'
}
// NOTE please use ./generate-pdf.sh instead of this task for now
task prepress(type: AsciidoctorTask, description: 'Generates PDF for prepress printing') {
attributes attrs + ['media' : 'prepress', 'pdfmarks': '', 'pdf-theme': 'infoq-prepress']
attrs.remove('source-highlighter')
requires file('src/main/ruby/asciidoctor-pdf-extensions.rb')
backends 'pdf'
outputDir "$buildDir/asciidoc/pdf-prepress"
separateOutputDirs false
}
// NOTE please use ./generate-pdf.sh screen instead of this task for now
task pdf(type: AsciidoctorTask, description: 'Generates PDF') {
attributes attrs + ['pdfmarks': '']
requires file('src/main/ruby/asciidoctor-pdf-extensions.rb')
backends 'pdf'
}
task epub(type: AsciidoctorTask, description: 'Generates EPUB3') {
backends 'epub3'
}
task mobi(type: AsciidoctorTask, description: 'Generates MOBI') {
backends 'epub3'
attrs.put('ebook-format', 'kf8')
attributes attrs
}
pdf.shouldRunAfter html
epub.shouldRunAfter pdf
//task all(dependsOn: ['html', 'pdf', 'epub', 'mobi'])
task all(dependsOn: ['html', 'epub', 'mobi'])
defaultTasks 'all'
watch {
asciidoc {
files fileTree(dir: 'src/docs/asciidoc', include: '**/*.adoc')
tasks 'asciidoctor'
}
}
asciidoc html java_gradle asciidoc 使用相关推荐
- asciidoc转换html,AsciiDoc:如何指定HTML输出字体?
我是AsciiDoc自己的新手,但这可能足以让你走.不幸的是,在你的AsciiDoc输入文件中似乎没有一种简单的方法来用简单的指令设置自定义样式.最终,AsciiDoc只是include s样式表文件 ...
- 使用Swagger2Markup实现API文档的静态部署(一):AsciiDoc
在阅读本文之前,您先需要了解Swagger的使用,如果您还不知道它是用来干嘛的,请先阅读<Spring Boot中使用Swagger2构建强大的RESTful API文档>一文. 前言 在 ...
- [AsciiDoc]_[项目管理]_[适合写书写需求文档的纯文本轻量级标记语言]
场景 markdown适合写短篇文章,但是不适合写书,需求文档这类复杂多页的文档.有什么文本格式适合写需求文档呢?并且能生成PDF或者docx格式方便阅读? 说明 在阅读gradle的userguid ...
- [Swagger] Asciidoc 配置静态章节
目录 Asciidoc 配置静态章节 MAVEN 静态章节配置 MAVAN命令切换输出方式 Asciidoc InteillJ IDEA Plugin REFRENCES 更多 Asciidoc 配置 ...
- asciidoc_使用AsciiDoc编写文档
asciidoc 我在一个月的午餐中编写" 学习Linux"时发现了AsciiDoc . AsciiDoc是一种用于编写书籍的非常详尽的标记语言-想想Markdown ,但是具有更 ...
- Asciidoc 的嵌入式链接写法
多年以前,有一段时间我对 Asciidoc 很感兴趣,尝试用它起草写了一篇博客文章(为什么我说Rust是靠谱的编程语言),偏偏那是一篇很长的文章(大概有一万字),偏偏里面有大量的超级链接,大量的链接夹 ...
- AsciiDoc Notes
文章目录 1. Add Image Local Network 2. Add Link 3 .Comparison with Markdown 4. Reference 1. Add Image Lo ...
- AsciiDoc 相关资源
实践的.技术写作的未来 乱谈AsciiDoc的书籍编写 快速文本处理和发布工具链 Asciidoctor AsciiDoc 简介 asciidoc.org asciidoctor.org AsciiD ...
- Buildroot文章翻译
OpenWRT文章翻译之(一)----OpenWRT Buildroot简介 原文地址:http://wiki.openwrt.org/about/toolchain Buildroot简介 话说Op ...
最新文章
- “远征记”——从燕郊骑自行车回京
- python的logging模块,记录所发生的异常。
- java web 心跳机制实现,基于javax的websocket服务端实现,含心跳机制
- oracle基础琐碎总结-----Where和Having的区别与联系
- python pickle模块操作
- python绘制直角坐标系_小白学 Python 数据分析(16):Matplotlib(一)坐标系
- 《windows程序设计》第二章学习心得
- Lync server 2010 发布拓扑错误0x80070005
- Data Lake Analytics-数据分析时代迎来新变革
- [转]深入理解Java之线程池
- 让系统在内存中高速运行
- new对象后的代码块(匿名类)
- RBF神经网络和拟合实例
- liinux下安装jdk
- 详解互联网平台的资金系统方案 自建支付清结算系统优势明显
- 在 Linux 终端中自定义 Bash 配色和提示内容
- php7 三元运算 精简
- nacative mysql_分析996个词根在各大考纲词汇中的作用(二)
- 编码电位器c语言程序,360°编码电位器原理
- CSS秘密花园: 沿着路径的动画