1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-30 10:36:35 +02:00
joplin/packages/lib/services/commands/commandsToMarkdownTable.ts

33 lines
632 B
TypeScript
Raw Normal View History

2020-11-05 18:58:23 +02:00
import markdownUtils, { MarkdownTableHeader, MarkdownTableRow } from '../../markdownUtils';
export default function commandsToMarkdownTable(): string {
const headers: MarkdownTableHeader[] = [
{
name: 'commandName',
label: 'Name',
},
{
name: 'description',
label: 'Description',
},
{
name: 'props',
label: 'Props',
},
];
const rows: MarkdownTableRow[] = [];
for (const commandName in this.commands_) {
const row: MarkdownTableRow = {
commandName: commandName,
description: this.label(commandName),
};
rows.push(row);
}
return markdownUtils.createMarkdownTable(headers, rows);
}