;doc: update manuals

This commit is contained in:
Simon Michael 2021-09-20 16:56:36 -10:00
parent 44d494af07
commit 9cae7a076a
9 changed files with 2075 additions and 2016 deletions

View File

@ -173,6 +173,10 @@ generate future transactions from periodic transaction rules, for the
next 6 months or till report end date.
In hledger-ui, also make ordinary future transactions visible.
.TP
\f[B]\f[CB]--commodity-style\f[B]\f[R]
Override the commodity style in the output for the specified commodity.
For example \[aq]EUR1.000,00\[aq].
.TP
\f[B]\f[CB]--color=WHEN (or --colour=WHEN)\f[B]\f[R]
Should color-supporting commands use ANSI color codes in text output.
\[aq]auto\[aq] (default): whenever stdout seems to be a color-supporting

View File

@ -193,6 +193,10 @@ the data.
generate future transactions from periodic transaction rules, for
the next 6 months or till report end date. In hledger-ui, also
make ordinary future transactions visible.
'--commodity-style'
Override the commodity style in the output for the specified
commodity. For example 'EUR1.000,00'.
'--color=WHEN (or --colour=WHEN)'
Should color-supporting commands use ANSI color codes in text
@ -600,30 +604,30 @@ Tag Table:
Node: Top221
Node: OPTIONS1647
Ref: #options1744
Node: KEYS6244
Ref: #keys6339
Node: SCREENS10410
Ref: #screens10508
Node: Accounts screen10598
Ref: #accounts-screen10726
Node: Register screen12941
Ref: #register-screen13096
Node: Transaction screen15093
Ref: #transaction-screen15251
Node: Error screen16121
Ref: #error-screen16243
Node: TIPS16487
Ref: #tips16586
Node: Watch mode16638
Ref: #watch-mode16755
Node: Watch mode limitations17501
Ref: #watch-mode-limitations17642
Node: ENVIRONMENT18778
Ref: #environment18889
Node: FILES19696
Ref: #files19795
Node: BUGS20008
Ref: #bugs20085
Node: KEYS6375
Ref: #keys6470
Node: SCREENS10541
Ref: #screens10639
Node: Accounts screen10729
Ref: #accounts-screen10857
Node: Register screen13072
Ref: #register-screen13227
Node: Transaction screen15224
Ref: #transaction-screen15382
Node: Error screen16252
Ref: #error-screen16374
Node: TIPS16618
Ref: #tips16717
Node: Watch mode16769
Ref: #watch-mode16886
Node: Watch mode limitations17632
Ref: #watch-mode-limitations17773
Node: ENVIRONMENT18909
Ref: #environment19020
Node: FILES19827
Ref: #files19926
Node: BUGS20139
Ref: #bugs20216

End Tag Table

View File

