typedoc-plugin-markdown
Version:
A plugin for TypeDoc that enables TypeScript API documentation to be generated in Markdown.
12 lines (11 loc) • 424 B
JavaScript
import { formatTableCell } from '../../libs/utils/index.js';
/**
* Comments for table
* @param headers
* @param rows
*/
export function table(headers, rows, headerLeftAlign = false) {
return `\n| ${headers.join(' | ')} |\n| ${headers
.map(() => `${headerLeftAlign ? ':' : ''}------`)
.join(' | ')} |\n${rows.map((row) => `| ${row.map((cell) => formatTableCell(cell)).join(' | ')} |\n`).join('')}`;
}