More help needed to document ledger options and functions
Hi all, while documenting some of the Ledger value expression functions in the manpage and the texinfo manual I've also extended the CheckManpage.py and CheckTexinfo.py scripts to check for (un)documented value expression functions. If you know what any of the following options or value expression functions below do please document them or reply to this message with a short informative text to have it documented, thanks! Cheers, Alexis Missing manpage option entries for: --auto-match --base --cache --datetime-format --exact --explicit --full-help --historical --import --lots-actual --revalued --revalued-only --revalued-total --rich-data --sort-all --time-report --value-expr --verify-memory Missing manpage function entries for: amount_expr display_amount display_total format format_datetime get_at is_seq justify lot_date lot_price lot_tag nail_down now options print round rounded scrub should_bold strip to_amount to_balance to_boolean to_date to_datetime to_mask to_sequence today top_amount total_expr truncated unround unrounded Missing texinfo option entries for: --auto-match --base --cache --datetime-format --day-break --exact --explicit --full-help --historical --import --lots-actual --revalued --revalued-only --revalued-total --rich-data --sort-all --time-report --value-expr --verify-memory texinfo entry for unknown options: --getquote Missing texinfo function entries for: amount_expr commodity display_amount display_total format format_datetime get_at is_seq join lot_date lot_price lot_tag market nail_down now options print quantity round rounded scrub should_bold strip to_amount to_balance to_boolean to_date to_datetime to_mask to_sequence to_string today top_amount total_expr truncated unround unrounded -- --- You received this message because you are subscribed to the Google Groups Ledger group. To unsubscribe from this group and stop receiving emails from it, send an email to ledger-cli+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Help needed to document ledger options
Hi all, I've refactored the initial test/CheckTests.py script into smaller test scripts that specifically test one aspect of the documentation: * CheckManpage.py Checks that the manpage documents all options available in ledger * CheckTexinfo.py Checks that the texinfo manual documents all options available in ledger * CheckBaselineTests.py Checks that there is a baseline test for each option available in ledger All of these scripts are run from ctest and currently fail due to missing documentation. If you know what any of the undocumented options below do please document them or reply to this message with a short informative text to have it documented, thanks! Cheers, Alexis Missing manpage entries for: --auto-match --base --cache --datetime-format --day-break --exact --explicit --full-help --historical --import --lots-actual --no-pager --permissive --revalued --revalued-only --revalued-total --rich-data --sort-all --time-report --value-expr --verify-memory Missing texinfo entries for: --auto-match --base --cache --datetime-format --day-break --exact --explicit --full-help --historical --import --lots-actual --no-pager --permissive --revalued --revalued-only --revalued-total --rich-data --sort-all --time-report --value-expr --verify-memory texinfo entry for unknown options: --getquote Missing Baseline test for: --cleared-format --generated --no-pager --no-rounding --permissive --value-expr --verify-memory -- --- You received this message because you are subscribed to the Google Groups Ledger group. To unsubscribe from this group and stop receiving emails from it, send an email to ledger-cli+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: documenting formatting handlers Re: Help needed to document ledger options
Hi Alexis, I'm impressed! Also the example showed me the way. Also got it working now, allthough not with amount as mentioned in the example, but with display_amount. I think that was where i got stuck last time: ledger -X € --format %(account) \t %8(quantity(scrub(roundto(display_amount, 2 \t %(quantity(scrub(display_amount)))\n reg ^exp ^bank BR, Hans Erik ** working out a working format string rouding of to 2 digits #+name: transactions_multiple_commodities2 #+begin_src ledger :noweb yes P 2013/12/02 17:00:00 GBP €1,2604 2013/12/02 ACME Expenses:A€ 0,01 Assets 2014/01/02 ACME Expenses:A€ 1,00 Assets 2014/01/02 ACME Expenses:A 1,00 GBP Assets 2014/02/02 ACME Expenses:B€ 0,01 Assets 2014/03/02 ACME Expenses:B€ 0,02 Assets 2014/03/02 ACME Expenses:C € 1,00 BankAccount (-€1,00/3) ; [2014/03/02] BankAccount (-€1,00/3) ; [2014/04/02] BankAccount (-€1,00/3) ; [2014/05/02] #+end_src #+begin_src ledger :cmdline -X € --format %(account) \t %8(quantity(scrub(roundto(display_amount, 2 \t %(quantity(scrub(display_amount)))\n reg ^exp ^bank :noweb yes transactions_multiple_commodities2 #+end_src #+RESULTS: #+begin_example Expenses:A 0.01 0.01 Adjustment 0 0 Expenses:A 1 1 Expenses:A 1.26 1.2604 Expenses:B 0.01 0.01 Expenses:B 0.02 0.02 Expenses:C 1 1 BankAccount -0.33 -0.33 Adjustment -0.01 -0.01 BankAccount -0.33 -0.33 BankAccount -0.33 -0.33 #+end_example Op maandag 19 januari 2015 17:33:29 UTC+1 schreef unices: Hi Erik, list of formatting handlers: - foo(x,y): one line description foo performs ... and takes an argument x that controls ... and argument y that ... one line example of a typical use foo(amount,2) results in amount to be displayed fooed a level of 2 times - bar(x): ... Thanks, that was quite helpful. Please have a look at the final HTML at http://jsfiddle.net/dd98hLx5/2/ is something like that you had in mind? I've used texinfo's @defun, @defvar, et al to document the value expressions accordingly and with only minimal changes to test/DocTests.py I'm able to have the @smallexample's for each value expression run and tested, yay! Have a look at the changes proposed in https://github.com/ledger/ledger/pull/373 and feel free to comment. Cheers, Alexis -- --- You received this message because you are subscribed to the Google Groups Ledger group. To unsubscribe from this group and stop receiving emails from it, send an email to ledger-cli+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Help needed to document ledger options
Hi Alexis, Nice work. Is something like this possible for formatting handlers as well. I was trying lately to use the roundto primitive, but could not work out how to use it. Did not find anything in the documentation. Trial and error resulted in a segmentation fault. Best Regards, Hans Erik Op donderdag 15 januari 2015 22:34:10 UTC+1 schreef unices: Hello everyone, I have pushed some changes to the next branch that break the tests. This is because I have integrated the test/CheckTests.py script into the test suite and it shows areas where ledger can be improved. The script checks whether all options know to ledger are documented in the manpage (doc/ledger.1) and in the manual (doc/ledger3.texi), and whether there are options documented in those files that aren't supported by ledger. Please find below a list of errors reported by test/CheckTests.py, if you know what (some of) those options do I kindly ask you to to write a short documentation and issue a pull request on github or respond to this mail, so we can improve the documentation. In order to document options in the manpage follow the given mdoc (7) formatting: .It Fl \-option-to-document I have commented many undocumented options running the following command will show you which those are: % grep '.\.It Fl' doc/ledger.1 To test the options documented in the manual I have expanded test/CheckTets.py so that it searches for lines with @c option, e.g.: @item --help @c option There are also several FIXME's in doc/ledger3.texi, that need, well fixing ;) Should you document an option in the manual please add the string `@c option` to it, so that CheckTests.py can verify it and search for the option in the whole manual, it may be documented in several places. Thanks! Alexis Here's the output of: % python test/CheckTests.py --ledger ${PATH_TO}/ledger --source . Missing man page entries for: --auto-match --base --cache --day-break --exact --explicit --full-help --help-calc --help-comm --help-disp --import --lots-actual --no-pager --permissive --revalued --revalued-only --revalued-total --rich-data --sort-all --time-report --value-expr --verify-memory Missing texi entries for: --auto-match --base --cache --datetime-format --day-break --exact --full-help --help-calc --help-comm --help-disp --import --lots-actual --no-pager --permissive --revalued --revalued-only --revalued-total --rich-data --sort-all --time-report --value-expr --verify-memory Texi entry for unknown option: --getquote -- --- You received this message because you are subscribed to the Google Groups Ledger group. To unsubscribe from this group and stop receiving emails from it, send an email to ledger-cli+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Help needed to document ledger options
Hi Erik Nice work. Thanks :) I stand on the should of giants. Is something like this possible for formatting handlers as well. Maybe, I'm not sure yet. I would like to have every aspect of Ledger (including formatting handlers) documented and have that documentation tested and validated by ledger. I was trying lately to use the roundto primitive, but could not work out how to use it. Did not find anything in the documentation. Trial and error resulted in a segmentation fault. Ah a segmentation fault, gotta love those ;) Please check if the one you found has already been reported to bugs.ledger-cli.org and report it if it hasn't giving step-by-step instructions and test data to reproduce the issue. It would be super helpful. And can you give an example of what documentation you would've considered helpful? This could give me a start on how that documentation may be written, tested and validated. Best, Alexis -- --- You received this message because you are subscribed to the Google Groups Ledger group. To unsubscribe from this group and stop receiving emails from it, send an email to ledger-cli+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
documenting formatting handlers Re: Help needed to document ledger options
created a new thread as to not blowup your option handling thread. And can you give an example of what documentation you would've considered helpful? This could give me a start on how that documentation may be written, tested and validated. list of formatting handlers: - foo(x,y): one line description foo performs ... and takes an argument x that controls ... and argument y that ... one line example of a typical use foo(amount,2) results in amount to be displayed fooed a level of 2 times - bar(x): ... Op vrijdag 16 januari 2015 17:36:30 UTC+1 schreef unices: Hi Erik Nice work. Thanks :) I stand on the should of giants. Is something like this possible for formatting handlers as well. Maybe, I'm not sure yet. I would like to have every aspect of Ledger (including formatting handlers) documented and have that documentation tested and validated by ledger. I was trying lately to use the roundto primitive, but could not work out how to use it. Did not find anything in the documentation. Trial and error resulted in a segmentation fault. Ah a segmentation fault, gotta love those ;) Please check if the one you found has already been reported to bugs.ledger-cli.org and report it if it hasn't giving step-by-step instructions and test data to reproduce the issue. It would be super helpful. And can you give an example of what documentation you would've considered helpful? This could give me a start on how that documentation may be written, tested and validated. Best, Alexis -- --- You received this message because you are subscribed to the Google Groups Ledger group. To unsubscribe from this group and stop receiving emails from it, send an email to ledger-cli+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Help needed to document ledger options
Hello everyone, I have pushed some changes to the next branch that break the tests. This is because I have integrated the test/CheckTests.py script into the test suite and it shows areas where ledger can be improved. The script checks whether all options know to ledger are documented in the manpage (doc/ledger.1) and in the manual (doc/ledger3.texi), and whether there are options documented in those files that aren't supported by ledger. Please find below a list of errors reported by test/CheckTests.py, if you know what (some of) those options do I kindly ask you to to write a short documentation and issue a pull request on github or respond to this mail, so we can improve the documentation. In order to document options in the manpage follow the given mdoc (7) formatting: .It Fl \-option-to-document I have commented many undocumented options running the following command will show you which those are: % grep '.\.It Fl' doc/ledger.1 To test the options documented in the manual I have expanded test/CheckTets.py so that it searches for lines with @c option, e.g.: @item --help @c option There are also several FIXME's in doc/ledger3.texi, that need, well fixing ;) Should you document an option in the manual please add the string `@c option` to it, so that CheckTests.py can verify it and search for the option in the whole manual, it may be documented in several places. Thanks! Alexis Here's the output of: % python test/CheckTests.py --ledger ${PATH_TO}/ledger --source . Missing man page entries for: --auto-match --base --cache --day-break --exact --explicit --full-help --help-calc --help-comm --help-disp --import --lots-actual --no-pager --permissive --revalued --revalued-only --revalued-total --rich-data --sort-all --time-report --value-expr --verify-memory Missing texi entries for: --auto-match --base --cache --datetime-format --day-break --exact --full-help --help-calc --help-comm --help-disp --import --lots-actual --no-pager --permissive --revalued --revalued-only --revalued-total --rich-data --sort-all --time-report --value-expr --verify-memory Texi entry for unknown option: --getquote -- --- You received this message because you are subscribed to the Google Groups Ledger group. To unsubscribe from this group and stop receiving emails from it, send an email to ledger-cli+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.