Commit Graph

1947 Commits

Author SHA1 Message Date
Simon Michael
f8cc9cdb4d ;dev: document runPager's behaviour precisely 2024-10-20 08:10:07 -10:00
Simon Michael
7325b75d5b imp: rename ghcdebug build flag to debug, and enable stack traces with it
Builds made with ghc 9.10+ and the 'debug' build flag, will show
(some kind of, partial) stack traces when the program ends with an
error. (And also will have ghc-debug support enabled.)

The stack traces will probably improve in due course.
2024-10-19 18:47:03 -10:00
Simon Michael
b6a5687a38 imp: cli, web: disable ghc 9.10+'s stack traces here too
Starting to see them also from hledger now.
2024-10-19 18:33:58 -10:00
Simon Michael
d2344c119d ;doc: update help 2024-10-19 17:06:06 -10:00
Simon Michael
6893f342af imp: cli,ui,web: begin controlling GHC 9.10+'s stack traces 2024-10-19 16:56:14 -10:00
Simon Michael
a925e73b53 imp:cli: handle -NUM in config file properly 2024-10-19 16:56:14 -10:00
Simon Michael
576417655c dev: fix stray empty strings in builtinCommandNames 2024-10-19 16:56:14 -10:00
Henning Thielemann
cc58ac7bf5 cli: Commands.Print.transactionToSpreadsheet: vertically merge common index, date, description and other cells 2024-10-19 16:52:54 -10:00
Henning Thielemann
8b391e2a07 cli: Commands.Print: add export to FODS and HTML
use common Spreadsheet framework for CSV export, too
2024-10-19 16:52:54 -10:00
Henning Thielemann
6773bf0974 cli: Commands.Register: add HTML and FODS to outputFormatFlag 2024-10-19 16:49:24 -10:00
Henning Thielemann
e144ad4ccd cli: Cli.Commands.Balance: give table names according to report type 2024-10-19 16:49:24 -10:00
Simon Michael
b940254025 imp:cli: detect --color more safely in most cases
--color now also works in a config file, like --pager, except for two
cases: it does not affect colouring of debug output, or the colouring
helpers used in the check recentassertions error message.
2024-10-19 16:28:36 -10:00
Simon Michael
711d921774 imp:cli: --no-pager -> --pager, make this and --color safe options 2024-10-19 16:28:36 -10:00
Simon Michael
7fee69d7ab imp:cli: deprecate always/never --color values (though still support) 2024-10-19 16:28:36 -10:00
Simon Michael
66df5ed40f imp: expose config file args to getArgs; make --no-pager work there 2024-10-19 16:28:36 -10:00
Simon Michael
18dceef1ce imp:cli: move --no-pager/--color to the help flags, available everywhere 2024-10-19 16:28:36 -10:00
Simon Michael
ba786752d1 imp📟 add a --no-pager general flag 2024-10-19 16:28:36 -10:00
Simon Michael
db748465a8 fix📟 when the $PAGER is not in PATH, print instead of failing 2024-10-19 16:28:36 -10:00
Simon Michael
4441680d7b fix:lib:Hledger.Utils.IO.pager: avoid a crash; avoid an extra newline 2024-10-19 16:28:36 -10:00
Simon Michael
3b7420b97c feat: use a pager for all large terminal output, not just for help 2024-10-19 16:28:36 -10:00
Henning Thielemann
86c3d7d656 cli: Commands.Register: support hyperlinks to hledger-web in HTML and FODS output
new option --base-url as in `balance` et.al.

