Are you creating
angular or
ionic based applications and looking for a tool to generate documentation to help your development team to easily understand all the components, modules, providers and communication between the components?
Also, you would like to make the life of new developers, who join the in progress project, easy. So, let's talk about a tool that generates the documentation and makes it really easy to understand the angular or ionic application.
Here are the steps:
- You should have nodejs installed.
- We'll install compodoc which is used to generate documentation for angular based applications. The command is here:
npm install -g compodoc
- You can also opt to install compodoc locally only for you angular application
npm install compodoc --save-dev
- Once the installation is complete, all you need to do is to run the following command:
compodoc -p tsconfig.json -s
- Here the flag -p stands for the path flag for tsconfig.json and -s will serve the documentation on the browser.
- If you have installed compodoc locally, I recommend installing npx as that allows you to run local modules without going to /node_modules/modules...
Here is the command for that:
npm install -g npx
-
And in that case, your command to run compodoc would be:
npx compodoc -p tsconfig.json -s
Looking for a demo application with having compodoc configured? Please check this
link
Here is the screenshot of configuration:
And here is how the documentation looks like:
Isn't it wonderful? I believe YES!!! and you will believe the same. Check this out. :)