Compodoc · instant documentation for your Angular app

4 months ago

Compodoc turns your Angular app into a complete documentation site. It reads your TypeScript, and generates browsable, searchable docs for every component, module, and service, with nothing written by hand. Let me show you the whole thing in about a minute.

Ask about this presentation

Chapters

  1. 0:00Instant documentation for your Angular app.
  2. 0:13Add it to your project
  3. 0:25Point it at your code
  4. 0:34One command
  5. 0:44A full docs site, from your code
  6. 0:58Coverage, and built-in themes
  7. 1:14Docs you never write by hand
Show transcript
  1. Compodoc turns your Angular app into a complete documentation site. It reads your TypeScript, and generates browsable, searchable docs for every component, module, and service, with nothing written by hand. Let me show you the whole thing in about a minute.

    Slide text
    Compodoc

    It reads your TypeScript and generates the docs. Nothing written by hand.

    ng add → compodoc -s → full docs site
  2. Start by adding Compodoc to your project. With the Angular CLI it is a single command, or a one line npm install. It is one dev tool, and it also supports Nest and Stencil projects.

    Slide text
    $ ng add @compodoc/compodoc
    # or:  npm install -g @compodoc/compodoc

    One dev tool. Works with Angular, Nest, and Stencil projects.

  3. Next, point Compodoc at your code. You add one small config file that lists your source folder. That is the only configuration, and there is nothing else to wire up.

    Slide text
    // tsconfig.doc.json
    {
      "include": ["src/**/*.ts"],
      "exclude": ["src/**/*.spec.ts"]
    }

    One small config file lists your source. That is the only configuration.

  4. Now run Compodoc with that config, and pass dash s to serve. It parses your TypeScript, builds the whole site, and hosts it at localhost port 8080. One command, and your docs are live.

    Slide text
    $ compodoc -p tsconfig.doc.json -s
    # docs generated, served at http://localhost:8080

    It parses your TypeScript, builds the site, and serves it locally.

  5. Here is what you get. A full documentation site covering every component, module, injectable, and route, an interactive dependency graph, and instant search across all of it. Every page is generated from your code, so it stays in sync as your app changes.

    Slide text
    A generated Compodoc site: dependency graph and component counts

    Every component, module, and route · an interactive dependency graph and full-text search.

  6. There is more under the surface. Compodoc measures your documentation coverage, so you can see exactly what is documented and gate it in your CI. And it ships with built in themes, including gitbook, material, and stripe, so the docs can match your project.

    Slide text
    Compodoc documentation-coverage report

    See what is documented and gate it in CI · themes: gitbook, material, stripe.

  7. That is Compodoc. Point it at your Angular, Nest, or Stencil code, run one command, and get a complete, searchable docs site you never have to write by hand. It is open source and free. Get started at compodoc dot app.

    Slide text
    • Zero hand-writing · generated from your TypeScript, always in sync.
    • Everything documented · components, modules, injectables, routes.
    • Explore it · dependency graph, search, coverage report.
    • Angular · Nest · Stencil · open source, MIT, one command.

    npm i -g @compodoc/compodoc  ·  compodoc.app  ·  open source, MIT

What happened in AI today, in your inbox

One short email each evening. Read it and you’re caught up.

Built with ❤️ in New York