hledger icon indicating copy to clipboard operation
hledger copied to clipboard

embed journal to text document

Open PSLLSP opened this issue 2 years ago • 2 comments
trafficstars

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.

PSLLSP avatar Sep 23 '23 14:09 PSLLSP

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 avatar Oct 05 '23 08:10 simonmichael

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

simonmichael avatar Oct 05 '23 08:10 simonmichael