;doc: cli: more guidance on comments

This commit is contained in:
Simon Michael 2022-12-17 07:23:53 -10:00
parent 40df381cb2
commit faa5f00f1a

View File

@ -838,20 +838,26 @@ file comments, transactions, and/or directives
## File comments ## File comments
Lines in the journal beginning with a semicolon (`;`), a hash (`#`) or Lines in the journal will be ignored if they begin with a semicolon (`;`), a hash (`#`) or a star (`*`).
a star (`*`) are file-level comments, and will be ignored. hledger will also ignore regions beginning with a `comment` line and ending with an `end comment` line (or file end).
They are not attached to anything (even if right next to a transaction).
(Star comments allow emacs users to view and fold/unfold long journals in org mode, These four comment syntaxes are equivalent, but here's a suggestion:
but nowadays regular comments and ledger mode + orgstruct mode may work better).
- `#` for significant/top-level notes
- `;` for minor notes, eg on specific transactions, and for commenting out things temporarily
- `comment` for quickly commenting large regions (remember it's there, or you might get confused)
- `*` for emacs users managing big journals as org outlines (but orgstruct + ledger mode is probably better now)
Eg:
```journal ```journal
# a file comment # a file comment
; another file comment ; another file comment
* also a file comment, useful in org/orgstruct mode * a file comment and an org headline
comment comment
A multiline file comment, continuing until an A multi-line file comment block,
"end comment" directive or the end of the current file.
continuing until "end comment" directive
or the end of the current file.
end comment end comment
``` ```