From 0a92558c4446a30c2ca803e4062160a66e690a6a Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Thu, 10 Dec 2015 02:19:43 +0800 Subject: [PATCH] hledger: update --- blessed.md | 49 ++++++++++++++++++++++++++++++++++ hledger.md | 70 +++++++++++++++++++++++++------------------------ vim-digraphs.md | 2 +- 3 files changed, 86 insertions(+), 35 deletions(-) create mode 100644 blessed.md diff --git a/blessed.md b/blessed.md new file mode 100644 index 00000000..347efbe1 --- /dev/null +++ b/blessed.md @@ -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('...') +``` diff --git a/hledger.md b/hledger.md index 553f360a..5da52240 100644 --- a/hledger.md +++ b/hledger.md @@ -13,15 +13,16 @@ hledger accounts --tree ## Reporting ``` -hledger {bal|reg} {interval} {range} {query} +hledger {bal|reg} {interval} {period} {query} ``` ### Query +Used on all commands (`bal`, `reg`, etc). ``` -Assets ; An account -^Assets ; Starting with Assets -acct:Assets ; account by regex +Assets ; An account (regex) +acct:Assets ; same +^Assets ; Starting with Assets (eg, not 'Expenses:Assets') inacct:'A:B' ; transactions related to account acctonly:A ; no subaccounts @@ -38,7 +39,7 @@ code:REGEX cur:'\$' depth:N ; --depth 2 tag:REGEX -not:... +not:... ; eg, not:status:! ``` ``` @@ -49,6 +50,7 @@ status: ; --uncleared ``` ### 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 @@ -58,21 +60,17 @@ status: ; --uncleared -Y, --yearly ``` -### Range +### Periods ``` --p, --period=... date:2015/01/01 date:2015/01/01- ; -b, --begin date:-2015/01/01 ; -e, --end date2:PERIODEXPR ``` -### Periods - ``` - -p, --period=... - +-p, --period=... -p "2009/01/01" -p "2009/01/01 to 2009/12/31" -p "2009/01/01to2009/12/31" ; spaces optional @@ -82,39 +80,43 @@ date2:PERIODEXPR -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`): -``` ---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 "%20(account) %12(total) ``` -## Register +## See also - -## Querying - -``` -acct:REGEX -amt:N -amt:, >=) -code:REGEX -cur:'\$' -desc:REGEX -date:PERIODEXPR -date2:PERIODEXPR -depth:N -tag:REGEX -not: -``` +* +* diff --git a/vim-digraphs.md b/vim-digraphs.md index 2b4bc6ac..b29a236a 100644 --- a/vim-digraphs.md +++ b/vim-digraphs.md @@ -81,4 +81,4 @@ category: Vim .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 em { color: #aaa; font-size: 0.9em; font-style: normal; font-family: roboto, sans-serif; } - +