TypeDoc
Badges
Table of Contents
About
This tool is used to generate both declarations and documentations with couple of clicks.
License
Copyright © 2022 DisQada
This framework is licensed under the Apache License, Version 2.0.
See the LICENSE file for more information.
Getting started
Configurations
Add the file docconfig.json
to your project, below a table of all possible configurations that can be used.
Property | Type | Default value | Description |
---|---|---|---|
root | string | src | Source code folder |
types | string | types | Generate declarations into this folder |
out | string | docs | Generate documentation this folder |
npm | string | name | Project name in npm |
github | string | Name | Project name in GitHub |
Usage
npm scripts
The tool is used via npm scripts that are already defined in it's package.json file, and can be called from your project npm scripts directly.
Below are the available npm scripts:
-
setup
: Install the required packages as dev dependencies -
config
: Read and cache the configuration file -
types
: Generate declarations using cached configurations thenclean
-
clean
: Clean the declaration files -
doc/docs
: Generate documentations using cached configurations
First thing to do is to run the following command to install all the necessary dependencies
npm explore @disqada/typedoc -- npm run setup
You'll most likely have the following scripts, use the setup
script on initialisation and every time you update the configuration file, then use the types
and doc/docs
scripts for generating declarations and documentation
"scripts": {
"config": "npm explore @disqada/typedoc -- npm run config",
"types": "npm explore @disqada/typedoc -- npm run types",
"docs": "npm explore @disqada/typedoc -- npm run docs"
}
If you're constantly changing the configurations, you can make one script that reads the configurations and generates the declarations/documentation like the following example:
"scripts": {
"types": "npm explore @disqada/typedoc -- npm run config && npm explore @disqada/typedoc -- npm run types",
"docs": "npm explore @disqada/typedoc -- npm run config && npm explore @disqada/typedoc -- npm run docs"
}