asciidoctor-pdf 可以使用的参数

来源:互联网 发布:淘宝网商城首页 编辑:程序博客网 时间:2024/04/30 09:56

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


它的使用方法为:

[11:38:17]--$ asciidoctor-pdf -hUsage: 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
原创粉丝点击