===============
metadata begin
===============

2013-05-18 * ""
    test: "Something"
    Assets:Investments:MSFT      10 MSFT @@ 2000 USD
    Assets:Investments:Cash  -20000 USD

---

(file
    (transaction
        (date)
        (txn)
        (narration)
            (key_value
                (key)
                (value (string))
            )
            (posting
                (account)
                (incomplete_amount
                    (number)
                    (currency)
                )
                (atat)
                (price_annotation
                    (incomplete_amount
                        (number)
                        (currency)
                    )
                )
            )
            (posting
                (account)
                (incomplete_amount
                    (unary_number_expr
                        (minus) (number)
                    )
                    (currency)
                )
            )
    )
)

================
metadata middle
================

2013-05-18 * ""
    Assets:Investments:MSFT      10 MSFT @@ 2000 USD
    test: "Something"
    Assets:Investments:Cash  -20000 USD

---

(file
    (transaction
        (date)
        (txn)
        (narration)
            (posting
                (account)
                (incomplete_amount
                    (number)
                    (currency)
                )
                (atat)
                (price_annotation
                    (incomplete_amount
                        (number)
                        (currency)
                    )
                )
            )
            (key_value
                (key)
                (value (string))
            )
            (posting
                (account)
                (incomplete_amount
                    (unary_number_expr
                        (minus) (number)
                    )
                    (currency)
                )
            )
    )
)

=============
metadata end
=============

2013-05-18 * ""
    Assets:Investments:MSFT      10 MSFT @@ 2000 USD
    Assets:Investments:Cash  -20000 USD
    test: "Something"

---

(file
    (transaction
        (date)
        (txn)
        (narration)
            (posting
                (account)
                (incomplete_amount
                    (number)
                    (currency)
                )
                (atat)
                (price_annotation
                    (incomplete_amount
                        (number)
                        (currency)
                    )
                )
            )
            (posting
                (account)
                (incomplete_amount
                    (unary_number_expr
                        (minus) (number)
                    )
                    (currency)
                )
            )
            (key_value
                (key)
                (value (string))
            )
    )
)

==============
metadata many
==============

2013-05-18 * ""
    test1: "Something"
    Assets:Investments:MSFT      10 MSFT @@ 2000 USD
    test2: "has"
    test3: "to"
    Assets:Investments:Cash  -20000 USD
    test4: "come"
    test5: "from"

---

(file
    (transaction
        (date)
        (txn)
        (narration)
            (key_value
                (key)
                (value (string))
            )
            (posting
                (account)
                (incomplete_amount
                    (number)
                    (currency)
                )
                (atat)
                (price_annotation
                    (incomplete_amount
                        (number)
                        (currency)
                    )
                )
            )
            (key_value
                (key)
                (value (string))
            )
            (key_value
                (key)
                (value (string))
            )
            (posting
                (account)
                (incomplete_amount
                    (unary_number_expr
                        (minus) (number)
                    )
                    (currency)
                )
            )
            (key_value
                (key)
                (value (string))
            )
            (key_value
                (key)
                (value (string))
            )
    )
)

==================
metadata indented
=================

2013-05-18 * ""
        test1: "Something"
    Assets:Investments:MSFT      10 MSFT @@ 2000 USD
        test2: "has"
        test3: "to"
    Assets:Investments:Cash  -20000 USD
        test4: "come"
        test5: "from"
        test6: "this"

---

(file
    (transaction
        (date)
        (txn)
        (narration)
            (key_value (key) (value (string)))
            (posting
                (account)
                (incomplete_amount
                    (number)
                    (currency)
                )
                (atat)
                (price_annotation
                    (incomplete_amount
                        (number)
                        (currency)
                    )
                )
            )
            (key_value
                (key)
                (value (string))
            )
            (key_value
                (key)
                (value (string))
            )
            (posting
                (account)
                (incomplete_amount
                    (unary_number_expr
                        (minus) (number)
                    )
                    (currency)
                )
            )
            (key_value
                (key)
                (value (string))
            )
            (key_value
                (key)
                (value (string))
            )
            (key_value
                (key)
                (value (string))
            )
    )
)

===============
metadata other
==============

2013-01-01 open Equity:Other
2013-01-01 open Assets:Investments
    test1: "Something"
    test2: "Something"
2014-01-01 close Assets:Investments
    test1: "Something"
2013-01-10 note Assets:Investments "Bla"
    test1: "Something"
2013-01-31 pad Assets:Investments Equity:Other
    test1: "Something"
2013-02-01 balance Assets:Investments  111.00 USD
    test1: "Something"
2013-03-01 event "location" "Nowhere"
    test1: "Something"
2013-03-01 document Assets:Investments "/path/to/something.pdf"
    test1: "Something"
2013-03-01 price  HOOL  500 USD
    test1: "Something"

---

(file
    (open
        (date)
        (account)
    )
    (open
        (date)
        (account)
            (key_value (key) (value (string)))
            (key_value (key) (value (string)))
    )
    (close
        (date)
        (account)
            (key_value (key) (value (string)))
    )
    (note
        (date)
        (account)
        (string)
            (key_value (key) (value (string)))
    )
    (pad
        (date)
        (account)
        (account)
            (key_value (key) (value (string)))
    )
    (balance
        (date)
        (account)
        (amount_tolerance
            (number)
            (currency)
        )
            (key_value (key) (value (string)))
    )
    (event
        (date)
        (string)
        (string)
            (key_value (key) (value (string)))
    )
    (document
        (date)
        (account)
        (filename (string))
            (key_value (key) (value (string)))
    )
    (price
        (date)
        (currency)
        (amount
            (number)
            (currency)
        )
            (key_value (key) (value (string)))
    )
)

===================
metadata datatypes
===================

2013-05-18 * ""
    string: "Something"
    account: Assets:Investments:Cash
    date: 2012-01-01
    currency: HOOL
    tag: #trip-florida
    number: 345.67
    amount: 345.67 USD
    boolt: TRUE
    boolf: FALSE

----

(file
    (transaction
        (date)
        (txn)
        (narration)
            (key_value (key) (value (string)))
            (key_value (key) (value (account)))
            (key_value (key) (value (date)))
            (key_value (key) (value (currency)))
            (key_value (key) (value (tag)))
            (key_value (key) (value (number)))
            (key_value (key) (value (amount (number) (currency))))
            (key_value (key) (value (bool)))
            (key_value (key) (value (bool)))
    )
)

====================
metadata key syntax
====================

2013-05-18 * ""
    nameoncard: "Jim"
    nameOnCard: "Joe"
    name-on-card: "Bob"
    name_on_card: "John"

---

(file
    (transaction
        (date)
        (txn)
        (narration)
            (key_value (key) (value (string)))
            (key_value (key) (value (string)))
            (key_value (key) (value (string)))
            (key_value (key) (value (string)))
    )
)
