ledger2html icon indicating copy to clipboard operation
ledger2html copied to clipboard

Process Ledger output to produce HTML5 reports.

Ledger2html

Ledger2html is a simple Ruby script that helps you obtain beautiful HTML5 reports from Ledger output.

Requirements

  • Ledger 3.0
  • Ruby 1.8.7 (Ruby 2.0.0 or later recommended)

Synopsis

Usage: ledger2html <options> <ledger options>
Options:
    -h, --help                       Show this help message and exit.
    -o, --output  <path>             Save the report to a file.
        --pre                        Use <pre> instead of <table> to wrap Ledger's output.
        --style   <path>             Path to a CSS file (this option can be used multiple times).
        --title   <title>            Title of the report.
        --version                    Print ledger2html version and exit.
        --debug                      Enable debugging.

Examples

A sample register report:

ledger2html -f drewr3.dat reg groceries
Date Payee Amount Balance
10-Dec-20Organic Co-op$ 37.50$ 37.50
$ 37.50$ 75.00
$ 37.50$ 112.50
$ 37.50$ 150.00
$ 37.50$ 187.50
$ 37.50$ 225.00
11-Jan-02Grocery Store$ 65.00$ 290.00
11-Jan-19Grocery Store$ 44.00$ 334.00

A sample cash flow report:

ledger2html -f drewr3.dat bal --dc --related checking
Debit Credit Balance
$ 300.00$ 5,500.00$ -5,200.00
0$ 1,000.00$ -1,000.00
$ 6,634.000$ 6,634.00
0$ 2,030.00$ -2,030.00
$ 200.000$ 200.00
$ 7,134.00$ 8,530.00$ -1,396.00