TypeDocs is a library that helps generate API documentation for TypeScript code.
Deprecation Notice: this project is not actively maintained. Consumers are strongly encouraged to switch to other projects.
npm install typedocs
To get documentation programmatically, you can invoke this library programmatically as follows: -
import * as typedocs from "typedocs";
"use strict";
const sourceFileName = "path/to/declaration.d.ts";
// Generate documentation by calling the generate function
// passing in the definition files.
const result = typedocs.generate([sourceFileName]);
// Optionally you can flatten the modules to include
// separate items for nested modules.
const flatResult = typedocs.flattenModules(result);
To generate a docs website, execute the following: -
import * as typedocs from "typedocs";
"use strict";
const sourceFileName = "path/to/declaration.d.ts";
// Generate documentation by calling the generate function
// passing in the definition files.
const result = typedocs.generate([sourceFileName], {
websiteOptions: {
dir: "./myproductwebsite",
resources: {
productName: "My awesome product",
productDescription: "The description for my awesome product.",
}
}
});
The samples folder contains an app that demonstrates the usage above. You can run the below command to exercise it.
node sampleapp.js
To contribute to the project please go through the Contributing.md guide.