Repository
https://github.com/LIKO-12/API-Documentation
New Features
- What feature(s) did you add?
I have added features to the system used to generate markdown docs from JSON files. The system is split into three files; verify, analyze, and generate. Verify, makes sure the JSON does't have any errors, analyze lists stats of the data, and generate actually makes the docs.
I have made three changes. First of all, I moved all the functions that appeared in all three files, to one common file, that is loaded by all three. Secondly, I changed the files to use a more modular system, allowing for doing only some parts. For example, verify could check for JSON syntax, but not check that it includes all the required data. And finally, I added some command line options, such as custom JSON source path, and verbose. - How did you implement it/them?
- Common file: Added this by moving: log, clog (color log), and loaddirectory to docscripts, passing those functions as returns at the end (https://github.com/LIKO-12/API-Documentation/blob/d55f82b6e23168e816042bc97f1c7a3a62623337/LIKO_Scripts/docscripts.lua#L82), and importing them in all three files, for example in generate, (https://github.com/LIKO-12/API-Documentation/blob/d55f82b6e23168e816042bc97f1c7a3a62623337/LIKO_Scripts/generate.lua#L2).
- Plugin system: This was implemented in analyze, by creating a table (https://github.com/LIKO-12/API-Documentation/blob/d55f82b6e23168e816042bc97f1c7a3a62623337/LIKO_Scripts/analyze.lua#L9), then adding into it, the functions, for example (https://github.com/LIKO-12/API-Documentation/blob/d55f82b6e23168e816042bc97f1c7a3a62623337/LIKO_Scripts/analyze.lua#L11), and finally looping through the table, and doing each function on the data (https://github.com/LIKO-12/API-Documentation/blob/d55f82b6e23168e816042bc97f1c7a3a62623337/LIKO_Scripts/analyze.lua#L42). It is done the same in verify
- Command line options: command line options are parsed by a simple parser in docscripts (https://github.com/LIKO-12/API-Documentation/blob/d55f82b6e23168e816042bc97f1c7a3a62623337/LIKO_Scripts/docscripts.lua#L70). Which returns the path and whether to use verbose, this is called by each script with its own arguments.
Thanks for the contribution, @snewmark! I don't really have much feedback to give about the code as I've only used Lua a couple of times, but I guess having some comments would be nice. As for the post itself, I would recommend reading this guide for more information about what we like to see in the body of the post. Other than that everything looks fine to me, good work!
Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.
To view those questions and the relevant answers related to your post, click here.
Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]
@amosbastian , this is the pull reaquest: https://github.com/LIKO-12/API-Documentation/pull/17 . My apologies.
Thanks! I updated the above comment with my review.
Thank you for your review, @amosbastian! Keep up the good work!
Hi @snewmark!
Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server
Hey, @snewmark!
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!
Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).
Want to chat? Join us on Discord https://discord.gg/h52nFrV.
Vote for Utopian Witness!