NanoLedger icon indicating copy to clipboard operation
NanoLedger copied to clipboard

Note are incompatible with ledger

Open RyanGibb opened this issue 4 months ago • 3 comments

Adding a comment with NanoLedger creates an entry like:

2025-07-24 Payee | Note
    Account                                  £ Amount
    Account

But doesn't seem to be compatible with ledger's comment syntax. From https://ledger-cli.org/doc/ledger3.html#Commenting-on-your-Journal

Comments are generally started using a ‘;’. However, in order to increase compatibility with other text manipulation programs and methods, four additional comment characters are valid if used at the beginning of a line: ‘#’, ‘|’, and ‘*’ and ‘%’.

E.g.:

2025-07-24 Payee
| Note
    Account                                  £ Amount
    Account

Or (my preference):

2025-07-24 Payee
    ; Note
    Account                                  £ Amount
    Account

As a result Note is considered part of the payee with ledger-mode and the ledger CLI. This seems to be a bug, unless I'm misunderstanding something and this is intended behaviour?

Thanks for all the work developing this app!

System information

Version 1.1.1

RyanGibb avatar Jul 24 '25 16:07 RyanGibb

Hmm, you're right, this is a hledger-ism that I thought was also a thing in ledger. I'll probably introduce a "dialect"-setting at some point, will handle this at that point.

chvp avatar Aug 16 '25 16:08 chvp

This is actually the case with hledger too. I had previously been under the impression this was node for ledger, because comments in hledger also start with ;. The | is used as a separator between payee and description, but that is different than a comment. In fact in my own use I have an import/export format munging that converts the | separator used in NanoLedger to actual comments using ; for use in hledger as this is much more useful to have for mobile data entry than the access to the separate access to payee and description fields.

I would suggest the default comment syntax be changed to something both ledger and hledger understand in common, and then people that want to use hledger's extra syntax can just do so in the payee field with no special handling by default.

If/when the dialect toggle was implemented (that does sound like a good idea) the pipe character could be added as an optional comment separator in the parsing step to make usage for ledger users more idiomatic rather than forcing them to use the least common denominator syntax that is in common with hledger.

alerque avatar Aug 19 '25 17:08 alerque

I would suggest the default comment syntax be changed to something both ledger and hledger understand in common, and then people that want to use hledger's extra syntax can just do so in the payee field with no special handling by default.

That's a no-go for me. I use this description/note functionality quite extensively, and definitely want it to be autocompleted separately from the payee. The hledger docs also call this payee and note (https://hledger.org/1.43/hledger.html#payee-and-note) hence the naming in the app.

chvp avatar Aug 19 '25 17:08 chvp