doc: try making hledger-ui web manual from man page

This commit is contained in:
Simon Michael 2016-02-19 22:42:39 -08:00
parent 2b4cb6b970
commit 269f7afe33
3 changed files with 255 additions and 70 deletions

View File

@ -21,15 +21,34 @@ file format.
hledger is inspired by and largely compatible with ledger(1). hledger is inspired by and largely compatible with ledger(1).
.PP .PP
hledger\-ui is hledger\[aq]s curses\-style interface. hledger\-ui is hledger\[aq]s curses\-style interface.
It reads a hledger journal file (~/.hledger.journal, $LEDGER_FILE, or It reads a hledger journal file
\-f FILE) and provides a simple full\-screen console interface for .PP
viewing account balances and transactions. (~/.hledger.journal, $LEDGER_FILE, or \-f FILE; see hledger(1) or
hledger_journal(5))a
.PP
and provides a simple full\-screen console interface for viewing account
balances and transactions.
.PP
It is simpler and more convenient for browsing than the command\-line It is simpler and more convenient for browsing than the command\-line
interface, but lighter and faster than hledger\-web. interface, but lighter and faster than hledger\-web.
.PP .IP
The journal file is \f[C]~/.hledger.journal\f[], \f[C]$LEDGER_FILE\f[], .nf
or another file specified with \-f. \f[C]
For more about the format, see hledger(1) or hledger_journal(5). $\ hledger\ ui\ \-\-\ \-\-help
hledger\-ui\ [OPTIONS]\ [PATTERNS]
\ \ browse\ accounts,\ postings\ and\ entries\ in\ a\ full\-window\ curses\ interface
Flags:
\ \ \ \ \ \-\-theme=THEME\ \ \ \ \ \ \ \ \ use\ this\ custom\ display\ theme\ (default,\ terminal,
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ greenterm)
\ \ \ \ \ \-\-register=ACCTREGEX\ \ start\ in\ the\ (first)\ matched\ account\[aq]s\ register
\ \ \ \ \ \-\-flat\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ show\ full\ account\ names,\ unindented
\ \ \ \ \ \-\-no\-elide\ \ \ \ \ \ \ \ \ \ \ \ don\[aq]t\ compress\ empty\ parent\ accounts\ on\ one\ line
\ \ \-V\ \-\-value\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ show\ amounts\ as\ their\ market\ value\ in\ their
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ default\ valuation\ commodity\ (accounts\ screen)
\ \ ...
\f[]
.fi
.SH OPTIONS .SH OPTIONS
.PP .PP
Note: if invoking hledger\-ui as a hledger subcommand, write Note: if invoking hledger\-ui as a hledger subcommand, write

View File

