simonmichael / hledger

Robust, fast, intuitive plain text accounting tool with CLI, TUI and web interfaces.
https://hledger.org
GNU General Public License v3.0
3.07k stars 320 forks source link

hledger is not a subset of ledger format #1306

Closed tbm closed 1 year ago

tbm commented 4 years ago

https://hledger.org/journal.html

hledger’s journal format is a compatible subset, mostly, of ledger’s journal format, so hledger can work with compatible ledger journal files as well

I don't think that's true anymore. You have some syntax that is not allowed in ledger.

I can think of at least:

Feel free to close this bug since this is fairly minor, but I think it's best to clarify it in the docs, i.e. that hledger's format is inspired and largely compatible but has diverged in some areas.

tbm commented 4 years ago

Actually, to my surprise transactions with zero postings are allowed in ledger.

tbm commented 4 years ago

Maybe the right solution is to propose the =* syntax for inclusion in ledger.

tbm commented 4 years ago

A decimal mark can be written as a period or a comma

This is only allowed in ledger with a command-line option and you can't mixed in the same file as you can in hledger.

tbm commented 4 years ago

separated by a “digit group mark” - a space, comma, or period

space: not supported in ledger.

tbm commented 4 years ago

end aliases will give an error in ledger:

Error: 'end' or 'end apply' found, but no enclosing 'apply' directive
tbm commented 4 years ago

Two spaces between period expression and description

I think that's not allowed in ledger

tbm commented 4 years ago

"You can make a stronger “total” balance assertion by writing a double equals sign" -> not in ledger

simonmichael commented 4 years ago

@tbm thanks for these. It says "mostly", which I figured gave enough wiggle room. It could be made more informative.

But where do you think is best:

?

simonmichael commented 4 years ago

PS, the advantage of putting it in the manuals of course is that it'll be available wherever folks are using man or info, including offline. And it'll be nearer to the relevant main doc. But it'd be more fragmented. A FAQ entry could tie those sections together again with links.

tbm commented 4 years ago
  1. I would add a link to the FAQ from the journal page which says subset.
  2. The FAQ entry doesn't seem complete, e.g. ==* is not emtnioned.
  3. I'd like to see compatibility overview. I've been thinking of writing one too.
simonmichael commented 4 years ago

There's also plaintextaccounting.org -> Syntax Quick Reference for the Ledger-Likes, https://plaintextaccounting.org/quickref, which was a start at giving equal focus to at least the big three tools. I had some ideas for how to redo this more efficiently (a markdown file with standard structure maintained by each project, a script to combine these into one big table..).

tbm commented 4 years ago

https://plaintextaccounting.org/quickref

That's a great document!

simonmichael commented 4 years ago

Thanks, feel free to take it over!

tbm commented 4 years ago

Also typed metadata, see #1388

the-solipsist commented 2 years ago

Also: hledger supports digit group separators like: INR 1,00,00,000.00 whereas ledger doesn't.

alensiljak commented 1 year ago

I've done the first (successful) attempt at parsing journals in Rust and will try to sum up the syntax in a syntax diagram (railroad diagram). See the link and the diagram at the Formats section of the readme: https://github.com/ledger-rs/ledger-rs-prototype

Any input is welcome. I.e. if you wish to add/modify the syntax, you can use the direct link to the diagram editor. Please share back so I can include it in the docs/readme and collaborate. Or just comment and I'll make the changes.

The syntax (for now) covers the basics, i.e. no tags, scheduled transactions, and other exotics.

simonmichael commented 1 year ago

2023 update: ledger/hledger file format and other differences are documented in detail at https://hledger.org/ledger.html , and I have pushed an update to the "subset" wording at https://hledger.org/dev/hledger.html#about-journal-format .