Skip to content

Commit

Permalink
Add source list for plugins/themes
Browse files Browse the repository at this point in the history
  • Loading branch information
DogmaDragon committed Feb 1, 2025
1 parent 938848f commit 816c01e
Show file tree
Hide file tree
Showing 9 changed files with 221 additions and 42 deletions.
13 changes: 12 additions & 1 deletion builder/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ function printPlugins(outputName: string, sortedPlugins: Plugin[]) {
// print to file
const outputPath = `./dist/${outputName}/list.md`
const stream = fs.createWriteStream(outputPath)
stream.write(`# List of ${outputName} \n\n`)
stream.write(`# Browse ${outputName} \n\n`)
stream.write(getSourceIndexes(sortedPlugins))
stream.write(`## All ${outputName} \n\n`)
// iterate over plugins
for (const plugin of sortedPlugins) {
stream.write(plugin.printMD())
Expand All @@ -55,6 +57,15 @@ function printPlugins(outputName: string, sortedPlugins: Plugin[]) {
stream.end()
}

function getSourceIndexes(plugins: Plugin[]): string {
const indexes = Array.from(new Set(plugins.map(plugin => plugin.index))).sort((a, b) => a.localeCompare(b));
return `
## Sources
${indexes.map(index => `1. [${index}](${index})`).join('\n')}
`;
}

async function parseRepository(localRepository: LocalRepository): Promise<Plugin[]> {
// load from parsed
const repoDefaults: LocalCollection = localRepository.collection
Expand Down
2 changes: 1 addition & 1 deletion docs/integrations/list.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: List of integrations
title: Browse integrations
---

??? tip "stash-git-index"
Expand Down
2 changes: 1 addition & 1 deletion docs/metadata-sources/list.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
title: Scrapers list
title: Browse scrapers
icon: octicons/link-external-16
---
Loading

0 comments on commit 816c01e

Please sign in to comment.