@ -2,6 +2,17 @@
% %
% October 2015 % October 2015
<!--
doc generation process:
core docs live in per-package, man-page-structured markdown files like this one
the whole file is used to generate a man page, with filters:
html blocks and inline html are stripped
content between \<!-- USERGUIDE --\> and \<!-- /USERGUIDE --\> is reused for the user guide, with filters:
heading levels are increased (+4)
-->
<div class="manpage">
# NAME # NAME
hledger-ui - curses-style interface for the hledger accounting tool hledger-ui - curses-style interface for the hledger accounting tool
@ -17,15 +28,52 @@ hledger is a cross-platform program for tracking money, time, or any other commo
using double-entry accounting and a simple, editable file format. using double-entry accounting and a simple, editable file format.
hledger is inspired by and largely compatible with ledger(1). hledger is inspired by and largely compatible with ledger(1).
</div>
<div class="userguide">
<style>
.highslide img {max-width:250px; float:right; margin:0 0 1em 1em;}
.highslide-caption {color:white; background-color:black;}
</style>
<a href="images/hledger-ui/hledger-ui-sample-acc2.png" class="highslide" onclick="return hs.expand(this)"><img src="images/hledger-ui/hledger-ui-sample-acc2.png" title="Accounts screen with query and depth limit" /></a>
<a href="images/hledger-ui/hledger-ui-sample-acc.png" class="highslide" onclick="return hs.expand(this)"><img src="images/hledger-ui/hledger-ui-sample-acc.png" title="Accounts screen" /></a>
<a href="images/hledger-ui/hledger-ui-sample-acc-greenterm.png" class="highslide" onclick="return hs.expand(this)"><img src="images/hledger-ui/hledger-ui-sample-acc-greenterm.png" title="Accounts screen with greenterm theme" /></a>
<a href="images/hledger-ui/hledger-ui-sample-txn.png" class="highslide" onclick="return hs.expand(this)"><img src="images/hledger-ui/hledger-ui-sample-txn.png" title="Transaction screen" /></a>
<a href="images/hledger-ui/hledger-ui-sample-reg.png" class="highslide" onclick="return hs.expand(this)"><img src="images/hledger-ui/hledger-ui-sample-reg.png" title="Register screen" /></a>
<!-- <br clear=all> -->
<a href="images/hledger-ui/hledger-ui-bcexample-acc.png" class="highslide" onclick="return hs.expand(this)"><img src="images/hledger-ui/hledger-ui-bcexample-acc.png" title="beancount example accounts" /></a>
<a href="images/hledger-ui/hledger-ui-bcexample-acc-etrade:cash.png" class="highslide" onclick="return hs.expand(this)"><img src="images/hledger-ui/hledger-ui-bcexample-acc-etrade:cash.png" title="beancount example's etrade cash subaccount" /></a>
<a href="images/hledger-ui/hledger-ui-bcexample-acc-etrade.png" class="highslide" onclick="return hs.expand(this)"><img src="images/hledger-ui/hledger-ui-bcexample-acc-etrade.png" title="beancount example's etrade investments, all commoditiess" /></a>
</div>
hledger-ui is hledger's curses-style interface. hledger-ui is hledger's curses-style interface.
It reads a hledger journal file (~/.hledger.journal, $LEDGER_FILE, or -f FILE) and It reads a hledger journal file
provides a simple full-screen console interface for viewing account <div class="manpage">
balances and transactions. It is simpler and more convenient for (~/.hledger.journal, $LEDGER_FILE, or -f FILE; see hledger(1) or hledger_journal(5))a
</div>
and provides a simple full-screen console interface for viewing account balances and transactions.
It is simpler and more convenient for
browsing than the command-line interface, but lighter and faster than browsing than the command-line interface, but lighter and faster than
hledger-web. hledger-web.
The journal file is `~/.hledger.journal`, `$LEDGER_FILE`, or another file specified with -f. ```{.shell .noclear}
For more about the format, see hledger(1) or hledger_journal(5). $ hledger ui -- --help
hledger-ui [OPTIONS] [PATTERNS]
browse accounts, postings and entries in a full-window curses interface
Flags:
--theme=THEME use this custom display theme (default, terminal,
greenterm)
--register=ACCTREGEX start in the (first) matched account's register
--flat show full account names, unindented
--no-elide don't compress empty parent accounts on one line
-V --value show amounts as their market value in their
default valuation commodity (accounts screen)
...
```
# OPTIONS # OPTIONS
@ -204,6 +252,8 @@ This screen will appear if there is a problem, such as a parse error,
when you press g to reload. Once you have fixed the problem described, when you press g to reload. Once you have fixed the problem described,
press g again to reload and restore normal operation. press g again to reload and restore normal operation.
<div class="manpage">
# ENVIRONMENT # ENVIRONMENT
**LEDGER_FILE** **LEDGER_FILE**
@ -233,3 +283,5 @@ visual indication that this is in progress.
The register screen's switching between historic balance and running The register screen's switching between historic balance and running
total based on query arguments may be confusing, and there is no total based on query arguments may be confusing, and there is no
column heading to indicate which is being displayed. column heading to indicate which is being displayed.
</div>

View File

