docgeni / docgeni

📖 A modern, powerful and out of the box documentation generator for Angular components lib and markdown docs.(现代化的、强大的、开箱即用的 Angular 组件文档生成工具)

Home Page:https://docgeni.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

希望 api文档 支持管道,常量,箭头函数,枚举,函数等的注释导出

chensi66666 opened this issue · comments

封装组件库时,除类和接口等外,还会封装其他的一些东西,如管道,常量,箭头函数,枚举,函数等,可以考虑为他们实现通过注释生成 api 文档

1.管道

/**
 * 这是一个管道
 * @public
 */
@Pipe({
  name: 'test',
  standalone: true
})
export class TestPipe implements PipeTransform {
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
  transform(value: any, args?: unknown[]): unknown {
    return value;
  }
}

2.常量

/**
 * 这个一个常量
 * @public
 */
export const PI = 3.14;

3.箭头函数

/**
 * 这是一个工具函数
 * @param p1 参数1
 * @param p2 参数2
 * @return 返回值
 * @public
 */
export const test = (p1: string, p2: string): string => {
        return p1 + p2;
    }

4.枚举

/**
 * 枚举值
 *
 * @public
 */
export enum TestType {
  /**
   * A
   */
  A = '123',
  /**
   * B
   */
  B = '456',
  /**
   * C
   */
  C = '789',
}

5.函数

/**
 * 这是一个工具函数
 * @param p1 参数1
 * @param p2 参数2
 * @return 返回值
 * @public
 */
export function test(p1: string, p2: string): string {
    return p1 + p2;
}

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.