GSoC 2020: Working on the Final Touches 🖌️
This article aims to give an update regarding the completed automated API documentation generation process and to notify the goals for the upcoming week.
Welcome to another article about the Node Cloud project. Time passes quickly, as we are heading to the final weeks of GSoC 2020. It is time for me to wrap things up. In the previous article, I explained about JSDoc and mentioned two goals which are to auto-generate the API documentation of Node Cloud and to update the ReadMe files of the project. It is happy to say that the documentation generation process is completed 🎉. In this article, I aim to explain the implementation of it in detail and to discuss the final touches that I am currently working on.
In my previous articles, I explained about the transformers which are used to modify source code. I also mentioned that JSDoc is capable of generating documentation using code comments. So basically the process is to run another transformation cycle to add all the comments in the format that is required by JSDoc. The data extraction process was updated to get some more information about the SDK methods in some cloud providers such as return type of methods etc. Let’s take a closer look using an example. This is a “addComments” transformer written for Google cloud plugin.
As you can see above comments are added targeting JavaScript class and it’s methods. For each function node, the parameters are collected and optional/mandatory scenario is also handled. Afterwards, the parameter set is combined in the main comment with the return type and other information. The “@category” tag is used to categorize generated classes(check figure 1) in the documentation. Better-docs template was used with JSDoc to make the API documentation look better. You can have a look at #62 PR for the complete implementation. Below I have added a generated JavaScript class and the generated API document for it as an example.
So that’s the update for the automated API documentation generation task. This week I am focusing on the final touches. There is some more information that I need to add in ReadMe files. Currently, I am updating the node-cloud.yml to generated all the required JavaScript classes for the Node Cloud plugins. Soon after that is done I will be making a demo project and a video with examples which will help others to easily understand Node Cloud.
That’s pretty much it for this article. See you in the next week with more interesting news about Node Cloud project.
Cheers 🍻 !!