Cli.Anchor: new module initialized with functions from Commands.Balance
2024-10-18 00:07:11 -10:00
Henning Thielemann
96e0500ea7 cli: Commands.Register.postingsReportItemAsRecord: format transaction index as integer
lib: Write.Spreadsheet.Type: new TypeInteger
2024-10-18 00:07:11 -10:00
Henning Thielemann
b23753f5ae cli: Commands.Register.postingsReportItemAsRecord: export amounts as number plus commodity
lib: Write.Spreadsheet.cellFromMixedAmount, cellsFromMixedAmount: taken from Cli.Balance
2024-10-18 00:07:11 -10:00
Henning Thielemann
991c56caef cli: Commands.Register.postingsReportAsSpreadsheet: generalize CSV output to HTML and FODS 2024-10-18 00:07:11 -10:00
Simon Michael
b1677e8b2c ;doc: update help 2024-10-15 16:36:54 -10:00
Henning Thielemann
49f1af04ef cli: CompoundBalance.compoundBalanceReportAsSpreadsheet: somehow support layout tidy
However, it is not quite correct since it contains totals and net values.
2024-10-15 14:13:53 -10:00
Henning Thielemann
270360a103 cli: Commands.Balance: hide total rows for all output formats for layout=tidy 2024-10-15 14:13:53 -10:00
Henning Thielemann
fa58dc11f4 cli: Commands.Balance: remove lambda on ropts1 for balanceReport*
This is consistent with the calls to multiBalanceReport* and budgetReport*.
2024-10-15 14:13:53 -10:00
Henning Thielemann
9d1ba5c588 cli: CompoundBalanceCommand.compoundBalanceReportAsSpreadsheet: common function for CSV, HTML, FODS export 2024-10-14 20:59:51 -10:00
Henning Thielemann
b8497c830e lib: Write.Spreadsheet.headerCell, addRowSpanHeader, rawTableContent: taken from Commands.Balance 2024-10-14 11:35:12 -10:00
Henning Thielemann
b8570c2aa0 cli: Commands.Balance.headerCell: do not automatically add a bottom border anymore
addHeaderBorders: do it explicitly
2024-10-14 11:35:12 -10:00
Henning Thielemann
dce24ea08f cli: Commands.Balance: remove some trailing spaces and unnecessary parentheses 2024-10-14 11:35:12 -10:00
Henning Thielemann
4d88b47aa7 cli: CompoundBalanceCommand: use List.foldl' with qualification
no need for import guarded by CPP
2024-10-14 11:35:12 -10:00
Henning Thielemann
746c927cee cli: Cli.CompoundBalanceCommand.compoundBalanceReportAsHtml.headerrow: collect all column headers
colspanattr: count those headers
This way, we can assert that colspanattr covers all columns.
2024-10-14 11:35:12 -10:00
Henning Thielemann
2122444c4b cli: Cli.Commands.Balance.multiBalanceReportAsSpreadsheetParts: parameter ishtml::Bool -> fmt::AmountFormat
arguments machineFmt, oneLineNoCostFmt are more descriptive than False, True
2024-10-14 11:35:12 -10:00
Henning Thielemann
2fd2110f3d cli: Cli.Commands.Balance.multiBalanceReportHtmlRows: removed
export multiBalanceReportAsSpreadsheetParts for use in compoundBalanceReportAsHtml
2024-10-14 11:35:12 -10:00
Simon Michael
7ac154e0b8 dev: cli: fix recent command parsing breakage; more tests 2024-10-14 09:12:59 -10:00
Simon Michael
b71634a4ee dev: notes, debug output tweaks 2024-10-14 09:12:59 -10:00
Simon Michael
c6bc020609 fix:cli: don't ignore first cli arg when there's a conf command arg 2024-10-12 21:33:06 -10:00
Simon Michael
d2feaf6f97 imp: cli: a little less flag-moving debug output 2024-10-12 13:35:15 -10:00
Simon Michael
e2599e85a4 fix:cli: order of last flag could be lost, disrupting --no-conf eg
Move pre-command flags more carefully, including the last one,
so that the relative order of options is preserved.
(This caused --conf foo --no-conf to sometimes ignore the --no-conf.)
Debug output has also been improved.
2024-10-12 13:23:49 -10:00
Simon Michael
21e27a0283 imp: avoid ugly GHC 9.10.1 stack trace with nonexistent --conf file 2024-10-12 12:14:21 -10:00
Simon Michael
2db4b8ed56 imp: cli: improve debug output for finding config file 2024-10-12 11:28:13 -10:00
Simon Michael
46897cd30b imp: cli: config files can now provide the command name
If the first thing in a config file's general section is a non-flag
argument, that will be used as the command name argument,
taking precedence over any command line arguments.
2024-10-12 10:38:35 -10:00
Simon Michael
a928ed994b dev: cli: command line processing clarifications 2024-10-12 08:03:07 -10:00
Dmitry Astapov
92f022dee4 ;lib: export budgetReportAs* functions (to use in scripts) 2024-10-11 14:55:35 -10:00
Simon Michael
66fce53c0b dev: extract beancount output helpers to Hledger.Write.Beancount 2024-10-10 23:25:07 -10:00
Simon Michael
a6a1b2c28e dev:bal: multiperiod balance now has two hledger.css links, fix 2024-10-10 22:00:27 -10:00
Henning Thielemann
6b5a158935 cli: CompoundBalanceCommand: row_total_ -> multiBalanceHasTotalsColumn (bugfix)
This way, total column header is not shown in balancesheet.
This is consistent with table data and with compoundBalanceReportAsText.
2024-10-09 08:52:28 -10:00
Simon Michael
4e6f6611a6 dev: fix DisplayName's off-by-one indent value, noted in #2246
Now displayIndent (and prrIndent) 0 means no indent, 1 means one
indent step, etc.
2024-10-08 23:11:57 -10:00
Simon Michael
05fd8e1d69 dev: refactor 2024-10-08 23:11:57 -10:00
Simon Michael
6ce5e85e99 dev: clarify: rename displayDepth/prrDepth to displayIndent/prrIndent
These are about indentation for rendering, not account depth;
these are not always directly related, eg when boring parents are elided.
2024-10-08 23:11:57 -10:00
Henning Thielemann
ccc605a6a0 cli: Cli.Commands.Balance.renderBalanceAcct: respect that depth is zero-based here (bugfix)
The depth in BalanceReportItem is zero-based,
whereas prrDepth in PeriodicReportRow DisplayName is one-based.
2024-10-08 23:07:07 -10:00
Henning Thielemann
6b0cca4fa8 cli: Cli.Commands.Balance.budgetReportAsSpreadsheet: support for tree mode
use renderPeriodicAcct
2024-10-08 23:07:07 -10:00
Henning Thielemann
e21a8e6d76 cli: Cli.Commands.Balance: use normal space for indentation in text output format 2024-10-08 23:07:07 -10:00
Henning Thielemann
3e2685fe95 cli: Cli.Commands.Balance: support tree mode for HTML, CSV and FODS output
indentation using non-breakable space character
2024-10-08 23:07:07 -10:00
Simon Michael
b9426616f7 ;doc: bal: improve --layout doc 2024-10-03 22:57:59 -10:00
Henning Thielemann
eeb070195c cli: Cli.Commands.Balance.multiBalanceReportAsHtml: now uses multiBalanceReportAsSpreadsheet
instead of multiBalanceReportHtmlRows.

