Ledger 3.0 now supports entry and transaction "notes", which may contain new metadata and tag markers. Here's an example:

  2004/05/27 (100) Credit card company
      ; This is an entry note!
      ; Sample: Value
      Liabilities:MasterCard         $20.00
      ; This is a transaction note!
      ; Sample: Another Value
      ; :MyTag:
      Assets:Bank:Checking
      ; :AnotherTag:

An indented paragraph starting with ';' is parsed as a persistent note for its preceding category. These notes will get printed back to you with the "print" command. They are accessible to value expressions using the "note" variable.

Further, any occurrence of ":foo:" in a note will cause a metadata tag for "foo" to be registered for that entry. You can then search for such transactions using:

  ledger reg %foo
  ldeger reg tag foo

Also, if any word in the note ends (but does not start) with a colon, the remainder of that line will be taken to be the metadata value for that tag. That is:

  ; :foo:bar:baz:  <-- These are three tags
  ; name: value    <-- this is a tag with a value

Tags with value can be searched for just like tags. In addition, you can further limit your tag search by looking for only those tags that have specific values:

  ledger reg %name=value
  ledger reg tag name=value

Comments that are occur before an entry, or which starts at column zero, are always ignored and are neither searched nor printed back.

John

Reply via email to