On Tue, Dec 1, 2020 at 8:47 AM Justus Pendleton <[email protected]> wrote:
> On Tuesday, December 1, 2020 at 11:26:13 AM UTC+7 [email protected] wrote: > >> One question that will remain is what to do with comments immediately >> preceding and/or following a transaction. Those are often associated with >> the transaction and slicing and dicing files to put them back together >> should probably preserve the comments like that. I'd have to inject >> comments into the grammar in order to do that (that may not be trivial). >> > > I've made two or three half-hearted attempts at programmatically > reformatting ledgers and this is definitely one of the biggest sticking > points. If comments were an actual part of the transaction -- the way > docstrings are on a python method, for instance -- it would be great. > > But there are some other complications: > > - Markers for code folding and just in general how to handle "sections". > Do you want all of your "#europe-holiday-2019" tagged transactions grouped > together automatically? Do you want that behaviour for *all* tags? > (Probably not!) > - How to handle commented out things that should stay close to the > non-commented things out they are related to. For instance, I have a custom > fava option commented out. But after reformatting it should still be > adjacent to all the other fava options! > - Handling de-facto multi-line comments (again, on things that aren't > transactions, consider a plugin configuration of multiple lines of embedded > JSON that has been commented out) > - Handling include files > All great points Justus; it seems to me with some conventions specific to your own file you can probably get away with it. > - Comments on things that aren't transactions -- prices, commodities > - Inline comments on individual legs of a transaction. For instance I have > one transaction that looks like: > > 2017-08-31 * "Transfer to Vietnam" > Assets:US:Blah -50 USD > Expenses:Bank-Fees 10 USD ; charged by correspondent bank on the wire > transfer > Assets:VN:Foo 40 USD > Okay, so let's talk about comments as docstrings and full round-trip (with comments) capability. Let's play with some ideas in this doc (click the button on the top right like to edit, please just add, don't delete): http://furius.ca/beancount/doc/parsed-comments https://docs.google.com/document/d/1yestw21g4AEMNrIUsBuOaxucfz3_7eMAR6NYnVnTzV0/ In particular, if we make a big schema change like that, I think the transaction's narration could be merged with the comment. Basically each transaction and posting would have a single comment field. Have to run, back after work... > - Handling all of the non-transaction things that you probably (maybe?) > don't want mixed in among transactions. But where *do* you want them? I > keep all of mine in separate files: prices in one file, balances in > another, etc. > > In the end I felt like there were so many edge cases and I struggled to > see much real benefit outside of my own OCD. > > -- > You received this message because you are subscribed to the Google Groups > "Beancount" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/beancount/7c27c941-79d8-4d4e-af32-94c394ecf265n%40googlegroups.com > <https://groups.google.com/d/msgid/beancount/7c27c941-79d8-4d4e-af32-94c394ecf265n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Beancount" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAK21%2BhNcqDCuUyPf61zaxtMV17NWmwr7bU-737aiCLDMtswjkQ%40mail.gmail.com.
