Skip to content

Commit 816c01e

Browse files
committed
Add source list for plugins/themes
1 parent 938848f commit 816c01e

File tree

9 files changed

+221
-42
lines changed

9 files changed

+221
-42
lines changed

builder/build.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ function printPlugins(outputName: string, sortedPlugins: Plugin[]) {
4646
// print to file
4747
const outputPath = `./dist/${outputName}/list.md`
4848
const stream = fs.createWriteStream(outputPath)
49-
stream.write(`# List of ${outputName} \n\n`)
49+
stream.write(`# Browse ${outputName} \n\n`)
50+
stream.write(getSourceIndexes(sortedPlugins))
51+
stream.write(`## All ${outputName} \n\n`)
5052
// iterate over plugins
5153
for (const plugin of sortedPlugins) {
5254
stream.write(plugin.printMD())
@@ -55,6 +57,15 @@ function printPlugins(outputName: string, sortedPlugins: Plugin[]) {
5557
stream.end()
5658
}
5759

60+
function getSourceIndexes(plugins: Plugin[]): string {
61+
const indexes = Array.from(new Set(plugins.map(plugin => plugin.index))).sort((a, b) => a.localeCompare(b));
62+
return `
63+
## Sources
64+
65+
${indexes.map(index => `1. [${index}](${index})`).join('\n')}
66+
`;
67+
}
68+
5869
async function parseRepository(localRepository: LocalRepository): Promise<Plugin[]> {
5970
// load from parsed
6071
const repoDefaults: LocalCollection = localRepository.collection

docs/integrations/list.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: List of integrations
2+
title: Browse integrations
33
---
44

55
??? tip "stash-git-index"

docs/metadata-sources/list.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
---
2-
title: Scrapers list
2+
title: Browse scrapers
33
icon: octicons/link-external-16
44
---

0 commit comments

Comments
 (0)