diff --git a/README.rst b/README.rst index e51005b270f04bdcc5a8e2fa20f207a5ea69e404..cab1856be5515d3bb1dda0f2a5d00aa6b864ac5f 100644 --- a/README.rst +++ b/README.rst @@ -65,6 +65,35 @@ Patreon ``template patreon svcfees`` Imports one expense transaction per month for that month's Patreon service fees. Generated from Patreon's earnings report CSV. +Template variables +~~~~~~~~~~~~~~~~~~ + +import2ledger templates have access to a few variables for each transaction that can be included in the output entry using `Python's format string syntax `_. For most uses, all you need to do is write ``{variable_name}`` in the template, and the variable's value will be filled in there. For example, this template sets different payees for each side of the transaction:: + + template patreon income = + Income:Patreon -100%% + ;Payee: {payee} + Accrued:Accounts Receivable:Patreon 100%% + ;Payee: Patreon + +You can use the following variables: + +================== ========================================================== +Name Contents +================== ========================================================== +amount The total amount of the transaction, as a simple decimal + number (not currency-formatted) +------------------ ---------------------------------------------------------- +currency The three-letter code for the transaction currency +------------------ ---------------------------------------------------------- +date The date of the transaction, in your configured output + format +------------------ ---------------------------------------------------------- +payee The name of the transaction payee +================== ========================================================== + +Custom hooks may add more template variables. + Other output options ~~~~~~~~~~~~~~~~~~~~