Skip to content

symball/excemplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Excemplate

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Maintainers

About The Project

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

(back to top)

Built With

(back to top)

Getting Started

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.

Usage

# 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

Installation

The regular Go compile can be used if you are only intending to run the application on your architecture

go build -o excemplate .

Testing

The library code is located in the lib path; the rest of the code is Cobra boilerplate

go test ./lib

Compiling for targeted architecture

# 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 .

(back to top)

Usage

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

Sheet Control (optional)

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 for
  • Starting Row - Row to start writing data from

Template

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 section
  • Content - 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

Things To Generate

Items that are to be generated.

  • Template - Template to use
  • Output 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

(back to top)

Maintainers

An up-to-date list of people involved with development / support of the project

Simon Ball - contact@simonball.me

(back to top)

About

A simple and performant templating engine for working with Excel files.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages