
Scenario
We have created the Angular Todo application using the Firefly Semantics Reactive State Manager and now we wish to document it using CompoDoc.
Approach
Install
npm install -g @compodoc/compodoc
Clone Application
Clone the Todo application and initialize the dependencies.
git clone git@github.com:fireflysemantics/angulr-material-todo-application.gitcd angulr-material-todo-applicationnpm i
Create the file tsconfig.doc.json
with these contents.
{
"include": ["src/**/*.ts"],
"exclude": ["src/test.ts", "src/**/*.spec.ts", "src/app/file-to-exclude.ts"]
}
Create a package.json
script that runs the documentation:
"scripts": {
"compodoc": "npx compodoc -p tsconfig.doc.json"
}
Run the compodoc generation on the application.
npm run compodoc
We can see from the log that the documentation has been generated into ./documentation/
.
Serve the documentation with the command:
compodoc -so
And have a look around.