|
| 1 | +# Docflow · [](https://github.com/toss/docflow/blob/main/LICENSE) [](https://www.npmjs.com/package/docflow) |
| 2 | + |
| 3 | +English | [한국어](https://github.com/toss/docflow/blob/main/README-ko_kr.md) |
| 4 | + |
| 5 | +Docflow is a TypeScript-first documentation generator that automatically creates API documentation from JSDoc comments. |
| 6 | + |
| 7 | +- Docflow automatically generates comprehensive documentation from JSDoc comments, supporting essential tags like [@public](https://docflow.dev/reference/public), [@category](https://docflow.dev/reference/category), and [@example](https://docflow.dev/reference/example). |
| 8 | +- Designed with AI integration in mind, Docflow can [generate complete JSDoc comments](https://docflow.dev/features/ai-generation) for your functions with a single `@generate` tag. |
| 9 | +- Docflow provides [accurate TypeScript type extraction](https://docflow.dev/features/typescript), ensuring your documentation always matches your actual code signatures. |
| 10 | +- Docflow includes a powerful plugin system, allowing you to generate documentation for [VitePress](https://docflow.dev/plugins/vitepress), [Docusaurus](https://docflow.dev/plugins/docusaurus), [Nextra](https://docflow.dev/plugins/nextra), and more. |
| 11 | + |
| 12 | +## Examples |
| 13 | + |
| 14 | +```typescript |
| 15 | +import { createCalculator } from "@toss/utils"; |
| 16 | + |
| 17 | +/** |
| 18 | + * @public |
| 19 | + * @category Math |
| 20 | + * Creates a calculator instance with the given initial value |
| 21 | + * @param initialValue - The starting value for calculations |
| 22 | + * @returns A calculator object with calculation methods |
| 23 | + * @example |
| 24 | + * const calc = createCalculator(10); |
| 25 | + * calc.add(5).multiply(2).getValue(); // 30 |
| 26 | + */ |
| 27 | +export function createCalculator(initialValue: number) { |
| 28 | + return { |
| 29 | + add: (n: number) => createCalculator(initialValue + n), |
| 30 | + multiply: (n: number) => createCalculator(initialValue * n), |
| 31 | + getValue: () => initialValue, |
| 32 | + }; |
| 33 | +} |
| 34 | +``` |
| 35 | + |
| 36 | +With just `docflow build`, this becomes a beautiful documentation page with examples, type information, and more. |
| 37 | + |
| 38 | +## Contributing |
| 39 | + |
| 40 | +We welcome contribution from everyone in the community. Read below for detailed contribution guide. |
| 41 | + |
| 42 | +[CONTRIBUTING](https://github.com/toss/docflow/blob/main/.github/CONTRIBUTING.md) |
| 43 | + |
| 44 | +## License |
| 45 | + |
| 46 | +MIT © Toss. See [LICENSE](./LICENSE) for details. |
| 47 | + |
| 48 | +<a title="Toss" href="https://toss.im"> |
| 49 | + <picture> |
| 50 | + <source media="(prefers-color-scheme: dark)" srcset="https://static.toss.im/logos/png/4x/logo-toss-reverse.png"> |
| 51 | + <img alt="Toss" src="https://static.toss.im/logos/png/4x/logo-toss.png" width="100"> |
| 52 | + </picture> |
| 53 | +</a> |
0 commit comments