simonmichael / hledger

Robust, fast, intuitive plain text accounting tool with CLI, TUI and web interfaces.
https://hledger.org
GNU General Public License v3.0
2.98k stars 318 forks source link

embed journal to text document #2090

Open PSLLSP opened 1 year ago

PSLLSP commented 1 year ago

This is a wish. Could be possible to embed journal to text document? When such document is processed by hledger, only hledger section will be processed.

Current hledger journal can use comments and mark part of text in journal file to be ignored by hledger.

I think that opposite way could be useful too. Have a text file and mark sections those should be processed by hledger. I assume new directive should be added, something similar to comment and end comment. When hledger will be started with some new parameter, it will ignore text until it finds instruction, that next text/block is journal and it will process it. Several such blocks could be in a single file, in similar way like comment and end comment blocks can be in journal...

I can do something like this with current comment and end comment but I think that something similar can be useful for case where journal data are just a small part of text file, like some diary, or notes describing an investment.

simonmichael commented 1 year ago

I was thinking about this recently. I agree it sounds interesting to have more support for interleaved documentation and journal data, for "literate accounting", something like literate Haskell. I haven't got a clearly valuable, concrete use case in mind yet - do you have one ? Maybe we can collect some workflows to try it out using non-hledger text-munging tools.

simonmichael commented 1 year ago

https://hledger.org/editors.html#org-babel is related.