diff --git a/hledger/hledger.m4.md b/hledger/hledger.m4.md index 621aedcc5..f396d699d 100644 --- a/hledger/hledger.m4.md +++ b/hledger/hledger.m4.md @@ -740,9 +740,73 @@ unless overridden by an explicit `--color/--colour` option. # Journal -hledger's default file format, representing a General Journal. -Here's a cheatsheet/mini-tutorial, -or you can skip ahead to [About journal format](#about-journal-format). +hledger's usual data source is a plain text file containing journal entries in hledger `journal` format. +If you're looking for a quick reference, jump ahead to the +[journal cheatsheet](#journal-cheatsheet) (or use the table of contents at ). + +This file represents an accounting [General Journal](http://en.wikipedia.org/wiki/General_journal). +The `.journal` file extension is most often used, though not strictly required. +The journal file contains a number of transaction entries, +each describing a transfer of money (or any commodity) between two or more named accounts, +in a simple format readable by both hledger and humans. + +hledger's journal format is compatible with most of +[Ledger's journal format](http://ledger-cli.org/3.0/doc/ledger3.html#Journal-Format), but not all of it. +The differences and interoperation tips are described at [hledger and Ledger](ledger.html). +With some care, and by avoiding incompatible features, you can keep your hledger journal +readable by Ledger and vice versa. This can useful eg for comparing the behaviour of one app +against the other. + +You can use hledger without learning any more about this file; just +use the [add](#add) or [web](#web) or [import](#import) commands to +create and update it. + +Many users, though, edit the journal file with a text editor, +and track changes with a version control system such as git. +Editor addons such as +ledger-mode or hledger-mode for Emacs, +vim-ledger for Vim, +and hledger-vscode for Visual Studio Code, +make this easier, adding colour, formatting, tab completion, and useful commands. +See [Editor configuration](/editors.html) at hledger.org for the full list. + + + +A hledger journal file can contain three kinds of thing: +comment lines, transactions, and/or directives (including periodic transaction rules and auto posting rules). +Understanding the journal file format will also give you a good understanding of hledger's data model. +Here's a quick cheatsheet/overview, followed by detailed descriptions of each part. ## Journal cheatsheet @@ -837,74 +901,6 @@ P 2022-01-01 AAAA $1.40 12/31 also allowed (but consistent YYYY-MM-DD is recommended). ``` -## About journal format - -hledger's usual data source is a plain text file containing journal entries in hledger journal format. -This file represents a standard accounting [general journal](http://en.wikipedia.org/wiki/General_journal). -I use file names ending in `.journal`, but that's not required. -The journal file contains a number of transaction entries, -each describing a transfer of money (or any commodity) between two or more named accounts, -in a simple format readable by both hledger and humans. - -hledger's journal format is compatible with most of -[Ledger's journal format](http://ledger-cli.org/3.0/doc/ledger3.html#Journal-Format), but not all of it. -The differences and interoperation tips are described at [hledger and Ledger](ledger.html). -With some care, and by avoiding incompatible features, you can keep your hledger journal -readable by Ledger and vice versa. This can useful eg for comparing the behaviour of one app -against the other. - -You can use hledger without learning any more about this file; just -use the [add](#add) or [web](#web) or [import](#import) commands to -create and update it. - -Many users, though, edit the journal file with a text editor, -and track changes with a version control system such as git. -Editor addons such as -ledger-mode or hledger-mode for Emacs, -vim-ledger for Vim, -and hledger-vscode for Visual Studio Code, -make this easier, adding colour, formatting, tab completion, and useful commands. -See [Editor configuration](/editors.html) at hledger.org for the full list. - - - -Here's a description of each part of the file format (and hledger's data model). - -A hledger journal file can contain three kinds of thing: -file comments, transactions, and/or directives -(counting periodic transaction rules and auto posting rules as directives). - ## Comments Lines in the journal will be ignored if they begin with a hash (`#`) or a semicolon (`;`). (See also [Other syntax](#other-syntax).)