Getting started

Installation

Kompendium is available as a package on NPM and is installed using the NPM CLI

npm install kompendium

Configuration

Next, we need to configure Kompendium to generate our documentation. Kompendium runs using the docs-custom target in Stencil. We also need to copy the Kompendium components to our www folder in order to use them with the Stencil dev server.

stencil.config.ts
import { Config } from '@stencil/core';
import { kompendium } from 'kompendium';

export const config: Config = {
    namespace: 'my-project',
    outputTargets: [
        {
            type: 'docs-custom',
            strict: true,
            generator: kompendium()
        },
        {
            type: 'www',
            serviceWorker: null,
            copy: [{
                src: '../node_modules/kompendium/dist/',
                dest: 'assets/kompendium/'
            }]
        }
    ]
};

To get the generated documentation up and running, simply use the kompendium-app component in your index.html file. Don't forget to also include the scripts and styles, both for your own components and the ones that we copied during the build.

Running the dev server

Next, we can start the dev server by running

Last updated

Was this helpful?