asciidoctor-pdf 可以使用的参数

asciidoctor-pdf是可以把asciidotor文件生成pdf的库


它的使用方法为:

[11:38:17]--$ asciidoctor-pdf -h
Usage: asciidoctor [OPTION]... FILE...
Translate the AsciiDoc source FILE or FILE(s) into the backend output format (e.g., HTML 5, DocBook 4.5, etc.)
By default, the output is written to a file with the basename of the source file and the appropriate extension.
Example: asciidoctor -b html5 source.asciidoc

    -b, --backend BACKEND            set output format backend (default: html5)
    -d, --doctype DOCTYPE            document type to use when converting document: [article, book, manpage, inline] (default: article)
    -o, --out-file FILE              output file (default: based on path of input file); use - to output to STDOUT
        --safe                       set safe mode level to safe (default: unsafe)
                                     enables include macros, but restricts access to ancestor paths of source file
                                     provided for compatibility with the asciidoc command
    -S, --safe-mode SAFE_MODE        set safe mode level explicitly: [unsafe, safe, server, secure] (default: unsafe)
                                     disables potentially dangerous macros in source files, such as include::[]
    -s, --no-header-footer           suppress output of header and footer (default: false)
    -n, --section-numbers            auto-number section titles in the HTML backend; disabled by default
    -e, --eruby ERUBY                specify eRuby implementation to use when rendering custom ERB templates: [erb, erubis] (default: erb)
    -C, --compact                    compact the output by removing blank lines. (No longer in use)
    -a key[=value],key2[=value2],...,
        --attribute                  a list of document attributes to set in the form of key, key! or key=value pair
                                     unless @ is appended to the value, these attributes take precedence over attributes
                                     defined in the source document
    -T, --template-dir DIR           a directory containing custom converter templates that override the built-in converter (requires tilt gem)
                                     may be specified multiple times
    -E, --template-engine NAME       template engine to use for the custom converter templates (loads gem on demand)
    -B, --base-dir DIR               base directory containing the document and resources (default: directory of source file)
    -D, --destination-dir DIR        destination output directory (default: directory of source file)
    -I, --load-path LIBRARY          add a directory to the $LOAD_PATH
                                     may be specified more than once
    -r, --require LIBRARY            require the specified library before executing the processor (using require)
                                     may be specified more than once
    -q, --quiet                      suppress warnings (default: false)
        --trace                      include backtrace information on errors (default: false)
    -v, --verbose                    enable verbose mode (default: false)
    -t, --timings                    enable timings mode (default: false)
    -h, --help                       show this message
    -V, --version                    display the version and runtime environment (or -v if no other flags or arguments)



其中-a参数描述的非常不清楚

通过搜索源码(使用doc.attr()方法读取参数),整理了一下,主要参数包括

pdf-style : 目前提供了两个值,default 和 asciidoctor。可以通过扩展asciidoctor-pdf/data/themes下的YAML文件进行扩展

authors : 可以用该参数替换adoc文件中本来的作者

toc-title : 目录的标题,默认情况下显示“Table of Contents”


实例:

生成含有asciidoc皮肤的pdf,并且显示“目录”

 asciidoctor-pdf -a pdf-style=asciidoctor,toc-title=目录 itembank.adoc



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值