Table of Contents
A simple and performant templating engine for working with Excel files.
- Define multiple templates in a convenient manner
- Define items to generator
- Render
This service can either be used as a standalone program or as a library for integrating in to other GoLang applications
If you are not compiling the application for yourself, head to the releases page and download a the terminal client.
If you are going to be making modifications to the application or using it as a library, read on.
# Will create an output.xlsx file in the current working directory
excemplate input.xlsx
# Custom output file
excemplate input.xlsx goforit.xlsx
# See help for more configuration options
excemplate -h
The regular Go compile can be used if you are only intending to run the application on your architecture
go build -o excemplate .
The library code is located in the lib
path; the rest of the code is Cobra boilerplate
go test ./lib
# Mac
GOOS=darwin GOARCH=amd64 go build -o ./excemplate .
# Windows
GOOS=windows GOARCH=amd64 go build -o ./excemplate.exe .
# Linux
GOOS=linux GOARCH=386 go build -o ./excemplate .
The source workbook should have the following sheets (can be configured through Viper) present, see the included example for a working example using default settings
Determines the initial row state to start writing to. Will resort to first blank row otherwise
Sheet Name
- Name of the sheet to setup control forStarting Row
- Row to start writing data from
Define some reusable templates. Each template should start with an identifier name and finish with END
using the first column
Template
- Identifier for the template which will be used in the generator sectionContent
- Columns and rows to be rendered (including the template tags) when generated- Dynamic variables should be defined using the following syntax
{{ .VARIABLE_NAME }}
. More info on variable name in the generators section
- Dynamic variables should be defined using the following syntax
Items that are to be generated.
Template
- Template to useOutput Sheet
- Either use an existing sheet and start writing from the first empty row or, create a new sheet within your workbook
The program will automatically treat any further columns as template variables (identified by the value given in the header row).
- Empty values are allowed and will simply be left empty at runtime
- Variable names should be single words
An up-to-date list of people involved with development / support of the project
Simon Ball - contact@simonball.me