1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +02:00

Plugin Repo: Added plugin download links on README page

This commit is contained in:
Laurent Cozic
2021-08-05 17:32:00 +01:00
parent b3ce5fbc48
commit fa9c08be06
6 changed files with 100 additions and 8 deletions

View File

@@ -2,20 +2,36 @@ import * as fs from 'fs-extra';
import markdownUtils, { MarkdownTableHeader, MarkdownTableRow } from '@joplin/lib/markdownUtils';
export default async function(readmePath: string, manifests: any) {
const rows: MarkdownTableRow[] = [];
let rows: MarkdownTableRow[] = [];
for (const pluginId in manifests) {
rows.push(manifests[pluginId]);
}
rows = rows.map(row => {
return {
...row,
download_url: `https://github.com/joplin/plugins/raw/master/plugins/${row.id}/plugin.jpl`,
};
});
const headers: MarkdownTableHeader[] = [
{
name: 'homepage_url',
label: ' ',
filter: (value: string) => {
if (!value) return '-';
return `[🏠](${markdownUtils.escapeLinkUrl(value)})`;
},
},
{
name: 'download_url',
label: ' ',
filter: (value: string) => {
if (!value) return '-';
return `[⬇️](${markdownUtils.escapeLinkUrl(value)})`;
},
},
{
name: 'name',
label: 'Name',