Merge ODT/ODS templates from Clojure data structure
A Clojure wrapper for XDocReport. Works on Open Document Format for Office Applications and Velocity syntax.
Include Kaleidocs/merge in your project.clj
:
(require '[kaleidocs.merge :refer [merge-doc]])
Create ODT/ODS templates with LibreOffice / OpenOffice. Templates are just normal office files with some placeholders typed directly inside. Follow velocity syntax, something like this:
simple-template.odt
:Hello $name!
Now execute from clojure:
(merge-doc "simple-template.odt"
"simple-output.odt"
{:name "World"})
simple-output.odt
should now contain:Hello World!
ODS templates work the same way.
(merge-doc "simple-template.odt"
"simple-output.odt"
;; columns
["developers.Name", "developers.Mail", "developers.LastName"]
;; data
{:project {"Name" "XDocReport"},
"developers"
[{"Name" "ZERR",
"Mail" "angelo.zerr@gmail.com",
"LastName" "Angelo"},
{"Name" "Leclercq",
"Mail" "pascal.leclercq@gmail.com",
"LastName" "Pascal"}]})
More information about creating templates (about XDocReport extension for LibreOffice / OpenOffice, too)
Copyright © 2014 Hoang Minh Thang
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.