No commit activity in last 3 years
No release in over 3 years
A command line tool to generate a PDF file from TLF file with command line options.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.15
~> 5.0
~> 0.10
~> 12.0

Runtime

= 0.5.2
= 0.10.0
= 0.8.0
 Project Readme

Version

Thinreports Templete CLI

This command line tool is based on Thinreports.

Installation

$ gem install thinreports-template-cli

Usage

Thinreports Templete CLI is able to receive parameters of text blocks in a TLF (thinreports layout format) file as options of the command line program.

The command supports the following formats:

  • table
  • csv
  • json
  • pdf
$ thinreports-template-cli sample.tlf --help
thinreports-template-cli tlf [options]

Basic Options
        --format=table|csv|json|pdf

Thinreports Layout File Options
        --date=[DATE]                This is a sample date.
        --subject=[SUBJECT]          This is a sample subject.
        --name=[NAME]                This is a sample name.
        --number=[NUMBER]            This is a sample number.
        --date_jp=[DATE_JP]          This is a sample date for Japanese era name.

Datetime Support

  • A option value for a text block of a datetime format is parsed by DateTime#parse.
  • A text block of a datetime format is rendered by the strftime format of DateTime#strftime and era_ja.
  • If a text block of a datetime format does not have a command line option or a default value of a TLF file, this text block will be rendered with Datetime#now.

Examples

Output to a PDF file.

$ thinreports-template-cli sample.tlf --name="Your name" --date="2017-04-01" --format=pdf > sample.pdf

Output to a printer via the lpr command.

$ thinreports-template-cli sample.tlf --name="Your name" --date="2017-04-01" --format=pdf | lpr -P ApeosPort_V_C3375__aa_bb_cc_

License

The gem is available as open source under the terms of the MIT License.

Author

Masayuki Higashino