@ -170,11 +170,15 @@ OPTIONS
for the next 6 months or till report end date. In hledger-ui,
also make ordinary future transactions visible.
--commodity-style
Override the commodity style in the output for the specified
commodity. For example 'EUR1.000,00'.
--color=WHEN (or --colour=WHEN)
Should color-supporting commands use ANSI color codes in text
output. 'auto' (default): whenever stdout seems to be a color-
supporting terminal. 'always' or 'yes': always, useful eg when
piping output into 'less -R'. 'never' or 'no': never. A
Should color-supporting commands use ANSI color codes in text
output. 'auto' (default): whenever stdout seems to be a color-
supporting terminal. 'always' or 'yes': always, useful eg when
piping output into 'less -R'. 'never' or 'no': never. A
NO_COLOR environment variable overrides this.
When a reporting option appears more than once in the command line, the
@ -198,86 +202,86 @@ OPTIONS
show debug output (levels 1-9, default: 1)
A @FILE argument will be expanded to the contents of FILE, which should
contain one command line option/argument per line. (To prevent this,
contain one command line option/argument per line. (To prevent this,
insert a -- argument before.)
KEYS
? shows a help dialog listing all keys. (Some of these also appear in
? shows a help dialog listing all keys. (Some of these also appear in
the quick help at the bottom of each screen.) Press ? again (or ESCAPE,
or LEFT, or q) to close it. The following keys work on most screens:
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
the previous screen, up/down/page up/page down/home/end move up and
down through lists. Emacs-style (ctrl-p/ctrl-n/ctrl-f/ctrl-b) movement
keys are also supported (but not vi-style keys, since hledger-1.19,
sorry!). A tip: movement speed is limited by your keyboard repeat
rate, to move faster you may want to adjust it. (If you're on a mac,
keys are also supported (but not vi-style keys, since hledger-1.19,
sorry!). A tip: movement speed is limited by your keyboard repeat
rate, to move faster you may want to adjust it. (If you're on a mac,
the karabiner app is one way to do that.)
With shift pressed, the cursor keys adjust the report period, limiting
the transactions to be shown (by default, all are shown). shift-
down/up steps downward and upward through these standard report period
durations: year, quarter, month, week, day. Then, shift-left/right
moves to the previous/next period. T sets the report period to today.
With the --watch option, when viewing a "current" period (the current
With shift pressed, the cursor keys adjust the report period, limiting
the transactions to be shown (by default, all are shown). shift-
down/up steps downward and upward through these standard report period
durations: year, quarter, month, week, day. Then, shift-left/right
moves to the previous/next period. T sets the report period to today.
With the --watch option, when viewing a "current" period (the current
day, week, month, quarter, or year), the period will move automatically
to track the current date. To set a non-standard period, you can use /
and a date: query.
/ lets you set a general filter query limiting the data shown, using
the same query terms as in hledger and hledger-web. While editing the
query, you can use CTRL-a/e/d/k, BS, cursor keys; press ENTER to set
/ lets you set a general filter query limiting the data shown, using
the same query terms as in hledger and hledger-web. While editing the
query, you can use CTRL-a/e/d/k, BS, cursor keys; press ENTER to set
it, or ESCAPEto cancel. There are also keys for quickly adjusting some
common filters like account depth and transaction status (see below).
common filters like account depth and transaction status (see below).
BACKSPACE or DELETE removes all filters, showing all transactions.
As mentioned above, by default hledger-ui hides future transactions -
As mentioned above, by default hledger-ui hides future transactions -
both ordinary transactions recorded in the journal, and periodic trans-
actions generated by rule. F toggles forecast mode, in which
actions generated by rule. F toggles forecast mode, in which
future/forecasted transactions are shown.
ESCAPE resets the UI state and jumps back to the top screen, restoring
the app's initial state at startup. Or, it cancels minibuffer data
ESCAPE resets the UI state and jumps back to the top screen, restoring
the app's initial state at startup. Or, it cancels minibuffer data
entry or the help dialog.
CTRL-l redraws the screen and centers the selection if possible (selec-
tions near the top won't be centered, since we don't scroll above the
tions near the top won't be centered, since we don't scroll above the
top).
g reloads from the data file(s) and updates the current screen and any
previous screens. (With large files, this could cause a noticeable
g reloads from the data file(s) and updates the current screen and any
previous screens. (With large files, this could cause a noticeable
pause.)
I toggles balance assertion checking. Disabling balance assertions
I toggles balance assertion checking. Disabling balance assertions
temporarily can be useful for troubleshooting.
a runs command-line hledger's add command, and reloads the updated
a runs command-line hledger's add command, and reloads the updated
file. This allows some basic data entry.
A is like a, but runs the hledger-iadd tool, which provides a terminal
interface. This key will be available if hledger-iadd is installed in
A is like a, but runs the hledger-iadd tool, which provides a terminal
interface. This key will be available if hledger-iadd is installed in
$path.
E runs $HLEDGER_UI_EDITOR, or $EDITOR, or a default (emacsclient -a ""
-nw) on the journal file. With some editors (emacs, vi), the cursor
will be positioned at the current transaction when invoked from the
register and transaction screens, and at the error location (if possi-
E runs $HLEDGER_UI_EDITOR, or $EDITOR, or a default (emacsclient -a ""
-nw) on the journal file. With some editors (emacs, vi), the cursor
will be positioned at the current transaction when invoked from the
register and transaction screens, and at the error location (if possi-
ble) when invoked from the error screen.
B toggles cost mode, showing amounts in their transaction price's com-
B toggles cost mode, showing amounts in their transaction price's com-
modity (like toggling the -B/--cost flag).
V toggles value mode, showing amounts' current market value in their
default valuation commodity (like toggling the -V/--market flag).
Note, "current market value" means the value on the report end date if
specified, otherwise today. To see the value on another date, you can
temporarily set that as the report end date. Eg: to see a transaction
as it was valued on july 30, go to the accounts or register screen,
V toggles value mode, showing amounts' current market value in their
default valuation commodity (like toggling the -V/--market flag).
Note, "current market value" means the value on the report end date if
specified, otherwise today. To see the value on another date, you can
temporarily set that as the report end date. Eg: to see a transaction
as it was valued on july 30, go to the accounts or register screen,
press /, and add date:-7/30 to the query.
At most one of cost or value mode can be active at once.
There's not yet any visual reminder when cost or value mode is active;
There's not yet any visual reminder when cost or value mode is active;
for now pressing b b v should reliably reset to normal mode.
q quits the application.
@ -286,44 +290,44 @@ KEYS
SCREENS
Accounts screen
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 (including the balances
of subaccounts). If you specify a query on the command line, it shows
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 (including the balances
of subaccounts). If you specify a query on the command line, it shows
just the matched accounts and the balances from matched transactions.
Account names are shown as a flat list by default; press t to toggle
tree mode. In list mode, account balances are exclusive of subac-
counts, except where subaccounts are hidden by a depth limit (see
below). In tree mode, all account balances are inclusive of subac-
Account names are shown as a flat list by default; press t to toggle
tree mode. In list mode, account balances are exclusive of subac-
counts, except where subaccounts are hidden by a depth limit (see
below). In tree mode, all account balances are inclusive of subac-
counts.
To see less detail, press a number key, 1 to 9, to set a depth limit.
To see less detail, press a number key, 1 to 9, to set a depth limit.
Or use - to decrease and +/= to increase the depth limit. 0 shows even
less detail, collapsing all accounts to a single total. To remove the
depth limit, set it higher than the maximum account depth, or press
less detail, collapsing all accounts to a single total. To remove the
depth limit, set it higher than the maximum account depth, or press
ESCAPE.
H toggles between showing historical balances or period balances. His-
torical balances (the default) are ending balances at the end of the
report period, taking into account all transactions before that date
(filtered by the filter query if any), including transactions before
the start of the report period. In other words, historical balances
are what you would see on a bank statement for that account (unless
disturbed by a filter query). Period balances ignore transactions
torical balances (the default) are ending balances at the end of the
report period, taking into account all transactions before that date
(filtered by the filter query if any), including transactions before
the start of the report period. In other words, historical balances
are what you would see on a bank statement for that account (unless
disturbed by a filter query). Period balances ignore transactions
before the report start date, so they show the change in balance during
the report period. They are more useful eg when viewing a time log.
U toggles filtering by unmarked status, including or excluding unmarked
postings in the balances. Similarly, P toggles pending postings, and C
toggles cleared postings. (By default, balances include all postings;
if you activate one or two status filters, only those postings are
toggles cleared postings. (By default, balances include all postings;
if you activate one or two status filters, only those postings are
included; and if you activate all three, the filter is removed.)
R toggles real mode, in which virtual postings are ignored.
Z toggles nonzero mode, in which only accounts with nonzero balances
are shown (hledger-ui shows zero items by default, unlike command-line
Z toggles nonzero mode, in which only accounts with nonzero balances
are shown (hledger-ui shows zero items by default, unlike command-line
hledger).
Press right or enter to view an account's transactions register.
@ -332,124 +336,124 @@ SCREENS
This screen shows the transactions affecting a particular account, like
a check register. Each line represents one transaction and shows:
o the other account(s) involved, in abbreviated form. (If there are
both real and virtual postings, it shows only the accounts affected
o the other account(s) involved, in abbreviated form. (If there are
both real and virtual postings, it shows only the accounts affected
by real postings.)
o the overall change to the current account's balance; positive for an
o the overall change to the current account's balance; positive for an
inflow to this account, negative for an outflow.
o the running historical total or period total for the current account,
after the transaction. This can be toggled with H. Similar to the
accounts screen, the historical total is affected by transactions
(filtered by the filter query) before the report start date, while
after the transaction. This can be toggled with H. Similar to the
accounts screen, the historical total is affected by transactions
(filtered by the filter query) before the report start date, while
the period total is not. If the historical total is not disturbed by
a filter query, it will be the running historical balance you would
a filter query, it will be the running historical balance you would
see on a bank register for the current account.
Transactions affecting this account's subaccounts will be included in
Transactions affecting this account's subaccounts will be included in
the register if the accounts screen is in tree mode, or if it's in list
mode but this account has subaccounts which are not shown due to a
depth limit. In other words, the register always shows the transac-
tions contributing to the balance shown on the accounts screen. Tree
mode but this account has subaccounts which are not shown due to a
depth limit. In other words, the register always shows the transac-
tions contributing to the balance shown on the accounts screen. Tree
mode/list mode can be toggled with t here also.
U toggles filtering by unmarked status, showing or hiding unmarked
U toggles filtering by unmarked status, showing or hiding unmarked
transactions. Similarly, P toggles pending transactions, and C toggles
cleared transactions. (By default, transactions with all statuses are
shown; if you activate one or two status filters, only those transac-
cleared transactions. (By default, transactions with all statuses are
shown; if you activate one or two status filters, only those transac-
tions are shown; and if you activate all three, the filter is removed.)
R toggles real mode, in which virtual postings are ignored.
Z toggles nonzero mode, in which only transactions posting a nonzero
change are shown (hledger-ui shows zero items by default, unlike com-
Z toggles nonzero mode, in which only transactions posting a nonzero
change are shown (hledger-ui shows zero items by default, unlike com-
mand-line hledger).
Press right (or enter) to view the selected transaction in detail.
Transaction screen
This screen shows a single transaction, as a general journal entry,
similar to hledger's print command and journal format (hledger_jour-
This screen shows a single transaction, as a general journal entry,
similar to hledger's print command and journal format (hledger_jour-
nal(5)).
The transaction's date(s) and any cleared flag, transaction code,
description, comments, along with all of its account postings are
shown. Simple transactions have two postings, but there can be more
The transaction's date(s) and any cleared flag, transaction code,
description, comments, along with all of its account postings are
shown. Simple transactions have two postings, but there can be more
(or in certain cases, fewer).
up and down will step through all transactions listed in the previous
account register screen. In the title bar, the numbers in parentheses
show your position within that account register. They will vary
up and down will step through all transactions listed in the previous
account register screen. In the title bar, the numbers in parentheses
show your position within that account register. They will vary
depending on which account register you came from (remember most trans-
actions appear in multiple account registers). The #N number preceding
them is the transaction's position within the complete unfiltered jour-
nal, which is a more stable id (at least until the next reload).
Error screen
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, press g
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, press g
again to reload and resume normal operation. (Or, you can press escape
to cancel the reload attempt.)
TIPS
Watch mode
One of hledger-ui's best features is the auto-reloading --watch mode.
With this flag, it will update the display automatically whenever
One of hledger-ui's best features is the auto-reloading --watch mode.
With this flag, it will update the display automatically whenever
changes are saved to the data files.
This is very useful when reconciling. A good workflow is to have your
bank's online register open in a browser window, for reference; the
journal file open in an editor window; and hledger-ui in watch mode in
This is very useful when reconciling. A good workflow is to have your
bank's online register open in a browser window, for reference; the
journal file open in an editor window; and hledger-ui in watch mode in
a terminal window, eg:
$ hledger-ui --watch --register checking -C
As you mark things cleared in the editor, you can see the effect imme-
diately without having to context switch. This leaves more mental
bandwidth for your accounting. Of course you can still interact with
hledger-ui when needed, eg to toggle cleared mode, or to explore the
As you mark things cleared in the editor, you can see the effect imme-
diately without having to context switch. This leaves more mental
bandwidth for your accounting. Of course you can still interact with
hledger-ui when needed, eg to toggle cleared mode, or to explore the
history.
Watch mode limitations
There are situations in which it won't work, ie the display will not
update when you save a change (because the underlying inotify library
There are situations in which it won't work, ie the display will not
update when you save a change (because the underlying inotify library
does not support it). Here are some that we know of:
o Certain editors: saving with gedit, and perhaps any Gnome applica-
tion, won't be detected (#1617). Jetbrains IDEs, such as IDEA, also
o Certain editors: saving with gedit, and perhaps any Gnome applica-
tion, won't be detected (#1617). Jetbrains IDEs, such as IDEA, also
may not work (#911).
o Certain unusual filesystems might not be supported. (All the usual
o Certain unusual filesystems might not be supported. (All the usual
ones on unix, mac and windows are supported.)
In such cases, the workaround is to switch to the hledger-ui window and
press g each time you want it to reload. (Actually, see #1617 for
press g each time you want it to reload. (Actually, see #1617 for
another workaround, and let us know if it works for you.)
If you leave hledger-ui --watch running for days, on certain platforms
(?), perhaps with many transactions in your journal (?), perhaps with
large numbers of other files present (?), you may see it gradually
using more and more memory and CPU over time, as seen in top or Activ-
If you leave hledger-ui --watch running for days, on certain platforms
(?), perhaps with many transactions in your journal (?), perhaps with
large numbers of other files present (?), you may see it gradually
using more and more memory and CPU over time, as seen in top or Activ-
ity Monitor or Task Manager.
A workaround is to quit and restart it, or to suspend it (CTRL-z) and
A workaround is to quit and restart it, or to suspend it (CTRL-z) and
restart it (fg) if your shell supports that.
ENVIRONMENT
COLUMNS The screen width to use. Default: the full terminal width.
LEDGER_FILE The journal file path when not specified with -f. Default:
~/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.jour-
~/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.jour-
nal).
A typical value is ~/DIR/YYYY.journal, where DIR is a version-con-
trolled finance directory and YYYY is the current year. Or ~/DIR/cur-
A typical value is ~/DIR/YYYY.journal, where DIR is a version-con-
trolled finance directory and YYYY is the current year. Or ~/DIR/cur-
rent.journal, where current.journal is a symbolic link to YYYY.journal.
On Mac computers, you can set this and other environment variables in a
more thorough way that also affects applications started from the GUI
(say, an Emacs dock icon). Eg on MacOS Catalina I have a
more thorough way that also affects applications started from the GUI
(say, an Emacs dock icon). Eg on MacOS Catalina I have a
~/.MacOSX/environment.plist file containing
{
@ -459,13 +463,13 @@ ENVIRONMENT
To see the effect you may need to killall Dock, or reboot.
FILES
Reads data from one or more files in hledger journal, timeclock, time-
dot, or CSV format specified with -f, or $LEDGER_FILE, or
$HOME/.hledger.journal (on windows, perhaps
Reads data from one or more files in hledger journal, timeclock, time-
dot, or CSV format specified with -f, or $LEDGER_FILE, or
$HOME/.hledger.journal (on windows, perhaps
C:/Users/USER/.hledger.journal).
BUGS
The need to precede options with -- when invoked from hledger is awk-
The need to precede options with -- when invoked from hledger is awk-
ward.
-f- doesn't work (hledger-ui can't read from stdin).
@ -473,24 +477,24 @@ BUGS
-V affects only the accounts screen.
When you press g, the current and all previous screens are regenerated,
which may cause a noticeable pause with large files. Also there is no
which may cause a noticeable pause with large files. Also there is no
visual indication that this is in progress.
--watch is not yet fully robust. It works well for normal usage, but
many file changes in a short time (eg saving the file thousands of
times with an editor macro) can cause problems at least on OSX. Symp-
toms include: unresponsive UI, periodic resetting of the cursor posi-
--watch is not yet fully robust. It works well for normal usage, but
many file changes in a short time (eg saving the file thousands of
times with an editor macro) can cause problems at least on OSX. Symp-
toms include: unresponsive UI, periodic resetting of the cursor posi-
tion, momentary display of parse errors, high CPU usage eventually sub-
siding, and possibly a small but persistent build-up of CPU usage until
the program is restarted.
Also, if you are viewing files mounted from another machine, --watch
Also, if you are viewing files mounted from another machine, --watch
requires that both machine clocks are roughly in step.
REPORTING BUGS
Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel
Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel
or hledger mail list)

View File

@ -202,6 +202,10 @@ generate future transactions from periodic transaction rules, for the
next 6 months or till report end date.
In hledger-ui, also make ordinary future transactions visible.
.TP
\f[B]\f[CB]--commodity-style\f[B]\f[R]
Override the commodity style in the output for the specified commodity.
For example \[aq]EUR1.000,00\[aq].
.TP
\f[B]\f[CB]--color=WHEN (or --colour=WHEN)\f[B]\f[R]
Should color-supporting commands use ANSI color codes in text output.
\[aq]auto\[aq] (default): whenever stdout seems to be a color-supporting

View File

@ -219,6 +219,10 @@ before options, as shown in the synopsis above.
generate future transactions from periodic transaction rules, for
the next 6 months or till report end date. In hledger-ui, also
make ordinary future transactions visible.
'--commodity-style'
Override the commodity style in the output for the specified
commodity. For example 'EUR1.000,00'.
'--color=WHEN (or --colour=WHEN)'
Should color-supporting commands use ANSI color codes in text
@ -609,20 +613,20 @@ Tag Table:
Node: Top223
Node: OPTIONS1889
Ref: #options1994
Node: PERMISSIONS9526
Ref: #permissions9665
Node: EDITING UPLOADING DOWNLOADING10877
Ref: #editing-uploading-downloading11058
Node: RELOADING11892
Ref: #reloading12026
Node: JSON API12459
Ref: #json-api12573
Node: ENVIRONMENT18063
Ref: #environment18179
Node: FILES18912
Ref: #files19012
Node: BUGS19225
Ref: #bugs19303
Node: PERMISSIONS9657
Ref: #permissions9796
Node: EDITING UPLOADING DOWNLOADING11008
Ref: #editing-uploading-downloading11189
Node: RELOADING12023
Ref: #reloading12157
Node: JSON API12590
Ref: #json-api12704
Node: ENVIRONMENT18194
Ref: #environment18310
Node: FILES19043
Ref: #files19143
Node: BUGS19356
Ref: #bugs19434

End Tag Table

View File

@ -193,11 +193,15 @@ OPTIONS
for the next 6 months or till report end date. In hledger-ui,
also make ordinary future transactions visible.
--commodity-style
Override the commodity style in the output for the specified
commodity. For example 'EUR1.000,00'.
--color=WHEN (or --colour=WHEN)
Should color-supporting commands use ANSI color codes in text
output. 'auto' (default): whenever stdout seems to be a color-
supporting terminal. 'always' or 'yes': always, useful eg when
piping output into 'less -R'. 'never' or 'no': never. A
Should color-supporting commands use ANSI color codes in text
output. 'auto' (default): whenever stdout seems to be a color-
supporting terminal. 'always' or 'yes': always, useful eg when
piping output into 'less -R'. 'never' or 'no': never. A
NO_COLOR environment variable overrides this.
When a reporting option appears more than once in the command line, the
@ -221,54 +225,54 @@ OPTIONS
show debug output (levels 1-9, default: 1)
A @FILE argument will be expanded to the contents of FILE, which should
contain one command line option/argument per line. (To prevent this,
contain one command line option/argument per line. (To prevent this,
insert a -- argument before.)
By default, hledger-web starts the web app in "transient mode" and also
opens it in your default web browser if possible. In this mode the web
app will keep running for as long as you have it open in a browser win-
dow, and will exit after two minutes of inactivity (no requests and no
browser windows viewing it). With --serve, it just runs the web app
without exiting, and logs requests to the console. With --serve-api,
only the JSON web api (see below) is served, with the usual HTML
dow, and will exit after two minutes of inactivity (no requests and no
browser windows viewing it). With --serve, it just runs the web app
without exiting, and logs requests to the console. With --serve-api,
only the JSON web api (see below) is served, with the usual HTML
server-side web UI disabled.
By default the server listens on IP address 127.0.0.1, accessible only
to local requests. You can use --host to change this, eg --host
By default the server listens on IP address 127.0.0.1, accessible only
to local requests. You can use --host to change this, eg --host
0.0.0.0 to listen on all configured addresses.
Similarly, use --port to set a TCP port other than 5000, eg if you are
Similarly, use --port to set a TCP port other than 5000, eg if you are
running multiple hledger-web instances.
Both of these options are ignored when --socket is used. In this case,
it creates an AF_UNIX socket file at the supplied path and uses that
for communication. This is an alternative way of running multiple
hledger-web instances behind a reverse proxy that handles authentica-
tion for different users. The path can be derived in a predictable
it creates an AF_UNIX socket file at the supplied path and uses that
for communication. This is an alternative way of running multiple
hledger-web instances behind a reverse proxy that handles authentica-
tion for different users. The path can be derived in a predictable
way, eg by using the username within the path. As an example, nginx as
reverse proxy can use the variable $remote_user to derive a path from
the username used in a HTTP basic authentication. The following
proxy_pass directive allows access to all hledger-web instances that
reverse proxy can use the variable $remote_user to derive a path from
the username used in a HTTP basic authentication. The following
proxy_pass directive allows access to all hledger-web instances that
created a socket in /tmp/hledger/:
proxy_pass http://unix:/tmp/hledger/${remote_user}.socket;
You can use --base-url to change the protocol, hostname, port and path
You can use --base-url to change the protocol, hostname, port and path
that appear in hyperlinks, useful eg for integrating hledger-web within
a larger website. The default is http://HOST:PORT/ using the server's
a larger website. The default is http://HOST:PORT/ using the server's
configured host address and TCP port (or http://HOST if PORT is 80).
With --file-url you can set a different base url for static files, eg
With --file-url you can set a different base url for static files, eg
for better caching or cookie-less serving on high performance websites.
PERMISSIONS
By default, hledger-web allows anyone who can reach it to view the
By default, hledger-web allows anyone who can reach it to view the
journal and to add new transactions, but not to change existing data.
You can restrict who can reach it by
o setting the IP address it listens on (see --host above). By default
it listens on 127.0.0.1, accessible to all users on the local
o setting the IP address it listens on (see --host above). By default
it listens on 127.0.0.1, accessible to all users on the local
machine.
o putting it behind an authenticating proxy, using eg apache or nginx
@ -278,53 +282,53 @@ PERMISSIONS
You can restrict what the users who reach it can do, by
o using the --capabilities=CAP[,CAP..] flag when you start it, enabling
one or more of the following capabilities. The default value is
one or more of the following capabilities. The default value is
view,add:
o view - allows viewing the journal file and all included files
o add - allows adding new transactions to the main journal file
o manage - allows editing, uploading or downloading the main or
o manage - allows editing, uploading or downloading the main or
included files
o using the --capabilities-header=HTTPHEADER flag to specify a HTTP
header from which it will read capabilities to enable. hledger-web
on Sandstorm uses the X-Sandstorm-Permissions header to integrate
o using the --capabilities-header=HTTPHEADER flag to specify a HTTP
header from which it will read capabilities to enable. hledger-web
on Sandstorm uses the X-Sandstorm-Permissions header to integrate
with Sandstorm's permissions. This is disabled by default.
EDITING, UPLOADING, DOWNLOADING
If you enable the manage capability mentioned above, you'll see a new
"spanner" button to the right of the search form. Clicking this will
let you edit, upload, or download the journal file or any files it
If you enable the manage capability mentioned above, you'll see a new
"spanner" button to the right of the search form. Clicking this will
let you edit, upload, or download the journal file or any files it
includes.
Note, unlike any other hledger command, in this mode you (or any visi-
Note, unlike any other hledger command, in this mode you (or any visi-
tor) can alter or wipe the data files.
Normally whenever a file is changed in this way, hledger-web saves a
numbered backup (assuming file permissions allow it, the disk is not
full, etc.) hledger-web is not aware of version control systems, cur-
rently; if you use one, you'll have to arrange to commit the changes
Normally whenever a file is changed in this way, hledger-web saves a
numbered backup (assuming file permissions allow it, the disk is not
full, etc.) hledger-web is not aware of version control systems, cur-
rently; if you use one, you'll have to arrange to commit the changes
yourself (eg with a cron job or a file watcher like entr).
Changes which would leave the journal file(s) unparseable or non-valid
(eg with failing balance assertions) are prevented. (Probably. This
Changes which would leave the journal file(s) unparseable or non-valid
(eg with failing balance assertions) are prevented. (Probably. This
needs re-testing.)
RELOADING
hledger-web detects changes made to the files by other means (eg if you
edit it directly, outside of hledger-web), and it will show the new
data when you reload the page or navigate to a new page. If a change
makes a file unparseable, hledger-web will display an error message
edit it directly, outside of hledger-web), and it will show the new
data when you reload the page or navigate to a new page. If a change
makes a file unparseable, hledger-web will display an error message
until the file has been fixed.
(Note: if you are viewing files mounted from another machine, make sure
that both machine clocks are roughly in step.)
JSON API
In addition to the web UI, hledger-web also serves a JSON API that can
be used to get data or add new transactions. If you want the JSON API
In addition to the web UI, hledger-web also serves a JSON API that can
be used to get data or add new transactions. If you want the JSON API
only, you can use the --serve-api flag. Eg:
$ hledger-web -f examples/sample.journal --serve-api
@ -341,7 +345,7 @@ JSON API
/accounttransactions/ACCOUNTNAME
Eg, all account names in the journal (similar to the accounts command).
(hledger-web's JSON does not include newlines, here we use python to
(hledger-web's JSON does not include newlines, here we use python to
prettify it):
$ curl -s http://127.0.0.1:5000/accountnames | python -m json.tool
@ -382,25 +386,25 @@ JSON API
"aprice": null,
...
Most of the JSON corresponds to hledger's data types; for details of
what the fields mean, see the Hledger.Data.Json haddock docs and click
on the various data types, eg Transaction. And for a higher level
Most of the JSON corresponds to hledger's data types; for details of
what the fields mean, see the Hledger.Data.Json haddock docs and click
on the various data types, eg Transaction. And for a higher level
understanding, see the journal manual.
In some cases there is outer JSON corresponding to a "Report" type. To
understand that, go to the Hledger.Web.Handler.MiscR haddock and look
at the source for the appropriate handler to see what it returns. Eg
understand that, go to the Hledger.Web.Handler.MiscR haddock and look
at the source for the appropriate handler to see what it returns. Eg
for /accounttransactions it's getAccounttransactionsR, returning a
"accountTransactionsReport ...". Looking up the haddock for that we
"accountTransactionsReport ...". Looking up the haddock for that we
can see that /accounttransactions returns an AccountTransactionsReport,
which consists of a report title and a list of AccountTransactionsRe-
which consists of a report title and a list of AccountTransactionsRe-
portItem (etc).
You can add a new transaction to the journal with a PUT request to
/add, if hledger-web was started with the add capability (enabled by
You can add a new transaction to the journal with a PUT request to
/add, if hledger-web was started with the add capability (enabled by
default). The payload must be the full, exact JSON representation of a
hledger transaction (partial data won't do). You can get sample JSON
from hledger-web's /transactions or /accounttransactions, or you can
hledger transaction (partial data won't do). You can get sample JSON
from hledger-web's /transactions or /accounttransactions, or you can
export it with hledger-lib, eg like so:
.../hledger$ stack ghci hledger-lib
@ -496,23 +500,23 @@ JSON API
"tstatus": "Unmarked"
}
And here's how to test adding it with curl. This should add a new
And here's how to test adding it with curl. This should add a new
entry to your journal:
$ curl http://127.0.0.1:5000/add -X PUT -H 'Content-Type: application/json' --data-binary @txn.json
ENVIRONMENT
LEDGER_FILE The journal file path when not specified with -f. Default:
~/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.jour-
~/.hledger.journal (on windows, perhaps C:/Users/USER/.hledger.jour-
nal).
A typical value is ~/DIR/YYYY.journal, where DIR is a version-con-
trolled finance directory and YYYY is the current year. Or ~/DIR/cur-
A typical value is ~/DIR/YYYY.journal, where DIR is a version-con-
trolled finance directory and YYYY is the current year. Or ~/DIR/cur-
rent.journal, where current.journal is a symbolic link to YYYY.journal.
On Mac computers, you can set this and other environment variables in a
more thorough way that also affects applications started from the GUI
(say, an Emacs dock icon). Eg on MacOS Catalina I have a
more thorough way that also affects applications started from the GUI
(say, an Emacs dock icon). Eg on MacOS Catalina I have a
~/.MacOSX/environment.plist file containing
{
@ -522,13 +526,13 @@ ENVIRONMENT
To see the effect you may need to killall Dock, or reboot.
FILES
Reads data from one or more files in hledger journal, timeclock, time-
dot, or CSV format specified with -f, or $LEDGER_FILE, or
$HOME/.hledger.journal (on windows, perhaps
Reads data from one or more files in hledger journal, timeclock, time-
dot, or CSV format specified with -f, or $LEDGER_FILE, or
$HOME/.hledger.journal (on windows, perhaps
C:/Users/USER/.hledger.journal).
BUGS
The need to precede options with -- when invoked from hledger is awk-
The need to precede options with -- when invoked from hledger is awk-
ward.
-f- doesn't work (hledger-web can't read from stdin).
@ -542,7 +546,7 @@ BUGS
REPORTING BUGS
Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel
Report bugs at http://bugs.hledger.org (or on the #hledger IRC channel
or hledger mail list)

View File

@ -195,6 +195,10 @@ generate future transactions from periodic transaction rules, for the
next 6 months or till report end date.
In hledger-ui, also make ordinary future transactions visible.
.TP
\f[B]\f[CB]--commodity-style\f[B]\f[R]
Override the commodity style in the output for the specified commodity.
For example \[aq]EUR1.000,00\[aq].
.TP
\f[B]\f[CB]--color=WHEN (or --colour=WHEN)\f[B]\f[R]
Should color-supporting commands use ANSI color codes in text output.
\[aq]auto\[aq] (default): whenever stdout seems to be a color-supporting
@ -2375,10 +2379,13 @@ probably want to either clear tables of existing data (via
completely as otherwise your postings will be duped.
.SS Commodity styles
.PP
The display style of a commodity/currence is inferred according to the
The display style of a commodity/currency is inferred according to the
rules described in Commodity display style.
The inferred display style can be overriden by an optional
\f[C]-c/--commodity-style\f[R] option.
The inferred display style can be overridden by an optional
\f[C]-c/--commodity-style\f[R] option (Exceptions: as is the case for
inferred styles, price amounts, and all amounts displayed by the
\f[C]print\f[R] command, will be displayed with all of their decimal
digits visible, regardless of the specified precision).
For example, the following will override the display style for dollars.
.IP
.nf
@ -8347,7 +8354,9 @@ Assigning to \f[C]date\f[R] sets the transaction date.
\f[C]commentN\f[R], where N is a number, sets the Nth posting\[aq]s
comment.
.PP
Tips: - Only single-line comments can be assigned.
Tips: - You can assign multi-line comments by writing literal
\f[C]\[rs]n\f[R] in the code.
A comment starting with \f[C]\[rs]n\f[R] will begin on a new line.
- Comments can contain tags, as usual.
.SS account field
.PP

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff