UNPKG

4.72 kBMarkdownView Raw
1# TypeDoc
2
3> Documentation generator for TypeScript projects.
4
5[![Build Status](https://travis-ci.org/TypeStrong/typedoc.svg?branch=master)](https://travis-ci.org/TypeStrong/typedoc)
6[![NPM Version](https://badge.fury.io/js/typedoc.svg)](https://badge.fury.io/js/typedoc)
7[![Chat on Gitter](https://badges.gitter.im/TypeStrong/typedoc.svg)](https://gitter.im/TypeStrong/typedoc?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
8
9## Documentation
10Visit our website for more complete documentation and example API documentation:<br>
11[https://typedoc.org](https://typedoc.org).
12
13There you can find an [installation guide](https://typedoc.org/guides/installation/) explaining
14how to use typedoc from the cli, webpack, grunt, or gulp. There are additional guides explaining
15how to extend typedoc using [plugins](https://typedoc.org/guides/plugins/) and
16[themes](https://typedoc.org/guides/themes/).
17
18## Installation
19
20TypeDoc runs on Node.js and is available as an NPM package. You can install TypeDoc
21in your project's directory as usual:
22
23```bash
24$ npm install typedoc --save-dev
25```
26
27Like the TypeScript compiler, TypeDoc comes with a binary that can be called from anywhere
28if you install TypeDoc as a global module. The name of the executable is ``typedoc``.
29
30```bash
31$ npm install typedoc --global
32$ typedoc
33```
34
35## Usage
36
37### Shell
38
39TypeDoc accepts most of the command line arguments that the TypeScript compiler accepts. One major
40difference is the fact that one may pass an entire directory instead of individual files to the documentation
41generator. So in order to create a documentation for an entire project you simply type:
42
43```bash
44$ typedoc --out path/to/documentation/ path/to/typescript/project/
45```
46
47### Arguments
48
49For a complete list of the command line arguments run `typedoc --help` or visit [our website](https://typedoc.org/guides/options/).
50
51* `--out <path/to/documentation/>`<br>
52 Specifies the location the documentation should be written to. Defaults to `./docs`
53* `--mode <file|modules>`<br>
54 Specifies the output mode the project is used to be compiled with.
55* `--options`<br>
56 Specify a json option file that should be loaded. If not specified TypeDoc will look for 'typedoc.json' in the current directory.
57* `--json <path/to/output.json>`<br>
58 Specifies the location and file name a json file describing the project is written to. When specified no documentation will be generated.
59* `--ignoreCompilerErrors`<br>
60 Allows TypeDoc to still generate documentation pages even after the compiler has returned errors.
61
62#### Source file handling
63* `--exclude <pattern>`<br>
64 Exclude files by the given pattern when a path is provided as source. Supports standard minimatch patterns (see [#170](https://github.com/TypeStrong/typedoc/issues/170))
65* `--includeDeclarations`<br>
66 Turn on parsing of .d.ts declaration files.
67* `--excludeExternals`<br>
68 Do not document external files, highly recommended if turning on `--includeDeclarations`.
69* `--excludeNotDocumented`<br>
70 Do not include the code symbols, that don't have doc comments. This option is useful,
71 if you want to document only small part of your symbols and do not show the remaining ones in the documentation.
72
73#### TypeScript compiler
74* `--tsconfig <path/to/tsconfig.json>`<br>
75 Specify a typescript config file that should be loaded. If not specified TypeDoc will look for 'tsconfig.json' in the current directory.
76
77#### Theming
78* `--theme <default|minimal|path/to/theme>`<br>
79 Specify the path to the theme that should be used.
80* `--name <Documentation title>`<br>
81 Set the name of the project that will be used in the header of the template.
82* `--readme <path/to/readme|none>`<br>
83 Path to the readme file that should be displayed on the index page. Pass `none` to disable the index page
84 and start the documentation on the globals page.
85
86#### Miscellaneous
87* `--listInvalidSymbolLinks`<br>
88 Display the list of links that don't point to actual code symbols.
89* `--version`<br>
90 Display the version number of TypeDoc.
91* `--help`<br>
92 Display all TypeDoc options.
93
94## Contributing
95
96This project is maintained by a community of developers. Contributions are welcome and appreciated.
97You can find TypeDoc on GitHub; feel free to start an issue or create a pull requests:<br>
98[https://github.com/TypeStrong/typedoc](https://github.com/TypeStrong/typedoc)
99
100For more information, read the [contribution guide](https://github.com/TypeStrong/typedoc/blob/master/CONTRIBUTING.md).
101
102
103## License
104
105Copyright (c) 2015 [Sebastian Lenz](https://typedoc.org).<br>
106Copyright (c) 2016-2020 [TypeDoc Contributors](https://github.com/TypeStrong/typedoc/graphs/contributors).<br>
107Licensed under the Apache License 2.0.