https://github.com/erdos/stencil
templating engine for DOCX and PPTX files
https://github.com/erdos/stencil
docx ooxml ooxml-parser pptx template-engine
Last synced: 3 months ago
JSON representation
templating engine for DOCX and PPTX files
- Host: GitHub
- URL: https://github.com/erdos/stencil
- Owner: erdos
- License: epl-2.0
- Created: 2018-02-07T20:04:10.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2025-10-07T19:57:24.000Z (3 months ago)
- Last Synced: 2025-10-21T23:46:53.083Z (3 months ago)
- Topics: docx, ooxml, ooxml-parser, pptx, template-engine
- Language: Clojure
- Homepage: https://stencil.erdos.dev
- Size: 1.5 MB
- Stars: 125
- Watchers: 3
- Forks: 13
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Stencil Template Engine
Stencil is an open source templating engine that transforms Office Open XML documents (mostly Microsoft
Office's Word `.docx` files) from the JVM. It has a simple syntax and no programming is needed to write document templates.

You can use either Microsoft Word or LibreOffice to edit the document templates.
The template expressions are just simple textual expressions, and you can even colour-code
them to make your template more readable.
[](https://clojars.org/io.github.erdos/stencil-core)

[](https://codecov.io/gh/erdos/stencil)
[](https://github.com/erdos/stencil/issues)
[](https://hits.seeyoufarm.com)
[](https://www.eclipse.org/legal/epl-2.0/)
## Features
- 📄 **Multiple Formats:** Works with `docx` and `pptx` files
- 💻 **Simple syntax:** For value substitution, conditional and repeating blocks
- 🔧 **Extendable:** Dozens of [built-in functions](https://stencil.erdos.dev/Functions.html) callable from the template
- 📰 **Dynamic content:** Substituting HTML text for dynamic text formatting
- 🌄 **Images and links:** Dynamically replace images and links in the template
- 👀 **Tables:** Show/hide rows and columns in tables
- 📐 **Programmable:** Offers API for Java and Clojure. Deployable as a Docker container.
## 📖 Getting Started with the Library
- See the [Example templates](examples)
- Read the [Documentation](https://stencil.erdos.dev)
- Reference the [Java API](docs/GettingStarted.md#java-api) and the [Clojure API](docs/GettingStarted.md#clojure-api).
## 🐳 Getting Started with the Service
The project has a simple [service implementation](https://github.com/erdos/stencil/tree/master/service), which is available on GitHub Packages as a [Container image](https://github.com/users/erdos/packages/container/package/stencil).
## 👉 Version
**Latest stable** version is `0.6.6`
**Latest snapshot** version is `0.6.7-SNAPSHOT`
Previous versions are available on the [Stencil Clojars](https://clojars.org/io.github.erdos/stencil-core) page.
For Java with Maven
If you are using Maven, add the followings to your `pom.xml`:
1. The dependency:
``` xml
io.github.erdos
stencil-core
0.6.6
```
2. And the [Clojars](https://clojars.org) repository:
``` xml
clojars.org
https://repo.clojars.org
```
For Java with Gradle
Add to the `dependencies` section of your `build.gradle` file: `implementation('io.github.erdos/stencil-core:0.6.6')`
For Clojure with Leiningen
If you are using Leiningen, add the following to the `:dependencies` section of your `project.clj` file:
`[io.github.erdos/stencil-core "0.6.6"]`
For Clojure with deps.edn
Add `io.github.erdos/stencil-core {:mvn/version "0.6.6"}`
## 😎 License
Copyright (c) Janos Erdos. All rights reserved. The use and distribution terms
for this software are covered by the Eclipse Public License 2.0
(https://www.eclipse.org/legal/epl-2.0/) which can be found in the file
`LICENSE.txt` at the root of this distribution. By using this software in any
fashion, you are agreeing to be bound by the terms of this license. You must not
remove this notice, or any other, from this software.