tsdoc/readme.md

109 lines
5.3 KiB
Markdown
Raw Normal View History

2024-03-31 13:09:30 +00:00
# @git.zone/tsdoc
2024-04-12 13:28:55 +00:00
An advanced TypeScript documentation tool that leverages AI for enhanced insights and automated documentation generation.
2019-05-14 15:39:33 +00:00
2024-04-03 11:34:26 +00:00
## Install
2024-04-12 13:28:55 +00:00
To install `@git.zone/tsdoc`, you have two options depending on your usage preference: globally for CLI use or locally within your project for use through NPX. To install globally, run:
2024-04-03 11:34:26 +00:00
2024-04-12 13:28:55 +00:00
```sh
npm install -g @git.zone/tsdoc
2024-04-03 11:34:26 +00:00
```
2024-04-12 13:07:56 +00:00
2024-04-12 13:28:55 +00:00
For local installation within your project, use:
```sh
npm install --save @git.zone/tsdoc
```
You can then use the tool through NPX if installed locally:
```sh
npx tsdoc
```
2019-05-14 15:39:33 +00:00
## Usage
2024-04-12 13:28:55 +00:00
`@git.zone/tsdoc` is a tool designed to improve the process of generating documentation for TypeScript projects. It combines the capabilities of Typedoc with AI-powered features to automatically generate insights and enhance the quality of your API documentation without manual intervention.
2024-04-03 11:34:26 +00:00
2024-04-12 13:28:55 +00:00
To get started, after installation, navigate to the root directory of your TypeScript project where your `tsconfig.json` is located and run:
2024-04-03 11:34:26 +00:00
```typescript
import { runCli } from '@git.zone/tsdoc';
2024-04-12 13:28:55 +00:00
// Initialize and run the CLI
runCli().then(() => {
console.log('Documentation generation complete!');
}).catch((error) => {
console.error('Failed to generate documentation:', error);
});
2024-04-03 11:34:26 +00:00
```
2024-04-12 13:28:55 +00:00
### Generating Documentation
`@git.zone/tsdoc` provides a command-line interface to generate documentation directly from your TypeScript source files. The CLI uses information from your TypeScript configuration and the source files to create comprehensive documentation.
2024-04-12 13:07:56 +00:00
2024-04-12 13:28:55 +00:00
Once `tsdoc` is installed globally, you can run the following command in the root of your TypeScript project:
2024-04-12 13:07:56 +00:00
2024-04-12 13:28:55 +00:00
```sh
tsdoc
2024-04-12 13:07:56 +00:00
```
2024-04-12 13:28:55 +00:00
This command analyzes your TypeScript project, extracts type information, and generates documentation pages as HTML or Markdown. You can customize the output format and specify additional options via command line parameters or by editing `tsdoc` configuration files.
2024-04-12 13:07:56 +00:00
2024-04-12 13:28:55 +00:00
### Command Line Parameters
The CLI tool reads options from `./ts/cli.ts`. Command line parameters allow you to customize the behavior of `tsdoc`. For more detailed usage, run:
2024-04-12 13:07:56 +00:00
2024-04-12 13:28:55 +00:00
```sh
tsdoc --help
```
2024-04-03 11:34:26 +00:00
2024-04-12 13:28:55 +00:00
This will display a list of available commands and options, such as specifying the output directory for the generated documentation or enabling/disabling certain features of the documentation generator.
2024-04-03 11:34:26 +00:00
2024-04-12 13:28:55 +00:00
### Examples
Below is an example of how to use `tsdoc` to generate documentation with custom options:
2024-04-03 11:34:26 +00:00
2024-04-12 13:28:55 +00:00
```sh
tsdoc --output docs/api --format html
2024-04-03 11:34:26 +00:00
```
2024-04-12 13:28:55 +00:00
This command generates HTML documentation for your project and places it in the `docs/api` directory.
2024-04-03 11:34:26 +00:00
2024-04-12 13:28:55 +00:00
### Additional Features
Beyond basic documentation generation, `tsdoc` integrates AI-powered analysis to enrich the documentation automatically. This feature helps by providing insights into complex types, documenting patterns used within your codebase, and suggesting improvements for better maintainability and readability of your documentation.
2024-04-03 11:34:26 +00:00
2024-04-12 13:28:55 +00:00
**Note:** `tsdoc` is designed for use with projects adhering to modern TypeScript conventions. Ensure your project structure and TypeScript configuration are compatible for optimal results.
2024-04-03 11:34:26 +00:00
2024-04-12 13:28:55 +00:00
### Integration with CI/CD
`@git.zone/tsdoc` can be integrated into your CI/CD pipelines to automatically generate and update documentation as part of your build process. This ensures that your API documentation is always up-to-date with your codebase.
2019-05-14 15:39:33 +00:00
2024-04-12 13:28:55 +00:00
Here's an example configuration snippet for a CI workflow:
```yml
steps:
- name: Install tsdoc
run: npm install -g @git.zone/tsdoc
- name: Generate Documentation
run: tsdoc
```
Remember to replace placeholders and adjust paths as necessary depending on your CI provider and project configuration.
### Conclusion
`@git.zone/tsdoc` is a powerful tool that leverages the best of Typedoc and AI to streamline the documentation process for TypeScript projects. By automating the generation of insightful and comprehensive documentation, it enhances developer productivity and improves the quality of project documentation.
2020-11-24 20:24:30 +00:00
2024-04-12 13:07:56 +00:00
## License and Legal Information
2020-11-24 20:24:30 +00:00
2024-04-12 13:07:56 +00:00
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
2020-11-24 20:24:30 +00:00
2024-04-12 13:07:56 +00:00
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
### Trademarks
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
### Company Information
Task Venture Capital GmbH
Registered at District court Bremen HRB 35230 HB, Germany
2019-05-14 15:39:33 +00:00
2024-04-12 13:07:56 +00:00
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
2019-05-14 15:39:33 +00:00
2024-04-12 13:07:56 +00:00
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.