hledger: update
This commit is contained in:
parent
272b6e6803
commit
0a92558c44
|
@ -0,0 +1,49 @@
|
||||||
|
---
|
||||||
|
title: Blessed
|
||||||
|
category: JavaScript libraries
|
||||||
|
---
|
||||||
|
|
||||||
|
## Screen
|
||||||
|
|
||||||
|
```js
|
||||||
|
screen = blessed.screen({
|
||||||
|
smartCSR: true // optimize for flickering
|
||||||
|
autoPadding: true // ..
|
||||||
|
})
|
||||||
|
|
||||||
|
screen.append(Element)
|
||||||
|
screen.destroy()
|
||||||
|
|
||||||
|
screen.width
|
||||||
|
screen.height
|
||||||
|
screen.title = 'My window title'
|
||||||
|
screen.key(['escape', 'q', 'C-c'], (ch, key) => { ... })
|
||||||
|
```
|
||||||
|
|
||||||
|
## Element
|
||||||
|
|
||||||
|
```js
|
||||||
|
box = blessed.box({
|
||||||
|
style: { fg, bg, border.fg, scrollbar.bg, focus.bg, hover.bg },
|
||||||
|
border: { type: 'line'|'bg', bg, fg, bold, underline }
|
||||||
|
tags: true, // parse {bold}tags{/bold}
|
||||||
|
|
||||||
|
top, left, width, height,
|
||||||
|
width: '100%',
|
||||||
|
height: '100%-1',
|
||||||
|
top: 'center'
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
## Tags
|
||||||
|
|
||||||
|
```
|
||||||
|
{bold}
|
||||||
|
{right} {center}
|
||||||
|
{|} left-right separator
|
||||||
|
{#c0ff33-fg}{/}
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
blessed.escape('...')
|
||||||
|
```
|
70
hledger.md
70
hledger.md
|
@ -13,15 +13,16 @@ hledger accounts --tree
|
||||||
## Reporting
|
## Reporting
|
||||||
|
|
||||||
```
|
```
|
||||||
hledger {bal|reg} {interval} {range} {query}
|
hledger {bal|reg} {interval} {period} {query}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Query
|
### Query
|
||||||
|
Used on all commands (`bal`, `reg`, etc).
|
||||||
|
|
||||||
```
|
```
|
||||||
Assets ; An account
|
Assets ; An account (regex)
|
||||||
^Assets ; Starting with Assets
|
acct:Assets ; same
|
||||||
acct:Assets ; account by regex
|
^Assets ; Starting with Assets (eg, not 'Expenses:Assets')
|
||||||
inacct:'A:B' ; transactions related to account
|
inacct:'A:B' ; transactions related to account
|
||||||
|
|
||||||
acctonly:A ; no subaccounts
|
acctonly:A ; no subaccounts
|
||||||
|
@ -38,7 +39,7 @@ code:REGEX
|
||||||
cur:'\$'
|
cur:'\$'
|
||||||
depth:N ; --depth 2
|
depth:N ; --depth 2
|
||||||
tag:REGEX
|
tag:REGEX
|
||||||
not:...
|
not:... ; eg, not:status:!
|
||||||
```
|
```
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -49,6 +50,7 @@ status: ; --uncleared
|
||||||
```
|
```
|
||||||
|
|
||||||
### Intervals
|
### Intervals
|
||||||
|
Used on all commands (`bal`, `reg`, etc). Displays in multi-column mode. In `ledger-cli`, only `reg` is supported. Can also specified via `-p` (period).
|
||||||
|
|
||||||
```
|
```
|
||||||
-D, --daily
|
-D, --daily
|
||||||
|
@ -58,21 +60,17 @@ status: ; --uncleared
|
||||||
-Y, --yearly
|
-Y, --yearly
|
||||||
```
|
```
|
||||||
|
|
||||||
### Range
|
### Periods
|
||||||
|
|
||||||
```
|
```
|
||||||
-p, --period=...
|
|
||||||
date:2015/01/01
|
date:2015/01/01
|
||||||
date:2015/01/01- ; -b, --begin
|
date:2015/01/01- ; -b, --begin
|
||||||
date:-2015/01/01 ; -e, --end
|
date:-2015/01/01 ; -e, --end
|
||||||
date2:PERIODEXPR
|
date2:PERIODEXPR
|
||||||
```
|
```
|
||||||
|
|
||||||
### Periods
|
|
||||||
|
|
||||||
```
|
```
|
||||||
-p, --period=...
|
-p, --period=...
|
||||||
|
|
||||||
-p "2009/01/01"
|
-p "2009/01/01"
|
||||||
-p "2009/01/01 to 2009/12/31"
|
-p "2009/01/01 to 2009/12/31"
|
||||||
-p "2009/01/01to2009/12/31" ; spaces optional
|
-p "2009/01/01to2009/12/31" ; spaces optional
|
||||||
|
@ -82,39 +80,43 @@ date2:PERIODEXPR
|
||||||
-p "weekly 2009/01/01 to 2009/12/31"
|
-p "weekly 2009/01/01 to 2009/12/31"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Balance
|
## Display formats
|
||||||
|
|
||||||
|
```
|
||||||
|
--tree # only in bal
|
||||||
|
--flat
|
||||||
|
|
||||||
|
--depth 2 # collapse those under this depth
|
||||||
|
--drop 1 # drop top-level accounts
|
||||||
|
-B, --cost # convert to default currency
|
||||||
|
-E, --empty # don't strip out $0 accounts
|
||||||
|
--date2 # use date2 when available
|
||||||
|
```
|
||||||
|
|
||||||
|
## Multi-column mode
|
||||||
When used with intervals (like `--weekly`):
|
When used with intervals (like `--weekly`):
|
||||||
```
|
|
||||||
--cumulative # show ending balance per period
|
|
||||||
--historical # like --cumulative but only for --begin
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
```
|
||||||
--tree
|
-T, --row-total
|
||||||
|
-N, --no-total
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Also: (only in `bal`)
|
||||||
|
|
||||||
|
```
|
||||||
|
--cumulative # show ending balance per period
|
||||||
|
-I, --historical # like --cumulative but only for --begin
|
||||||
|
-A, --average
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
### Format
|
### Format
|
||||||
|
|
||||||
```
|
```
|
||||||
--format "%20(account) %12(total)
|
--format "%20(account) %12(total)
|
||||||
```
|
```
|
||||||
|
|
||||||
## Register
|
## See also
|
||||||
|
|
||||||
|
* <http://hledger.org/manual.html>
|
||||||
## Querying
|
* <http://ledger-cli.org/3.0/doc/ledger3.html>
|
||||||
|
|
||||||
```
|
|
||||||
acct:REGEX
|
|
||||||
amt:N
|
|
||||||
amt:<N (and <=, >, >=)
|
|
||||||
code:REGEX
|
|
||||||
cur:'\$'
|
|
||||||
desc:REGEX
|
|
||||||
date:PERIODEXPR
|
|
||||||
date2:PERIODEXPR
|
|
||||||
depth:N
|
|
||||||
tag:REGEX
|
|
||||||
not:
|
|
||||||
```
|
|
||||||
|
|
|
@ -81,4 +81,4 @@ category: Vim
|
||||||
.all table tr:first-child td { font-size: 1.3em; padding-bottom: 0; }
|
.all table tr:first-child td { font-size: 1.3em; padding-bottom: 0; }
|
||||||
.all table tr:first-child+tr td { font-size: 0.9em; color: dodgerblue; border-top: 0; padding-top: 0; font-family: fira mono, monospace; }
|
.all table tr:first-child+tr td { font-size: 0.9em; color: dodgerblue; border-top: 0; padding-top: 0; font-family: fira mono, monospace; }
|
||||||
.all table em { color: #aaa; font-size: 0.9em; font-style: normal; font-family: roboto, sans-serif; }
|
.all table em { color: #aaa; font-size: 0.9em; font-style: normal; font-family: roboto, sans-serif; }
|
||||||
</sytle>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue