hledger-web 1.29.2 → 1.30
raw patch · 13 files changed
+433/−511 lines, 13 filesdep ~hledgerdep ~hledger-libdep ~megaparsec
Dependency ranges changed: hledger, hledger-lib, megaparsec
Files
- CHANGES.md +23/−0
- Hledger/Web/Foundation.hs +23/−14
- Hledger/Web/Handler/JournalR.hs +4/−4
- Hledger/Web/Handler/RegisterR.hs +5/−5
- Hledger/Web/Main.hs +8/−8
- Hledger/Web/Widget/Common.hs +1/−1
- hledger-web.1 +98/−157
- hledger-web.cabal +6/−6
- hledger-web.info +133/−147
- hledger-web.txt +126/−163
- templates/balance-report.hamlet +2/−2
- templates/default-layout.hamlet +2/−2
- templates/register.hamlet +2/−2
CHANGES.md view
@@ -5,9 +5,32 @@ \ V V / __/ |_) | \_/\_/ \___|_.__/ +Breaking changes++Features++Improvements++Fixes++Docs++API+ --> User-visible changes in hledger-web. See also the hledger changelog.++# 1.30 2023-06-01++Fixes++- A command line depth limit now works properly.+ (#1763)++Docs++- Miscellaneous manual cleanups. # 1.29.2 2023-04-07
Hledger/Web/Foundation.hs view
@@ -61,6 +61,8 @@ -- , appOpts :: WebOpts , appJournal :: IORef Journal+ -- ^ the current journal, filtered by the initial command line query+ -- but ignoring any depth limit. } @@ -112,7 +114,7 @@ master <- getYesod here <- fromMaybe RootR <$> getCurrentRoute- VD {caps, j, m, opts, q, qopts} <- getViewData+ VD{opts, j, qparam, q, qopts, caps} <- getViewData msg <- getMessage showSidebar <- shouldShowSidebar @@ -122,14 +124,14 @@ {accountlistmode_ = ALTree -- force tree mode for sidebar ,empty_ = True -- show zero items by default }- rspec' = rspec{_rsQuery=m,_rsReportOpts=ropts'}+ rspec' = rspec{_rsQuery=q,_rsReportOpts=ropts'} hideEmptyAccts <- if empty_ ropts then return True else (== Just "1") . lookup "hideemptyaccts" . reqCookies <$> getRequest let accounts =- balanceReportAsHtml (JournalR, RegisterR) here hideEmptyAccts j q qopts $+ balanceReportAsHtml (JournalR, RegisterR) here hideEmptyAccts j qparam qopts $ balanceReport rspec' j topShowmd = if showSidebar then "col-md-4" else "col-any-0" :: Text@@ -193,8 +195,8 @@ { opts :: WebOpts -- ^ the command-line options at startup , today :: Day -- ^ today's date (for queries containing relative dates) , j :: Journal -- ^ the up-to-date parsed unfiltered journal- , q :: Text -- ^ the current q parameter, the main query expression- , m :: Query -- ^ a query parsed from the q parameter+ , qparam :: Text -- ^ the current "q" request parameter+ , q :: Query -- ^ a query parsed from the q parameter , qopts :: [QueryOpt] -- ^ query options parsed from the q parameter , caps :: [Capability] -- ^ capabilities enabled for this request } deriving (Show)@@ -204,7 +206,10 @@ -- | Gather data used by handlers and templates in the current request. getViewData :: Handler ViewData getViewData = do- App{appOpts=opts@WebOpts{cliopts_=copts@CliOpts{reportspec_=rspec@ReportSpec{_rsReportOpts}}}, appJournal} <- getYesod+ App{+ appOpts=opts@WebOpts{ cliopts_=copts@CliOpts{ reportspec_=rspec@ReportSpec{_rsReportOpts, _rsQuery} } },+ appJournal+ } <- getYesod let today = _rsDay rspec -- try to read the latest journal content, keeping the old content@@ -214,12 +219,16 @@ copts{reportspec_=rspec{_rsReportOpts=_rsReportOpts{no_elide_=True}}} today - -- try to parse the query param, assuming no query if there's an error- q <- fromMaybe "" <$> lookupGetParam "q"- (m, qopts, mqerr) <- do- case parseQuery today q of- Right (m, qopts) -> return (m, qopts, Nothing)+ -- Get the query specified by the q request parameter, or no query if this fails.+ qparam <- fromMaybe "" <$> lookupGetParam "q"+ (q1, qopts, mqerr) <- do+ case parseQuery today qparam of+ Right (q0, qopts) -> return (q0, qopts, Nothing) Left err -> return (Any, [], Just err)+ -- To this, add any depth limit from the initial startup query, preserving that.+ let+ initialdepthq = filterQuery queryIsDepth _rsQuery+ q = simplifyQuery $ And [q1, initialdepthq] -- if either of the above gave an error, display it maybe (pure ()) (setMessage . toHtml) $ mjerr <|> mqerr@@ -233,7 +242,7 @@ Left e -> [] <$ addMessage "" ("Unknown permission: " <> toHtml (BC.unpack e)) Right c -> pure [c] - return VD{opts, today, j, q, m, qopts, caps}+ return VD{opts, today, j, qparam, q, qopts, caps} checkServerSideUiEnabled :: Handler () checkServerSideUiEnabled = do@@ -259,7 +268,7 @@ getCurrentJournal :: IORef Journal -> CliOpts -> Day -> Handler (Journal, Maybe String) getCurrentJournal jref opts d = do -- re-apply any initial filter specified at startup- let initq = _rsQuery $ reportspec_ opts+ let depthlessinitialq = filterQuery (not . queryIsDepth) $ _rsQuery $ reportspec_ opts -- XXX put this inside atomicModifyIORef' for thread safety j <- liftIO (readIORef jref) ej <- liftIO . runExceptT $ journalReloadIfChanged opts d j@@ -268,6 +277,6 @@ setMessage "error while reading journal" return (j, Just e) Right (j', True) -> do- liftIO . writeIORef jref $ filterJournalTransactions initq j'+ liftIO . writeIORef jref $ filterJournalTransactions depthlessinitialq j' return (j',Nothing) Right (_, False) -> return (j, Nothing)
Hledger/Web/Handler/JournalR.hs view
@@ -20,14 +20,14 @@ getJournalR :: Handler Html getJournalR = do checkServerSideUiEnabled- VD{caps, j, m, opts, q, qopts, today} <- getViewData+ VD{caps, j, q, opts, qparam, qopts, today} <- getViewData when (CapView `notElem` caps) (permissionDenied "Missing the 'view' capability") let title = case inAccount qopts of Nothing -> "General Journal" Just (a, inclsubs) -> "Transactions in " <> a <> if inclsubs then "" else " (excluding subaccounts)"- title' = title <> if m /= Any then ", filtered" else ""- acctlink a = (RegisterR, [("q", replaceInacct q $ accountQuery a)])- rspec = (reportspec_ $ cliopts_ opts){_rsQuery = m}+ title' = title <> if q /= Any then ", filtered" else ""+ acctlink a = (RegisterR, [("q", replaceInacct qparam $ accountQuery a)])+ rspec = (reportspec_ $ cliopts_ opts){_rsQuery = filterQuery (not . queryIsDepth) q} items = reverse $ entriesReport rspec j transactionFrag = transactionFragment j
Hledger/Web/Handler/RegisterR.hs view
@@ -26,26 +26,26 @@ getRegisterR :: Handler Html getRegisterR = do checkServerSideUiEnabled- VD{caps, j, m, opts, q, qopts, today} <- getViewData+ VD{caps, j, q, opts, qparam, qopts, today} <- getViewData when (CapView `notElem` caps) (permissionDenied "Missing the 'view' capability") let (a,inclsubs) = fromMaybe ("all accounts",True) $ inAccount qopts s1 = if inclsubs then "" else " (excluding subaccounts)"- s2 = if m /= Any then ", filtered" else ""+ s2 = if q /= Any then ", filtered" else "" header = a <> s1 <> s2 let rspec = reportspec_ (cliopts_ opts) acctQuery = fromMaybe Any (inAccountQuery qopts)- acctlink acc = (RegisterR, [("q", replaceInacct q $ accountQuery acc)])+ acctlink acc = (RegisterR, [("q", replaceInacct qparam $ accountQuery acc)]) otherTransAccounts = map (\(acct,(name,comma)) -> (acct, (T.pack name, T.pack comma))) . undecorateLinks . elideRightDecorated 40 . decorateLinks .- addCommas . preferReal . otherTransactionAccounts m acctQuery+ addCommas . preferReal . otherTransactionAccounts q acctQuery addCommas xs = zip xs $ zip (map (T.unpack . accountSummarisedName . paccount) xs) $ tail $ (", "<$xs) ++ [""]- items = accountTransactionsReport rspec{_rsQuery=m} j acctQuery+ items = accountTransactionsReport rspec{_rsQuery=q} j acctQuery balancelabel | isJust (inAccount qopts), balanceaccum_ (_rsReportOpts rspec) == Historical = "Historical Total" | isJust (inAccount qopts) = "Period Total"
Hledger/Web/Main.hs view
@@ -54,12 +54,12 @@ wopts@WebOpts{cliopts_=copts@CliOpts{debug_, rawopts_}} <- getHledgerWebOpts when (debug_ > 0) $ printf "%s\n" prognameandversion >> printf "opts: %s\n" (show wopts) if- | "help" `inRawOpts` rawopts_ -> pager (showModeUsage webmode) >> exitSuccess- | "info" `inRawOpts` rawopts_ -> runInfoForTopic "hledger-web" Nothing- | "man" `inRawOpts` rawopts_ -> runManForTopic "hledger-web" Nothing- | "version" `inRawOpts` rawopts_ -> putStrLn prognameandversion >> exitSuccess- -- "binary-filename" `inRawOpts` rawopts_ -> putStrLn (binaryfilename progname)- | "test" `inRawOpts` rawopts_ -> do+ | boolopt "help" rawopts_ -> pager (showModeUsage webmode) >> exitSuccess+ | boolopt "info" rawopts_ -> runInfoForTopic "hledger-web" Nothing+ | boolopt "man" rawopts_ -> runManForTopic "hledger-web" Nothing+ | boolopt "version" rawopts_ -> putStrLn prognameandversion >> exitSuccess+ -- boolopt "binary-filename" rawopts_ -> putStrLn (binaryfilename progname)+ | boolopt "test" rawopts_ -> do -- remove --test and --, leaving other args for hspec (`withArgs` hledgerWebTest) . filter (`notElem` ["--test","--"]) =<< getArgs | otherwise -> withJournalDo copts (web wopts)@@ -67,8 +67,8 @@ -- | The hledger web command. web :: WebOpts -> Journal -> IO () web opts j = do- let initq = _rsQuery . reportspec_ $ cliopts_ opts- j' = filterJournalTransactions initq j+ let depthlessinitialq = filterQuery (not . queryIsDepth) . _rsQuery . reportspec_ $ cliopts_ opts+ j' = filterJournalTransactions depthlessinitialq j h = host_ opts p = port_ opts u = base_url_ opts
Hledger/Web/Widget/Common.hs view
@@ -77,7 +77,7 @@ -- | Render a "BalanceReport" as html. balanceReportAsHtml :: Eq r => (r, r) -> r -> Bool -> Journal -> Text -> [QueryOpt] -> BalanceReport -> HtmlUrl r-balanceReportAsHtml (journalR, registerR) here hideEmpty j q qopts (items, total) =+balanceReportAsHtml (journalR, registerR) here hideEmpty j qparam qopts (items, total) = $(hamletFile "templates/balance-report.hamlet") where l = ledgerFromJournal Any j
hledger-web.1 view
@@ -1,5 +1,5 @@ -.TH "HLEDGER-WEB" "1" "April 2023" "hledger-web-1.29.2 " "hledger User Manuals"+.TH "HLEDGER-WEB" "1" "June 2023" "hledger-web-1.30 " "hledger User Manuals" @@ -8,22 +8,14 @@ hledger-web - robust, friendly plain text accounting (Web version) .SH SYNOPSIS .PP-\f[V]hledger-web [OPTIONS] # run temporarily & browse\f[R]-.PD 0-.P-.PD-\f[V]hledger-web --serve [OPTIONS] # run without stopping\f[R]-.PD 0-.P-.PD-\f[V]hledger-web --serve-api [OPTIONS] # run JSON server only\f[R]+\f[V]hledger-web [--serve|--serve-api] [OPTS] [ARGS]\f[R] .PD 0 .P .PD-\f[V]hledger web -- [OPTIONS] [QUERYARGS]\f[R] # start from hledger+\f[V]hledger web -- [--serve|--serve-api] [OPTS] [ARGS]\f[R] .SH DESCRIPTION .PP-This manual is for hledger\[aq]s web interface, version 1.29.2.+This manual is for hledger\[aq]s web interface, version 1.30. See also the hledger manual for common concepts and file formats. .PP hledger is a robust, user-friendly, cross-platform set of programs for@@ -47,12 +39,13 @@ instance, it writes a numbered backup of the main journal file (only) on every edit. .PP-Like hledger, it reads data from one or more files in journal,-timeclock, timedot, or CSV format.-The default file is \f[V].hledger.journal\f[R] in your home directory;-this can be overridden with one or more \f[V]-f FILE\f[R] options, or-the \f[V]LEDGER_FILE\f[R] environment variable.-For more about this see hledger(1).+Like hledger, it reads from (and appends to) a journal file specified by+the \f[V]LEDGER_FILE\f[R] environment variable (defaulting to+\f[V]$HOME/.hledger.journal\f[R]); or you can specify files with+\f[V]-f\f[R] options.+It can also read timeclock files, timedot files, or any CSV/SSV/TSV file+with a date field.+(See hledger(1) -> Input for details.) .PP hledger-web can be run in three modes: .IP \[bu] 2@@ -75,8 +68,7 @@ These filter options are not shown in the web UI, but it will be applied in addition to any search query entered there. .PP-Note: if invoking hledger-web as a hledger subcommand, write-\f[V]--\f[R] before options, as shown in the synopsis above.+hledger-web provides the following options: .TP \f[V]--serve\f[R] serve and log requests, don\[aq]t browse or auto-exit after timeout@@ -121,8 +113,65 @@ run hledger-web\[aq]s tests and exit. hspec test runner args may follow a --, eg: hledger-web --test -- --help .PP-hledger input options:+By default the server listens on IP address 127.0.0.1, accessible only+to local requests.+You can use \f[V]--host\f[R] to change this, eg \f[V]--host 0.0.0.0\f[R]+to listen on all configured addresses.+.PP+Similarly, use \f[V]--port\f[R] to set a TCP port other than 5000, eg if+you are running multiple hledger-web instances.+.PP+Both of these options are ignored when \f[V]--socket\f[R] is used.+In this case, it creates an \f[V]AF_UNIX\f[R] 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 authentication for different users.+The path can be derived in a predictable way, eg by using the username+within the path.+As an example, \f[V]nginx\f[R] as reverse proxy can use the variable+\f[V]$remote_user\f[R] to derive a path from the username used in a HTTP+basic authentication.+The following \f[V]proxy_pass\f[R] directive allows access to all+\f[V]hledger-web\f[R] instances that created a socket in+\f[V]/tmp/hledger/\f[R]:+.IP+.nf+\f[C]+ proxy_pass http://unix:/tmp/hledger/${remote_user}.socket;+\f[R]+.fi+.PP+You can use \f[V]--base-url\f[R] 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 \f[V]http://HOST:PORT/\f[R] using the server\[aq]s+configured host address and TCP port (or \f[V]http://HOST\f[R] if PORT+is 80).+.PP+With \f[V]--file-url\f[R] you can set a different base url for static+files, eg for better caching or cookie-less serving on high performance+websites.+.PP+hledger-web also supports many of hledger\[aq]s general options (and the+hledger manual\[aq]s command line tips also apply here):+.SS General help options .TP+\f[V]-h --help\f[R]+show general or COMMAND help+.TP+\f[V]--man\f[R]+show general or COMMAND user manual with man+.TP+\f[V]--info\f[R]+show general or COMMAND user manual with info+.TP+\f[V]--version\f[R]+show general or ADDONCMD version+.TP+\f[V]--debug[=N]\f[R]+show debug output (levels 1-9, default: 1)+.SS General input options+.TP \f[V]-f FILE --file=FILE\f[R] use a different input file. For stdin, use - (default: \f[V]$LEDGER_FILE\f[R] or@@ -149,8 +198,7 @@ .TP \f[V]-s --strict\f[R] do extra error checking (check that all posted accounts are declared)-.PP-hledger reporting options:+.SS General reporting options .TP \f[V]-b --begin=DATE\f[R] include postings/txns on or after this date (will be adjusted to@@ -217,17 +265,29 @@ \f[V]--value\f[R] convert amounts to cost or market value, more flexibly than -B/-V/-X .TP+\f[V]--infer-equity\f[R]+infer conversion equity postings from costs+.TP+\f[V]--infer-costs\f[R]+infer costs from conversion equity postings+.TP \f[V]--infer-market-prices\f[R]-use transaction prices (recorded with \[at] or \[at]\[at]) as additional-market prices, as if they were P directives+use costs as additional market prices, as if they were P directives .TP+\f[V]--forecast\f[R]+generate transactions from periodic rules,+between the latest recorded txn and 6 months from today,+or during the specified PERIOD (= is required).+Auto posting rules will be applied to these transactions as well.+Also, in hledger-ui make future-dated transactions visible.+.TP \f[V]--auto\f[R]-apply automated posting rules to modify transactions.+generate extra postings by applying auto posting rules to all txns (not+just forecast txns) .TP-\f[V]--forecast\f[R]-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.+\f[V]--verbose-tags\f[R]+add visible tags indicating transactions or postings which have been+generated/modified .TP \f[V]--commodity-style\f[R] Override the commodity style in the output for the specified commodity.@@ -254,66 +314,6 @@ last one takes precedence. .PP Some reporting options can also be written as query arguments.-.PP-hledger help options:-.TP-\f[V]-h --help\f[R]-show general or COMMAND help-.TP-\f[V]--man\f[R]-show general or COMMAND user manual with man-.TP-\f[V]--info\f[R]-show general or COMMAND user manual with info-.TP-\f[V]--version\f[R]-show general or ADDONCMD version-.TP-\f[V]--debug[=N]\f[R]-show debug output (levels 1-9, default: 1)-.PP-A \[at]FILE argument will be expanded to the contents of FILE, which-should contain one command line option/argument per line.-(To prevent this, insert a \f[V]--\f[R] argument before.)-.PP-By default the server listens on IP address 127.0.0.1, accessible only-to local requests.-You can use \f[V]--host\f[R] to change this, eg \f[V]--host 0.0.0.0\f[R]-to listen on all configured addresses.-.PP-Similarly, use \f[V]--port\f[R] to set a TCP port other than 5000, eg if-you are running multiple hledger-web instances.-.PP-Both of these options are ignored when \f[V]--socket\f[R] is used.-In this case, it creates an \f[V]AF_UNIX\f[R] 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 authentication for different users.-The path can be derived in a predictable way, eg by using the username-within the path.-As an example, \f[V]nginx\f[R] as reverse proxy can use the variable-\f[V]$remote_user\f[R] to derive a path from the username used in a HTTP-basic authentication.-The following \f[V]proxy_pass\f[R] directive allows access to all-\f[V]hledger-web\f[R] instances that created a socket in-\f[V]/tmp/hledger/\f[R]:-.IP-.nf-\f[C]- proxy_pass http://unix:/tmp/hledger/${remote_user}.socket;-\f[R]-.fi-.PP-You can use \f[V]--base-url\f[R] 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 \f[V]http://HOST:PORT/\f[R] using the server\[aq]s-configured host address and TCP port (or \f[V]http://HOST\f[R] if PORT-is 80).-.PP-With \f[V]--file-url\f[R] you can set a different base url for static-files, eg for better caching or cookie-less serving on high performance-websites. .SH PERMISSIONS .PP By default, hledger-web allows anyone who can reach it to view the@@ -611,78 +611,19 @@ \f[V]hledger-web --debug=3 2>hledger-web.log\f[R]. .SH ENVIRONMENT .PP-\f[B]LEDGER_FILE\f[R] The journal file path when not specified with-\f[V]-f\f[R].-.PP-On unix computers, the default value is:-\f[V]\[ti]/.hledger.journal\f[R].-.PP-A more typical value is something like-\f[V]\[ti]/finance/YYYY.journal\f[R], where \f[V]\[ti]/finance\f[R] is a-version-controlled finance directory and YYYY is the current year.-Or, \f[V]\[ti]/finance/current.journal\f[R], where current.journal is a-symbolic link to YYYY.journal.-.PP-The usual way to set this permanently is to add a command to one of your-shell\[aq]s startup files (eg \f[V]\[ti]/.profile\f[R]):-.IP-.nf-\f[C]-export LEDGER_FILE=\[ti]/finance/current.journal\[ga]-\f[R]-.fi-.PP-On some Mac computers, there is a more thorough way to set environment-variables, that will also affect applications started from the GUI (eg,-Emacs started from a dock icon): In-\f[V]\[ti]/.MacOSX/environment.plist\f[R], add an entry like:-.IP-.nf-\f[C]-{- \[dq]LEDGER_FILE\[dq] : \[dq]\[ti]/finance/current.journal\[dq]-}-\f[R]-.fi-.PP-For this to take effect you might need to \f[V]killall Dock\f[R], or-reboot.-.PP-On Windows computers, the default value is probably-\f[V]C:\[rs]Users\[rs]YOURNAME\[rs].hledger.journal\f[R].-You can change this by running a command like this in a powershell-window (let us know if you need to be an Administrator, and if this-persists across a reboot):-.IP-.nf-\f[C]-> setx LEDGER_FILE \[dq]C:\[rs]Users\[rs]MyUserName\[rs]finance\[rs]2021.journal\[dq]-\f[R]-.fi-.PP-Or, change it in settings: see-https://www.java.com/en/download/help/path.html.-.SH FILES-.PP-Reads data from one or more files in journal, timeclock, timedot, or CSV-format.-The default file is \f[V].hledger.journal\f[R] in your home directory;-this can be overridden with one or more \f[V]-f FILE\f[R] options, or-the \f[V]LEDGER_FILE\f[R] environment variable.+\f[B]LEDGER_FILE\f[R] The main journal file to use when not specified+with \f[V]-f/--file\f[R].+Default: \f[V]$HOME/.hledger.journal\f[R]. .SH BUGS .PP-\f[V]-f-\f[R] doesn\[aq]t work (hledger-web can\[aq]t read from stdin).-.PP-Query arguments and some hledger options are ignored.+We welcome bug reports in the hledger issue tracker (shortcut:+http://bugs.hledger.org), or on the #hledger chat or hledger mail list+(https://hledger.org/support). .PP-Does not work in text-mode browsers.+Some known issues: .PP-Does not work well on small screens.-+Does not work well on small screens, or in text-mode browsers. -.SH "REPORTING BUGS"-Report bugs at http://bugs.hledger.org-(or on the #hledger chat or hledger mail list) .SH AUTHORS Simon Michael <simon@joyful.com> and contributors.
hledger-web.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: hledger-web-version: 1.29.2+version: 1.30 synopsis: Web-based user interface for the hledger accounting system description: A simple web-based user interface for the hledger accounting system, providing a more modern UI than the command-line or terminal interfaces.@@ -151,7 +151,7 @@ hs-source-dirs: ./ ghc-options: -Wall -Wredundant-constraints -Wincomplete-record-updates -Wincomplete-uni-patterns- cpp-options: -DVERSION="1.29.2"+ cpp-options: -DVERSION="1.30" build-depends: Decimal >=0.5.1 , aeson >=1@@ -171,8 +171,8 @@ , extra >=1.6.3 , filepath , hjsmin- , hledger >=1.29.2 && <1.30- , hledger-lib >=1.29.2 && <1.30+ , hledger ==1.30.*+ , hledger-lib ==1.30.* , hspec , http-client , http-conduit@@ -212,7 +212,7 @@ hs-source-dirs: app ghc-options: -Wall -Wredundant-constraints -Wincomplete-record-updates -Wincomplete-uni-patterns- cpp-options: -DVERSION="1.29.2"+ cpp-options: -DVERSION="1.30" build-depends: base >=4.14 && <4.19 , hledger-web@@ -232,7 +232,7 @@ hs-source-dirs: test ghc-options: -Wall -Wredundant-constraints -Wincomplete-record-updates -Wincomplete-uni-patterns- cpp-options: -DVERSION="1.29.2"+ cpp-options: -DVERSION="1.30" build-depends: base >=4.14 && <4.19 , hledger
hledger-web.info view
@@ -13,12 +13,10 @@ hledger-web - robust, friendly plain text accounting (Web version) - 'hledger-web [OPTIONS] # run temporarily & browse'-'hledger-web --serve [OPTIONS] # run without stopping'-'hledger-web --serve-api [OPTIONS] # run JSON server only'-'hledger web -- [OPTIONS] [QUERYARGS]' # start from hledger+ 'hledger-web [--serve|--serve-api] [OPTS] [ARGS]'+'hledger web -- [--serve|--serve-api] [OPTS] [ARGS]' - This manual is for hledger's web interface, version 1.29.2. See also+ This manual is for hledger's web interface, version 1.30. See also the hledger manual for common concepts and file formats. hledger is a robust, user-friendly, cross-platform set of programs@@ -39,11 +37,11 @@ against data loss when running an unprotected instance, it writes a numbered backup of the main journal file (only) on every edit. - Like hledger, it reads data from one or more files in journal,-timeclock, timedot, or CSV format. The default file is-'.hledger.journal' in your home directory; this can be overridden with-one or more '-f FILE' options, or the 'LEDGER_FILE' environment-variable. For more about this see hledger(1).+ Like hledger, it reads from (and appends to) a journal file specified+by the 'LEDGER_FILE' environment variable (defaulting to+'$HOME/.hledger.journal'); or you can specify files with '-f' options.+It can also read timeclock files, timedot files, or any CSV/SSV/TSV file+with a date field. (See hledger(1) -> Input for details.) hledger-web can be run in three modes: @@ -69,7 +67,6 @@ * JSON API:: * DEBUG OUTPUT:: * ENVIRONMENT::-* FILES:: * BUGS:: @@ -82,8 +79,7 @@ on the data. These filter options are not shown in the web UI, but it will be applied in addition to any search query entered there. - Note: if invoking hledger-web as a hledger subcommand, write '--'-before options, as shown in the synopsis above.+ hledger-web provides the following options: '--serve' @@ -127,8 +123,73 @@ run hledger-web's tests and exit. hspec test runner args may follow a -, eg: hledger-web -test - -help - hledger input options:+ 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 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 authentication+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+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 that appear in hyperlinks, useful eg for integrating hledger-web+within 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 for better caching or cookie-less serving on high performance+websites.++ hledger-web also supports many of hledger's general options (and the+hledger manual's command line tips also apply here):++* Menu:++* General help options::+* General input options::+* General reporting options::+++File: hledger-web.info, Node: General help options, Next: General input options, Up: OPTIONS++1.1 General help options+========================++'-h --help'++ show general or COMMAND help+'--man'++ show general or COMMAND user manual with man+'--info'++ show general or COMMAND user manual with info+'--version'++ show general or ADDONCMD version+'--debug[=N]'++ show debug output (levels 1-9, default: 1)+++File: hledger-web.info, Node: General input options, Next: General reporting options, Prev: General help options, Up: OPTIONS++1.2 General input options+=========================+ '-f FILE --file=FILE' use a different input file. For stdin, use - (default:@@ -157,8 +218,12 @@ do extra error checking (check that all posted accounts are declared) - hledger reporting options:++File: hledger-web.info, Node: General reporting options, Prev: General input options, Up: OPTIONS +1.3 General reporting options+=============================+ '-b --begin=DATE' include postings/txns on or after this date (will be adjusted to@@ -227,18 +292,30 @@ convert amounts to cost or market value, more flexibly than -B/-V/-X+'--infer-equity'++ infer conversion equity postings from costs+'--infer-costs'++ infer costs from conversion equity postings '--infer-market-prices' - use transaction prices (recorded with @ or @@) as additional market- prices, as if they were P directives+ use costs as additional market prices, as if they were P directives+'--forecast'++ generate transactions from periodic rules, between the latest+ recorded txn and 6 months from today, or during the specified+ PERIOD (= is required). Auto posting rules will be applied to+ these transactions as well. Also, in hledger-ui make future-dated+ transactions visible. '--auto' - apply automated posting rules to modify transactions.-'--forecast'+ generate extra postings by applying auto posting rules to all txns+ (not just forecast txns)+'--verbose-tags' - 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.+ add visible tags indicating transactions or postings which have+ been generated/modified '--commodity-style' Override the commodity style in the output for the specified@@ -262,58 +339,6 @@ Some reporting options can also be written as query arguments. - hledger help options:--'-h --help'-- show general or COMMAND help-'--man'-- show general or COMMAND user manual with man-'--info'-- show general or COMMAND user manual with info-'--version'-- show general or ADDONCMD version-'--debug[=N]'-- 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, insert a '--' argument before.)-- 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 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 authentication-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-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 that appear in hyperlinks, useful eg for integrating hledger-web-within 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 for better caching or cookie-less serving on high performance-websites.- File: hledger-web.info, Node: PERMISSIONS, Next: EDITING UPLOADING DOWNLOADING, Prev: OPTIONS, Up: Top @@ -596,94 +621,55 @@ 'hledger-web --debug=3 2>hledger-web.log'. -File: hledger-web.info, Node: ENVIRONMENT, Next: FILES, Prev: DEBUG OUTPUT, Up: Top+File: hledger-web.info, Node: ENVIRONMENT, Next: BUGS, Prev: DEBUG OUTPUT, Up: Top 7 ENVIRONMENT ************* -*LEDGER_FILE* The journal file path when not specified with '-f'.-- On unix computers, the default value is: '~/.hledger.journal'.-- A more typical value is something like '~/finance/YYYY.journal',-where '~/finance' is a version-controlled finance directory and YYYY is-the current year. Or, '~/finance/current.journal', where-current.journal is a symbolic link to YYYY.journal.-- The usual way to set this permanently is to add a command to one of-your shell's startup files (eg '~/.profile'):--export LEDGER_FILE=~/finance/current.journal`-- On some Mac computers, there is a more thorough way to set-environment variables, that will also affect applications started from-the GUI (eg, Emacs started from a dock icon): In-'~/.MacOSX/environment.plist', add an entry like:--{- "LEDGER_FILE" : "~/finance/current.journal"-}-- For this to take effect you might need to 'killall Dock', or reboot.-- On Windows computers, the default value is probably-'C:\Users\YOURNAME\.hledger.journal'. You can change this by running a-command like this in a powershell window (let us know if you need to be-an Administrator, and if this persists across a reboot):--> setx LEDGER_FILE "C:\Users\MyUserName\finance\2021.journal"-- Or, change it in settings: see-https://www.java.com/en/download/help/path.html.---File: hledger-web.info, Node: FILES, Next: BUGS, Prev: ENVIRONMENT, Up: Top--8 FILES-*******--Reads data from one or more files in journal, timeclock, timedot, or CSV-format. The default file is '.hledger.journal' in your home directory;-this can be overridden with one or more '-f FILE' options, or the-'LEDGER_FILE' environment variable.+*LEDGER_FILE* The main journal file to use when not specified with+'-f/--file'. Default: '$HOME/.hledger.journal'. -File: hledger-web.info, Node: BUGS, Prev: FILES, Up: Top+File: hledger-web.info, Node: BUGS, Prev: ENVIRONMENT, Up: Top -9 BUGS+8 BUGS ****** -'-f-' doesn't work (hledger-web can't read from stdin).-- Query arguments and some hledger options are ignored.+We welcome bug reports in the hledger issue tracker (shortcut:+http://bugs.hledger.org), or on the #hledger chat or hledger mail list+(https://hledger.org/support). - Does not work in text-mode browsers.+ Some known issues: - Does not work well on small screens.+ Does not work well on small screens, or in text-mode browsers. Tag Table: Node: Top225-Node: OPTIONS2682-Ref: #options2787-Node: PERMISSIONS10224-Ref: #permissions10363-Node: EDITING UPLOADING DOWNLOADING11575-Ref: #editing-uploading-downloading11756-Node: RELOADING12590-Ref: #reloading12724-Node: JSON API13157-Ref: #json-api13272-Node: DEBUG OUTPUT18760-Ref: #debug-output18885-Node: Debug output18912-Ref: #debug-output-119013-Node: ENVIRONMENT19430-Ref: #environment19550-Node: FILES20861-Ref: #files20961-Node: BUGS21209-Ref: #bugs21287+Node: OPTIONS2577+Ref: #options2682+Node: General help options5993+Ref: #general-help-options6143+Node: General input options6425+Ref: #general-input-options6611+Node: General reporting options7313+Ref: #general-reporting-options7478+Node: PERMISSIONS10868+Ref: #permissions11007+Node: EDITING UPLOADING DOWNLOADING12219+Ref: #editing-uploading-downloading12400+Node: RELOADING13234+Ref: #reloading13368+Node: JSON API13801+Ref: #json-api13916+Node: DEBUG OUTPUT19404+Ref: #debug-output19529+Node: Debug output19556+Ref: #debug-output-119657+Node: ENVIRONMENT20074+Ref: #environment20193+Node: BUGS20310+Ref: #bugs20394 End Tag Table
hledger-web.txt view
@@ -7,18 +7,16 @@ hledger-web - robust, friendly plain text accounting (Web version) SYNOPSIS- hledger-web [OPTIONS] # run temporarily & browse- hledger-web --serve [OPTIONS] # run without stopping- hledger-web --serve-api [OPTIONS] # run JSON server only- hledger web -- [OPTIONS] [QUERYARGS] # start from hledger+ hledger-web [--serve|--serve-api] [OPTS] [ARGS]+ hledger web -- [--serve|--serve-api] [OPTS] [ARGS] DESCRIPTION- This manual is for hledger's web interface, version 1.29.2. See also- the hledger manual for common concepts and file formats.+ This manual is for hledger's web interface, version 1.30. See also the+ hledger manual for common concepts and file formats. hledger is a robust, user-friendly, cross-platform set of programs for- tracking money, time, or any other commodity, using double-entry- accounting and a simple, editable file format. hledger is inspired by+ tracking money, time, or any other commodity, using double-entry ac-+ counting and a simple, editable file format. hledger is inspired by and largely compatible with ledger(1), and largely interconvertible with beancount(1). @@ -34,11 +32,11 @@ against data loss when running an unprotected instance, it writes a numbered backup of the main journal file (only) on every edit. - Like hledger, it reads data from one or more files in journal, time-- clock, timedot, or CSV format. The default file is .hledger.journal in- your home directory; this can be overridden with one or more -f FILE- options, or the LEDGER_FILE environment variable. For more about this- see hledger(1).+ Like hledger, it reads from (and appends to) a journal file specified+ by the LEDGER_FILE environment variable (defaulting to+ $HOME/.hledger.journal); or you can specify files with -f options. It+ can also read timeclock files, timedot files, or any CSV/SSV/TSV file+ with a date field. (See hledger(1) -> Input for details.) hledger-web can be run in three modes: @@ -60,14 +58,13 @@ on the data. These filter options are not shown in the web UI, but it will be applied in addition to any search query entered there. - Note: if invoking hledger-web as a hledger subcommand, write -- before- options, as shown in the synopsis above.+ hledger-web provides the following options: --serve serve and log requests, don't browse or auto-exit after timeout --serve-api- like --serve, but serve only the JSON web API, without the+ like --serve, but serve only the JSON web API, without the server-side web UI --host=IPADDR@@ -77,34 +74,78 @@ listen on this TCP port (default: 5000) --socket=SOCKETFILE- use a unix domain socket file to listen for requests instead of- a TCP socket. Implies --serve. It can only be used if the- operating system can provide this type of socket.+ use a unix domain socket file to listen for requests instead of+ a TCP socket. Implies --serve. It can only be used if the op-+ erating system can provide this type of socket. --base-url=URL- set the base url (default: http://IPADDR:PORT). Note: affects- url generation but not route parsing. Can be useful if running+ set the base url (default: http://IPADDR:PORT). Note: affects+ url generation but not route parsing. Can be useful if running behind a reverse web proxy that does path rewriting. --file-url=URL set the static files url (default: BASEURL/static). hledger-web- normally serves static files itself, but if you wanted to serve- them from another server for efficiency, you would set the url+ normally serves static files itself, but if you wanted to serve+ them from another server for efficiency, you would set the url with this. --capabilities=CAP[,CAP..]- enable the view, add, and/or manage capabilities (default:+ enable the view, add, and/or manage capabilities (default: view,add) --capabilities-header=HTTPHEADER- read capabilities to enable from a HTTP header, like X-Sand-+ read capabilities to enable from a HTTP header, like X-Sand- storm-Permissions (default: disabled) - --test run hledger-web's tests and exit. hspec test runner args may+ --test run hledger-web's tests and exit. hspec test runner args may follow a --, eg: hledger-web --test -- --help - hledger input options:+ 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+ 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+ 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+ 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+ that appear in hyperlinks, useful eg for integrating hledger-web within+ 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+ for better caching or cookie-less serving on high performance websites.++ hledger-web also supports many of hledger's general options (and the+ hledger manual's command line tips also apply here):++ General help options+ -h --help+ show general or COMMAND help++ --man show general or COMMAND user manual with man++ --info show general or COMMAND user manual with info++ --version+ show general or ADDONCMD version++ --debug[=N]+ show debug output (levels 1-9, default: 1)++ General input options -f FILE --file=FILE use a different input file. For stdin, use - (default: $LEDGER_FILE or $HOME/.hledger.journal)@@ -129,11 +170,10 @@ assignments) -s --strict- do extra error checking (check that all posted accounts are- declared)-- hledger reporting options:+ do extra error checking (check that all posted accounts are de-+ clared) + General reporting options -b --begin=DATE include postings/txns on or after this date (will be adjusted to preceding subperiod start when using a report interval)@@ -162,8 +202,8 @@ using period expressions syntax --date2- match the secondary date instead (see command help for other- effects)+ match the secondary date instead (see command help for other ef-+ fects) --today=DATE override today's date (affects relative smart dates, for@@ -192,42 +232,55 @@ convert amounts to their cost/selling amount at transaction time -V --market- convert amounts to their market value in default valuation com-+ convert amounts to their market value in default valuation com- modities -X --exchange=COMM convert amounts to their market value in commodity COMM --value- convert amounts to cost or market value, more flexibly than+ convert amounts to cost or market value, more flexibly than -B/-V/-X - --infer-market-prices- use transaction prices (recorded with @ or @@) as additional- market prices, as if they were P directives+ --infer-equity+ infer conversion equity postings from costs - --auto apply automated posting rules to modify transactions.+ --infer-costs+ infer costs from conversion equity postings + --infer-market-prices+ use costs as additional market prices, as if they were P direc-+ tives+ --forecast- 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.+ generate transactions from periodic rules, between the latest+ recorded txn and 6 months from today, or during the specified+ PERIOD (= is required). Auto posting rules will be applied to+ these transactions as well. Also, in hledger-ui make future-+ dated transactions visible. + --auto generate extra postings by applying auto posting rules to all+ txns (not just forecast txns)++ --verbose-tags+ add visible tags indicating transactions or postings which have+ been generated/modified+ --commodity-style- Override the commodity style in the output for the specified+ 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. --pretty[=WHEN]- Show prettier output, e.g. using unicode box-drawing charac-- ters. Accepts 'yes' (the default) or 'no' ('y', 'n', 'always',- 'never' also work). If you provide an argument you must use+ Show prettier output, e.g. using unicode box-drawing charac-+ ters. Accepts 'yes' (the default) or 'no' ('y', 'n', 'always',+ 'never' also work). If you provide an argument you must use '=', e.g. '--pretty=yes'. When a reporting option appears more than once in the command line, the@@ -235,53 +288,6 @@ Some reporting options can also be written as query arguments. - hledger help options:-- -h --help- show general or COMMAND help-- --man show general or COMMAND user manual with man-- --info show general or COMMAND user manual with info-- --version- show general or ADDONCMD version-- --debug[=N]- 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,- insert a -- argument before.)-- 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- 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- 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- 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- that appear in hyperlinks, useful eg for integrating hledger-web within- 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- 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 journal and to add new transactions, but not to change existing data.@@ -289,8 +295,8 @@ 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- machine.+ it listens on 127.0.0.1, accessible to all users on the local ma-+ chine. o putting it behind an authenticating proxy, using eg apache or nginx @@ -306,8 +312,8 @@ o add - allows adding new transactions to the main journal file - o manage - allows editing, uploading or downloading the main or- included files+ o manage - allows editing, uploading or downloading the main or in-+ cluded files o using the --capabilities-header=HTTPHEADER flag to specify a HTTP header from which it will read capabilities to enable. hledger-web@@ -317,8 +323,8 @@ 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- includes.+ let you edit, upload, or download the journal file or any files it in-+ cludes. Note, unlike any other hledger command, in this mode you (or any visi- tor) can alter or wipe the data files.@@ -337,8 +343,8 @@ 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- until the file has been fixed.+ makes a file unparseable, hledger-web will display an error message un-+ til 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.)@@ -405,15 +411,15 @@ 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 docs.+ on the various data types, eg Transaction. And for a higher level un-+ derstanding, see the journal docs. 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- for /accounttransactions it's getAccounttransactionsR, returning a- "accountTransactionsReport ...". Looking up the haddock for that we- can see that /accounttransactions returns an AccountTransactionsReport,+ for /accounttransactions it's getAccounttransactionsR, returning a "ac-+ countTransactionsReport ...". 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- portItem (etc). @@ -517,8 +523,8 @@ "tstatus": "Unmarked" } - And here's how to test adding it with curl. This should add a new- entry to your journal:+ And here's how to test adding it with curl. This should add a new en-+ try to your journal: $ curl http://127.0.0.1:5000/add -X PUT -H 'Content-Type: application/json' --data-binary @txn.json @@ -533,63 +539,20 @@ hledger-web --debug=3 2>hledger-web.log. ENVIRONMENT- LEDGER_FILE The journal file path when not specified with -f.-- On unix computers, the default value is: ~/.hledger.journal.-- A more typical value is something like ~/finance/YYYY.journal, where- ~/finance is a version-controlled finance directory and YYYY is the- current year. Or, ~/finance/current.journal, where current.journal is- a symbolic link to YYYY.journal.-- The usual way to set this permanently is to add a command to one of- your shell's startup files (eg ~/.profile):-- export LEDGER_FILE=~/finance/current.journal`-- On some Mac computers, there is a more thorough way to set environment- variables, that will also affect applications started from the GUI (eg,- Emacs started from a dock icon): In ~/.MacOSX/environment.plist, add an- entry like:-- {- "LEDGER_FILE" : "~/finance/current.journal"- }-- For this to take effect you might need to killall Dock, or reboot.-- On Windows computers, the default value is probably C:\Users\YOUR-- NAME\.hledger.journal. You can change this by running a command like- this in a powershell window (let us know if you need to be an Adminis-- trator, and if this persists across a reboot):-- > setx LEDGER_FILE "C:\Users\MyUserName\finance\2021.journal"-- Or, change it in settings: see https://www.java.com/en/down-- load/help/path.html.--FILES- Reads data from one or more files in journal, timeclock, timedot, or- CSV format. The default file is .hledger.journal in your home direc-- tory; this can be overridden with one or more -f FILE options, or the- LEDGER_FILE environment variable.+ LEDGER_FILE The main journal file to use when not specified with+ -f/--file. Default: $HOME/.hledger.journal. BUGS- -f- doesn't work (hledger-web can't read from stdin).-- Query arguments and some hledger options are ignored.+ We welcome bug reports in the hledger issue tracker (shortcut:+ http://bugs.hledger.org), or on the #hledger chat or hledger mail list+ (https://hledger.org/support). - Does not work in text-mode browsers.+ Some known issues: - Does not work well on small screens.+ Does not work well on small screens, or in text-mode browsers. -REPORTING BUGS- Report bugs at http://bugs.hledger.org (or on the #hledger chat or- hledger mail list)-- AUTHORS Simon Michael <simon@joyful.com> and contributors. See http://hledger.org/CREDITS.html@@ -608,4 +571,4 @@ -hledger-web-1.29.2 April 2023 HLEDGER-WEB(1)+hledger-web-1.30 June 2023 HLEDGER-WEB(1)
templates/balance-report.hamlet view
@@ -11,11 +11,11 @@ <td .acct :not (isInterestingAccount acct):.empty> <div .ff-wrapper> \#{indent aindent}- <a.acct-name href="@?{(registerR, [("q", replaceInacct q $ accountQuery acct)])}"+ <a.acct-name href="@?{(registerR, [("q", replaceInacct qparam $ accountQuery acct)])}" title="Show transactions affecting this account and subaccounts"> #{adisplay} $if hasSubAccounts acct- <a href="@?{(registerR, [("q", replaceInacct q $ accountOnlyQuery acct)])}" .only.hidden-sm.hidden-xs+ <a href="@?{(registerR, [("q", replaceInacct qparam $ accountOnlyQuery acct)])}" .only.hidden-sm.hidden-xs title="Show transactions affecting this account but not subaccounts">only <td> ^{mixedAmountAsHtml abal}
templates/default-layout.hamlet view
@@ -17,10 +17,10 @@ <div #message .alert.alert-info>#{m} $if elem CapView caps <form#searchform.input-group method=GET>- <input .form-control name=q value=#{q} placeholder="Search"+ <input .form-control name=q value=#{qparam} placeholder="Search" title="Enter hledger search patterns to filter the data below"> <div .input-group-btn>- $if not (T.null q)+ $if not (T.null qparam) <a href=@{here} .btn .btn-default title="Clear search terms"> <span .glyphicon .glyphicon-remove-circle> <button .btn .btn-default type=submit title="Apply search terms">
templates/register.hamlet view
@@ -2,7 +2,7 @@ #{header} <div .hidden-xs>- ^{registerChartHtml q balancelabel $ accountTransactionsReportByCommodity items}+ ^{registerChartHtml qparam balancelabel $ accountTransactionsReportByCommodity items} <div.table-responsive> <table .table.table-striped.table-condensed>@@ -21,7 +21,7 @@ $forall (torig, tacct, split, _acct, amt, bal) <- items <tr ##{tindex torig} title="#{showTransaction torig}" style="vertical-align:top;"> <td .date>- <a href="@?{(JournalR, [("q", T.unwords $ removeInacct q)])}##{transactionFrag torig}">+ <a href="@?{(JournalR, [("q", T.unwords $ removeInacct qparam)])}##{transactionFrag torig}"> #{show (tdate tacct)} <td> #{textElideRight 30 (tdescription tacct)}