@ -2277,6 +2277,16 @@ See the package page for more.
#### ui #### ui
<!--
possible new doc generation process:
core docs live in per-package, man-page-structured markdown files like this one
the whole file is used to generate a man page, with filters:
html blocks and inline html are stripped
content between \<!-- USERGUIDE --\> and \<!-- /USERGUIDE --\> is reused for the user guide, with filters:
heading levels are increased (+4)
-->
<div class="userguide">
<style> <style>
.highslide img {max-width:250px; float:right; margin:0 0 1em 1em;} .highslide img {max-width:250px; float:right; margin:0 0 1em 1em;}
.highslide-caption {color:white; background-color:black;} .highslide-caption {color:white; background-color:black;}
@ -2291,13 +2301,17 @@ See the package page for more.
<a href="images/hledger-ui/hledger-ui-bcexample-acc-etrade:cash.png" class="highslide" onclick="return hs.expand(this)"><img src="images/hledger-ui/hledger-ui-bcexample-acc-etrade:cash.png" title="beancount example's etrade cash subaccount" /></a> <a href="images/hledger-ui/hledger-ui-bcexample-acc-etrade:cash.png" class="highslide" onclick="return hs.expand(this)"><img src="images/hledger-ui/hledger-ui-bcexample-acc-etrade:cash.png" title="beancount example's etrade cash subaccount" /></a>
<a href="images/hledger-ui/hledger-ui-bcexample-acc-etrade.png" class="highslide" onclick="return hs.expand(this)"><img src="images/hledger-ui/hledger-ui-bcexample-acc-etrade.png" title="beancount example's etrade investments, all commoditiess" /></a> <a href="images/hledger-ui/hledger-ui-bcexample-acc-etrade.png" class="highslide" onclick="return hs.expand(this)"><img src="images/hledger-ui/hledger-ui-bcexample-acc-etrade.png" title="beancount example's etrade investments, all commoditiess" /></a>
[hledger-ui](http://hackage.haskell.org/package/hledger-ui) is hledger's curses-style interface. </div>
It provides a simple full-screen console interface for viewing account
balances and transactions. It is simpler and more efficient for
browsing than the hledger CLI, but lighter and faster than
hledger-web.
```{.shell .noclear} hledger-ui is hledger's curses-style interface. It reads a hledger
journal file
and provides a simple full-screen console interface for viewing account
balances and transactions.
It is simpler and more convenient for browsing than the command-line
interface, but lighter and faster than hledger-web.
``` {.shell .noclear}
$ hledger ui -- --help $ hledger ui -- --help
hledger-ui [OPTIONS] [PATTERNS] hledger-ui [OPTIONS] [PATTERNS]
browse accounts, postings and entries in a full-window curses interface browse accounts, postings and entries in a full-window curses interface
@ -2310,104 +2324,204 @@ Flags:
--no-elide don't compress empty parent accounts on one line --no-elide don't compress empty parent accounts on one line
-V --value show amounts as their market value in their -V --value show amounts as their market value in their
default valuation commodity (accounts screen) default valuation commodity (accounts screen)
... ...
``` ```
##### Keys OPTIONS
=======
Generally the cursor keys navigate; `right` (or `enter`) goes deeper, `left` returns to the previous screen, Note: if invoking hledger-ui as a hledger subcommand, write `--` before
`up`/`down`/`page up`/`page down`/`home`/`end` move up and down through lists. options as shown above.
`g` gets the latest data and reloads the screen (and any previous screens). There may be a noticeable pause. Any QUERYARGS are interpreted as a hledger search query which filters
the data.
`--flat`
: show full account names, unindented
`--no-elide`
: don't compress empty parent accounts on one line
`--register=ACCTREGEX`
: start in the (first) matched account's register screen
`--theme=default|terminal|greenterm`
: use this custom display theme
`-V --value`
: show amounts as their current market value in their default
valuation commodity (accounts screen only)
`-h --help`
: show help
`--version`
: show version information
hledger options:
----------------
The following common hledger options should also work:
`-f FILE --file=FILE`
: use a different input file. For stdin, use -
`--rules-file=RULESFILE`
: Conversion rules file to use when reading CSV (default: FILE.rules)
`--alias=OLD=NEW`
: display accounts named OLD as NEW
`--ignore-assertions`
: ignore any failing balance assertions in the journal
`--debug=N`
: show debug output if N is 1-9 (default: 0)
`-b --begin=DATE`
: include postings/txns on or after this date
`-e --end=DATE`
: include postings/txns before this date
`-p --period=PERIODEXP`
: set start date, end date, and/or reporting interval all at once
(overrides the flags above)
`--date2 --aux-date`
: use postings/txns' secondary dates instead
`-C --cleared`
: include only cleared postings/txns
`--pending`
: include only pending postings/txns
`-U --uncleared`
: include only uncleared (and pending) postings/txns
`-R --real`
: include only non-virtual postings
`--depth=N`
: hide accounts/postings deeper than N
`-E --empty`
: show empty/zero things which are normally omitted
`-B --cost`
: show amounts in their cost price's commodity
KEYS
====
Generally the cursor keys navigate; `right` (or `enter`) goes deeper,
`left` returns to the previous screen,
`up`/`down`/`page up`/`page down`/`home`/`end` move up and down through
lists.
`g` gets the latest data and reloads the screen (and any previous
screens). There may be a noticeable pause.
`q` quits the application. `q` quits the application.
Some screens have additional key bindings, described below. Some screens have additional key bindings, described below.
##### Accounts screen SCREENS
=======
This is normally the first screen displayed. Accounts screen
It lists accounts and their balances, like hledger's balance command. ---------------
By default, it shows all accounts and their latest ending balances.
if you specify a query on the command line, it shows just the matched accounts and the balances from matched transactions.
When not in flat mode, indentation indicates the account hierarchy. `F` toggles flat mode on and off. This is normally the first screen displayed. It lists accounts and their
balances, like hledger's balance command. By default, it shows all
accounts and their latest ending balances. if you specify a query on the
command line, it shows just the matched accounts and the balances from
matched transactions.
By default, all subaccounts are displayed. When not in flat mode, indentation indicates the account hierarchy. `F`
To see less detail, set a depth limit by pressing a number key, `1` to `9`. toggles flat mode on and off.
Or, adjust the depth limit by pressing `-` or `+` (`=` also works).
`0` removes the depth limit.
`C` toggles cleared mode. In cleared mode, the accounts and balances By default, all subaccounts are displayed. To see less detail, set a
are derived only from transactions which are marked cleared (*). depth limit by pressing a number key, `1` to `9`. Or, adjust the depth
limit by pressing `-` or `+` (`=` also works). `0` removes the depth
limit.
`C` toggles cleared mode. In cleared mode, the accounts and balances are
derived only from transactions which are marked cleared (\*).
Press `right` or `enter` to view an account's transactions register. Press `right` or `enter` to view an account's transactions register.
##### Register screen Register screen
---------------
This screen lists all transactions affecting a particular account (like a check register). This screen lists all transactions affecting a particular account (like
In cleared mode (press `C`) it lists only transactions which are marked cleared. a check register). In cleared mode (press `C`) it lists only
It does not otherwise filter by query. transactions which are marked cleared. It does not otherwise filter by
query.
Note this screen shows transactions, not postings (unlike hledger's Note this screen shows transactions, not postings (unlike hledger's
register command). This means: register command). This means:
- Each line represents a whole transaction. - Each line represents a whole transaction.
- For each transaction, it shows the other account(s) involved, in - For each transaction, it shows the other account(s) involved, in
abbreviated form. (If there are both real and virtual postings, it abbreviated form. (If there are both real and virtual postings, it
shows only the accounts affected by real postings.) shows only the accounts affected by real postings.)
- It shows the overall change to the current account's balance from - It shows the overall change to the current account's balance from
each transaction; positive for an inflow to this account, negative each transaction; positive for an inflow to this account, negative
for an outflow. for an outflow.
- When no query other than a date limit is in effect, it shows the - When no query other than a date limit is in effect, it shows the
current account's historic balance as of the transaction date. current account's historic balance as of the transaction date.
Otherwise it shows a running total starting from zero. Eg, these Otherwise it shows a running total starting from zero. Eg, these
will show historic balances: will show historic balances:
``` $ hledger-ui
$ hledger-ui $ hledger-ui --begin 'this month'
$ hledger-ui --begin 'this month' $ hledger-ui --register checking date:2015/10
$ hledger-ui --register checking date:2015/10
```
while these will show a running total, since the queries are not just date limits: while these will show a running total, since the queries are not
just date limits:
``` $ hledger-ui checking
$ hledger-ui checking $ hledger-ui --begin 'this month' desc:market
$ hledger-ui --begin 'this month' desc:market $ hledger-ui --register checking --cleared
$ hledger-ui --register checking --cleared
```
Press `right` or `enter` to view the selected transaction in full detail. Press `right` or `enter` to view the selected transaction in full
detail.
##### Transaction screen Transaction screen
------------------
This screen shows a single transaction, as a general journal entry, This screen shows a single transaction, as a general journal entry,
similar to hledger's print command and journal format (hledger_journal(5)). similar to hledger's print command and journal format
(hledger\_journal(5)).
The transaction's date(s) and any cleared flag, transaction code, The transaction's date(s) and any cleared flag, transaction code,
description, comments, along with all of its account postings are description, comments, along with all of its account postings are shown.
shown. Simple transactions have two postings, but there can be more Simple transactions have two postings, but there can be more (or in
(or in certain cases, fewer). certain cases, fewer).
`up` and `down` will step through all transactions listed in the `up` and `down` will step through all transactions listed in the
previous account register screen. In the title bar, the numbers in previous account register screen. In the title bar, the numbers in
parentheses show your position within that account register. They will parentheses show your position within that account register. They will
vary depending on which account register you came from (remember most vary depending on which account register you came from (remember most
transactions appear in multiple account registers). The #N number transactions appear in multiple account registers). The \#N number
preceding them is the transaction's position within the complete preceding them is the transaction's position within the complete
unfiltered journal, which is a more stable id (at least until the next unfiltered journal, which is a more stable id (at least until the next
reload). reload).
##### Error screen Error screen
------------
This screen will appear if there is a problem, such as a parse error, This screen will appear if there is a problem, such as a parse error,
when you press g to reload. Once you have fixed the problem described, when you press g to reload. Once you have fixed the problem described,
press g again to reload and restore normal operation. press g again to reload and restore normal operation.
#### web #### web
<style> <style>