Skip to content

Commit

Permalink
more doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
howeyc committed Jan 15, 2022
1 parent 12c5d71 commit 5d8c964
Show file tree
Hide file tree
Showing 14 changed files with 141 additions and 74 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ bin
pkg
dist
html-book
src-book
2 changes: 1 addition & 1 deletion ledger/book/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
authors = ["Chris Howey"]
language = "en"
multilingual = false
src = "src"
src = "src-book"
title = "Guide to Ledger"
description = "Plain Text Accounting"

Expand Down
14 changes: 14 additions & 0 deletions ledger/book/genbook.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/bash

rm -rf src-book
mkdir src-book

pushd src
for SRCFILE in $(find . -name "*.md")
do
mdexec -template='```sh
{{.Output}}```' $SRCFILE > ../src-book/$SRCFILE
done
popd

mdbook build
43 changes: 0 additions & 43 deletions ledger/book/src/02_01_Balance.md

This file was deleted.

1 change: 0 additions & 1 deletion ledger/book/src/02_02_Register.md

This file was deleted.

28 changes: 28 additions & 0 deletions ledger/book/src/02_Balance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Balance

Run `ledger -f ledger.dat bal` to see a balance report.

`$ ledger -f ledger.dat bal`

## Net Worth

You can show specific accounts by applying a filter, which is case senstive.
For example, let's get our net worth,
run `ledger -f ledger.dat bal Assets Liabilities`

`$ ledger -f ledger.dat bal Assets Liabilities`

## By Period

We can see our balances segmented by a time period. For example, let's see all
our expenses for each month,
run `ledger -f ledger.dat --period Monthly bal Expenses`

`$ ledger -f ledger.dat --period Monthly bal Expenses`

## Account Depth

That's a lot of accounts, let's trim it down to see it summed up to the second
level. Run `ledger -f ledger.dat --period Monthly --depth 2 bal Expenses`

`$ ledger -f ledger.dat --period Monthly --depth 2 bal Expenses`
12 changes: 12 additions & 0 deletions ledger/book/src/02_Equity.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Equity

Some users like to keep ledger files for each year. To aid in creating a new
starting balance for the next file, we can use the `ledger equity` command to
generate the required transaction to have the correct starting balances.

Let's start 2021, using all transactions upto the end of 2020. As the end date
on the command line is not included, we can use 2021/01/01 as the end date.

Run `ledger -f ledger.dat equity -e "2021/01/01"`

`$ ledger -f ledger.dat equity -e "2021/01/01"`
24 changes: 24 additions & 0 deletions ledger/book/src/02_Import.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Import

We can import transactions in CSV format, and product ledger transactions.
Transactions are classified using best-likely match based on payee descriptions.
Matches do not need to be exact matches, it's based on probablility determined
by learning from existing transactions. The more existing transactions in your
ledger file, the better the matches will be.

## Example

Example transactions from your credit card csv download.

`$ cat transactions.csv`

Let's run our import, making sure to specify the correct date-format to match
the CSV file.

Run `ledger -f ledger.dat --date-format "01/02/06" import MasterCard transactions.csv`

`$ ledger -f ledger.dat --date-format "01/02/06" import MasterCard transactions.csv`

These are not written to our ledger file, just displayed. Once we are satisfied
with the transactions we can write them to our ledger file by
running `ledger -f ledger.dat --date-format "01/02/06" import MasterCard transactions.csv >> ledger.dat`
16 changes: 16 additions & 0 deletions ledger/book/src/02_Print.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Print

You can print your ledger file in a consistent format. Useful if you want all
transactions to be in a consistent format and your file to always be ordered by
date.

Run `ledger -f ledger.dat print`

`$ ledger -f ledger.dat print`

You can also use this if your splitting off transactions into separate files by
date range, or account.

All 2020 transactions for example `ledger -f ledger.dat -b "2020/01/01" -e "2021/01/01" print`

`$ ledger -f ledger.dat -b "2020/01/01" -e "2021/01/01" print`
27 changes: 27 additions & 0 deletions ledger/book/src/02_Register.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Register

Run `ledger -f ledger.dat reg` to see all transactions in register format.
Since we aren't specifying a specific account, we will get all postings for
all transactions and the running total will sum to zero, as all transactions
balance.

`$ ledger -f ledger.dat reg`

## Payee

Let's see how much money we've spend at the "Grocery Store" each month. Also,
to keep from seeing every posting, we are going to specify that we only want to
see postings in the "Expenses" accounts. This will allow us to easily see a
running total in the last column.

Run `ledger -f ledger.dat reg --payee "Grocery Store" --period Monthly Expenses`

`$ ledger -f ledger.dat reg --payee "Grocery Store" --period Monthly Expenses`

## Accounts

Let's track down all the times we used our Credit Card.

Run `ledger -f ledger.dat reg MasterCard`

`$ ledger -f ledger.dat reg MasterCard`
7 changes: 7 additions & 0 deletions ledger/book/src/02_Stats.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Stats

A nice little summary of various ledger stats is avaible.

Run `ledger -f ledger.dat stats`

`$ ledger -f ledger.dat stats`
25 changes: 1 addition & 24 deletions ledger/book/src/Example.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,5 @@
To make following along and running the commands easier, you can use the
transactions below as your *ledger.dat* file.

```ledger
2020-12-01 Checking balance
Assets:Bank:Checking 1000.00
Equity:Opening Balances
`$ cat ledger.dat`

2020-12-05 Withdrawl
Assets:Bank:Checking -100.00
Assets:Cash:Wallet
2020-12-31 Employer
Assets:Bank:Checking 2000
Income:Salary
2021-01-01 Save
Assets:Bank:Checking -200
Assets:Bank:Savings 200
2021-01-05 Grocery Store
Assets:Bank:Checking
Expenses:Food:Groceries 80.0
2021-01-08 Book Store
Liabilities:MasterCard
Expenses:Books 20.0
```
11 changes: 6 additions & 5 deletions ledger/book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
- [First Run](./01_03_RunningLedger.md)

# CLI Commands
- [Balance](./02_01_Balance.md)
- [Equity]()
- [Import]()
- [Register]()
- [Stats]()
- [Balance](./02_Balance.md)
- [Equity](./02_Equity.md)
- [Import](./02_Import.md)
- [Print](./02_Print.md)
- [Register](./02_Register.md)
- [Stats](./02_Stats.md)

# Web Interface
- [Overview]()
Expand Down
4 changes: 4 additions & 0 deletions ledger/book/src/transactions.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Transaction Date,Description,Amount
02/12/21,Dominoes Pizza HOUSTON TX,12.34
02/23/21,Dominoes Pizza PEARLAND TX,14.34
02/02/21,Half Price Books AUSTIN TX,5.24

0 comments on commit 5d8c964

Please sign in to comment.