转载请注明出处: 子恒博客
工具介绍
该工具是nodejs环境下的一个命令行工具,可以根据word模板和一个json数据文件来导出对应的word。命令行工具可以结合各种语言来进行批量的word导出工作。
该项目依赖了docxtemplater,下面是docxtemplater的介绍
docxtemplater is a mail merging tool that is used programmatically and handles conditions, loops, and can be extended to insert anything (tables, html, images).
docxtemplater uses JSON (Javascript objects) as data input, so it can also be used easily from other languages. It handles docx but also pptx templates.
It works in the same way as a templating engine.
docxtemplater官方自带的cli不可用(至少我这里运行不了)。所以自己写了一个,需要的可以试试。
安装
使用npm或yarn安装
# npm
npm i -g docxtpl-cli
# yarn
yarn global add docxtpl-cli
使用说明
> docxtpl // 可查看使用说明和版本号
> docxtpl input.docx data.json output.docx 将input.docx模版,根据data.json的数据,转换成output.docx
word模板制作可参考 docxtemplater文档
扫描二维码,在手机上阅读
上一篇
emlog 添加自定义钩子
下一篇
upg程序源码升级包制作工具
您可能对以下文章感兴趣
😂fenxi.me这个域名真好
#友情链接#
你写得非常清晰明了,让我很容易理解你的观...
#Emlog插件RSS订阅器发布#
@樊鑫:不支持,仅支持pro版本,可以在...
#Beginning-Pro发布,Emlog-Pro + Beginning-Pro, 更Pro#
支持5.3吗?在哪里购买/下载?
#Beginning-Pro发布,Emlog-Pro + Beginning-Pro, 更Pro#
@叽叽:开源了的,https://git...
#vue.js组件之手写签名板vue-signature-simple#
那个demo开源了吗
#vue.js组件之手写签名板vue-signature-simple#