asciidoctor/asciidoctor-gradle-plugin

Replace {gradle-relative-srcdir} in gradle asciidoctor task configuration

开放

#455 创建于 2019年10月17日

 (4 条评论) (3 个反应) (1 位负责人)Groovy (110 个派生)batch import
5.xenhancementhelp wanted

仓库指标

星标
 (265 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

Hi,

In #292 (v2.2.0) the plugin offered the nifty {gradle-relative-srcdir} attributes, however it can only be used in the documents themselves. I'm thinking that an improvement could be made to post process the attributes configured in the asciidoctor task in order to replace attributes such as {gradle-relative-srcdir} upon processing a (nested) document.

Otherwise it imposes to define in all documents attributes such as highlightjsdir and stylesdir, I'd rather write :

attributes = [
        'snippets'          : snippetsDir,
        'source-highlighter': 'highlight.js',
        'highlightjs-theme' : 'gruvbox-dark',
        'highlightjsdir'    : '{gradle-relative-srcdir}/highlight',
        'stylesheet'        : 'asciidark.css',
        'stylesdir'         : '{gradle-relative-srcdir}',
        'linkcss'           : 'true',
        'encoding'          : 'utf-8'
]

贡献者指南