ledger2html
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 | Account | Amount | Balance | |
---|---|---|---|---|---|
10-Dec-20 | Organic Co-op | Expenses:Food:Groceries | $ 37.50 | $ 37.50 | |
Expenses:Food:Groceries | $ 37.50 | $ 75.00 | |||
Expenses:Food:Groceries | $ 37.50 | $ 112.50 | |||
Expenses:Food:Groceries | $ 37.50 | $ 150.00 | |||
Expenses:Food:Groceries | $ 37.50 | $ 187.50 | |||
Expenses:Food:Groceries | $ 37.50 | $ 225.00 | |||
11-Jan-02 | Grocery Store | Expenses:Food:Groceries | $ 65.00 | $ 290.00 | |
11-Jan-19 | Grocery Store | Expenses:Food:Groceries | $ 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 | Assets |
0 | $ 1,000.00 | $ -1,000.00 | Equity |
$ 6,634.00 | 0 | $ 6,634.00 | Expenses |
0 | $ 2,030.00 | $ -2,030.00 | Income |
$ 200.00 | 0 | $ 200.00 | Liabilities |
$ 7,134.00 | $ 8,530.00 | $ -1,396.00 |