Metadata-Version: 2.4
Name: minchin.md-it.beancount
Version: 1.0.0
Summary: Beancount fenced blocks as registers, for Markdown-It-Py
Author-email: William Minchin <w_minchin@hotmail.com>
Maintainer-email: William Minchin <w_minchin@hotmail.com>
License-Expression: MIT
Project-URL: Bug Tracker, https://github.com/MinchinWeb/minchin.md-it.beancount/issues
Project-URL: Repository, https://github.com/MinchinWeb/minchin.md-it.beancount
Project-URL: Changelog, https://github.com/MinchinWeb/minchin.md-it.beancount/blob/master/CHANGELOG.rst
Keywords: beancount,commonmark,markdown,plugin,register
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Environment :: Plugins
Classifier: Intended Audience :: End Users/Desktop
Classifier: Operating System :: OS Independent
Classifier: Topic :: Text Processing :: Markup :: Markdown
Classifier: Topic :: Office/Business :: Financial :: Accounting
Requires-Python: >=3.9
Description-Content-Type: text/x-rst
License-File: LICENSE.txt
Requires-Dist: beancount>=3.2
Requires-Dist: markdown-it-py>=3
Dynamic: license-file

minchin.md-it.beancount
=======================

A Markdown-It-Py plugin that renders ``beancount`` (or ``bean``) fenced blocks
as checkbook-style registers. It serve as the Pelican-side counterpart of the
Obsidian plugin `beancount-register
<https://github.com/minchinweb/obsidian-beancount-register>`_, and it renders
the same layout and class names, but depends on neither Pelican or Obsidian.

.. code-block:: markdown

   ```beancount
   2024-09-26 * "Airbnb Payments" "Paris Trip" #ParisTrip
     Liabilities:CreditCard:MyBank                    -200 EUR
     Expenses:Travel:Accomodation
   ```

Use with Pelican
----------------

Add the plugin to the `CommonMark reader
<https://github.com/minchinweb/minchin.pelican.readers.commonmark>`_'s
extensions in your ``pelicanconf.py``:

.. code-block:: python

   # pelicanconf.py

   import minchin.md_it.beancount

   COMMONMARK["extensions"].append(minchin.md_it.beancount.beancount_plugin)

Add the stylesheet rules from ``css/beancount-register.css`` to your theme.


How it Works
------------

- Each entry is parsed with the official ``beancount`` package. Missing amounts
  are filled in by Beancount's own booking step, so one posting with no amount
  is the negative of the others.
- A register is drawn for each account the transactions share. Ties go to
  Assets or Liabilities. The title bar shows the account and, when the amounts
  share one currency, the currency.
- Negative amounts are shown as Debit and positive amounts as Credit, following
  the bank-statement convention.
- Entries that do not parse are listed under "Not shown in the register", and
  the rest of the block still renders.

Limits
------

- The Balance column is present but empty.
- Beancount directives other than transactions (``open``, ``balance``, ...) are
  not drawn.

Other Options
-------------

- there is a Pygments lexer (`beancount-pygments-lexer
  <https://github.com/aumayr/beancount-pygments-lexer>`_) if you'd rather see
  the raw ledger data.

Licence
-------

MIT. See ``LICENSE.txt``.