This way, HTML output automatically supports transposition.
2024-10-02 17:32:57 -10:00
Henning Thielemann
afc320f1ba cli: Cli.Commands.Balance.multiBalanceReportAsSpreadsheetHelper -> multiBalanceReportAsSpreadsheetParts 2024-10-02 17:32:57 -10:00
Henning Thielemann
bb5e64c75f cli: Cli.Commands.Balance.budgetReportAsSpreadsheet: vertically merge duplicate account name cells
This is consistent with simple balance and multi-period balance reports.
2024-10-02 17:30:39 -10:00
Henning Thielemann
41397d0ca4 cli: compoundBalanceReportAsHtml - add class=account to Net row header 2024-10-02 17:29:05 -10:00
Simon Michael
c92b601028 dev: fix warnings with ghc 9.10 / base 4.20
Older ghc versions should also still build cleanly (tested with 9.8 so far).

I don't like enabling CPP in so many modules but it's easier that
figuring out how to do it with base-compat; hopefully no noticeable
compilation impact.
2024-09-30 17:20:13 -10:00
Simon Michael
12481804cd ;doc: bal: tree mode html limitation, edit [#1846] 2024-09-29 22:20:33 -10:00
Simon Michael
b17f6730d8 imp: areg: html output uses a hledger.css file if any, like balcmds 2024-09-29 22:12:57 -10:00
Simon Michael
4ef1db3725 ;doc: bal: note that tree mode doesn't work in html output [#1846] 2024-09-29 22:00:28 -10:00
Simon Michael
2d55a0e6aa ;doc: bal: also mention hledger.css and text encoding in balance doc 2024-09-29 21:47:13 -10:00
Simon Michael
cc7ba473ec imp: bal: html output will use a hledger.css file, like bs/cf/is 2024-09-29 21:22:38 -10:00
Henning Thielemann
5565f11c73 cli: Commands.Balance.multiBalanceReportAsSpreadsheetHelper: vertically merge cells showing account names and Total
lib: Write.Spreadsheet: add support for cell spans
2024-09-29 19:25:05 -10:00
Henning Thielemann
2f9a8031b0 lib: Write.Html -> Write.Html.Lucid
Write.Html: keep common definitions for both HTML backends
2024-09-29 13:27:51 -10:00
Henning Thielemann
d8fc30f7c5 lib: Write.Html.Attribute.tableStyle: style definitions taken from Commands.Balance.multiBalanceReportAsHtml
avoid duplicate with Write.Html.printHtml

Write.Html.Attribute: remove dependency on Lucid
2024-09-29 13:27:51 -10:00
Simon Michael
d88e30ff43 ;doc: update help 2024-09-29 12:13:30 -10:00
Simon Michael
52402cd084 imp: bal: tweak --related, --transpose help 2024-09-29 12:12:15 -10:00
Simon Michael
e9a3f99553 imp: balcmds: support --count on all of them, why not 2024-09-29 12:12:15 -10:00
Simon Michael
40b8d2b517 imp: balcmds: tweak --base-url help [#2226] 2024-09-29 12:12:15 -10:00
Simon Michael
c8710958a6 imp: cli: more consistent options order between bal cmds 2024-09-29 11:39:23 -10:00
Simon Michael
5a4e5dc099 ;doc: bal: simplify hyperlinks doc a little [#2226]
I think this will be enough.
2024-09-29 11:31:04 -10:00
Henning Thielemann
e116b6af41 cli: Commands.Balance.composeAnchor: construct an anchor from Maybe base-url and query
Optionally add a missing trailing slash to the base URL.
2024-09-29 11:12:17 -10:00
Simon Michael
2a25bfdebc dev: fix typo in bal --base-url help [#2226] 2024-09-28 22:21:58 -10:00
Henning Thielemann
9cdd21bf6d cli: Commands.Balance.registerQueryUrl: correctly escape URL using modern-uri package 2024-09-28 22:12:51 -10:00
Henning Thielemann
3cd6e95746 doc: Commands/Balance.md: document hyperlinks and --base-url 2024-09-28 22:12:51 -10:00
Henning Thielemann
6e7324a36e cli: Command.Balance: pass command-line query to HTML and FODS hyperlinks 2024-09-28 22:12:51 -10:00
Henning Thielemann
cc86cd1f0e cli: Commands.Balance.multiBalanceReportAsSpreadsheet: add date query anchors to period headers 2024-09-28 22:12:51 -10:00
Henning Thielemann
499c626e48 lib: Write.Spreadsheet: support for anchors in HTML and FODS export
cli: Commands.Balance: new option --base-url
It adds hledger-web-compatible hyperlinks to account names.
2024-09-28 22:12:51 -10:00
Henning Thielemann
8744a0687c cli: CompoundBalanceCommand: use Html.Attribute.alignleft 2024-09-28 22:07:39 -10:00
Simon Michael
eb9e4aa9b6 ;doc: demo: link asciinema 2024-09-27 01:30:53 -10:00
Henning Thielemann
6ce6c72fd4 lib: Write.Html.Attributes: extracted HTML output helpers from Cli.Commands.Balance 2024-09-24 22:51:30 -10:00
Henning Thielemann
144098e407 cli: CompoundBalanceCommand.compoundBalanceReportAsHtml: create according TH cells only if row-total or average is requested
fixed bug #2225
2024-09-18 12:17:00 -07:00
Bas van Dijk
fb47073c91 fix: amount formatting of the Net row in the balancesheet HTML output
The "Net" row in the HTML output of balancesheet formatted amounts using machineFmt which is inconsistent with all the other amounts in the balance sheet. This fixes that by formatting Net amounts using oneLineNoCostFmt.
2024-09-18 10:08:19 -07:00
Simon Michael
e330ec9424 ;dev: cli: doc cleanups 2024-09-13 12:33:16 -07:00
Simon Michael
d2793dfd3a ;dev: cleanup: fix Balance.hs typo 2024-09-11 14:01:53 -07:00
Simon Michael
0b95ff0aa5 ;dev: cleanup: drop obscure todo comment [#2222] 2024-09-11 14:00:28 -07:00
Henning Thielemann
fdc3e674a5 cli: Commands.Balance.multiBalanceReportAsSpreadsheetHelper: return header separately 2024-09-11 13:51:09 -07:00
Henning Thielemann
5a7d0687d5 cli: Commands.Balance.multiBalanceRowAsTextBuilders, multiBalanceReportAsCsvHelper: helper functions removed 2024-09-11 13:51:09 -07:00
Henning Thielemann
ff397f79cc lib: Write.Spreadsheet.Cell: add cellClass field for HTML style class
cmd: Commands.Balance.multiBalanceRowAsCellBuilders: add HTML style class attributes here
This way we do not need to dissect table rows in
multiBalanceReportHtmlHeadRow, multiBalanceReportHtmlBodyRow, multiBalanceReportHtmlFootRow
Eventually removed these three functions.
2024-09-11 13:51:09 -07:00
Henning Thielemann
2fcf793221 cli: Commands.Cli.Balance.rawTableContent: helper function for extracting CSV from Spreadsheet cells 2024-09-11 13:51:09 -07:00
Henning Thielemann
df9531a6b7 cli: Commands.Balance.balanceReportAsSpreadsheet, multiBalanceReportAsSpreadsheet: support for transposition 2024-09-11 13:51:09 -07:00
Henning Thielemann
55c1246598 cli: Commands.Balance.budgetReportAsSpreadsheet: also transpose border 2024-09-11 13:51:09 -07:00
Henning Thielemann
2ed13afed4 lib: Write.Spreadsheet: support for borders like in existing HTML export
cli: Commands.Balance: use for FODS export and balance and budget export to HTML
2024-09-11 13:51:09 -07:00
Simon Michael
91db5ef5d1 ;doc: update help 2024-09-09 14:07:07 -07:00
Simon Michael
a505ffd3bf ;doc: update help 2024-09-09 14:04:43 -07:00