Marking Up Your Files

Learn how to mark up TypeScript and Sass code files with Compodoc and SassDoc.

Documenting with Compodoc

Currently, the options for documenting your classes with JSDoc are limited when using Compodoc to using only the following tags:

  • The @example tag
  • The @ignore tag
  • The @link tag
  • The @param {type} Name Description tag
  • The @returns tag

If you’re familiar with using a documentation library such as JSDoc or YUIDoc, this might feel restrictive at first. Surprisingly, this is quite adequate though, as the Compodoc package generates quite detailed documentation on our behalf.

All we need to do is mark up our document correctly, supply information about each property and method, use the necessary tags, and the Compodoc plugin will do the rest of the work for us.

That said, we can add other JSDoc tags that are not officially supported by Compodoc. These will still add value to documenting our code, particularly if another developer should work on the project, as it will aid their understanding of the codebase. Still, they won’t be parsed and published to the final HTML documentation.

Open the animations-app/src/home/home.page.ts file and add the following comments (highlighted):

Get hands-on with 1200+ tech skills courses.