forked from lowlighter/metrics
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: updated workflows examples and options descriptions (lowlighter…
…#772) [skip ci]
- Loading branch information
1 parent
44e3992
commit 4d06539
Showing
80 changed files
with
2,271 additions
and
429 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
//Imports | ||
import fs from "fs/promises" | ||
import fss from "fs" | ||
import paths from "path" | ||
import url from "url" | ||
import metadata from "../source/app/metrics/metadata.mjs" | ||
import yaml from "js-yaml" | ||
|
||
//Paths | ||
const __metrics = paths.join(paths.dirname(url.fileURLToPath(import.meta.url)), "..") | ||
const __templates = paths.join(paths.join(__metrics, "source/templates/")) | ||
const __plugins = paths.join(paths.join(__metrics, "source/plugins/")) | ||
|
||
//Load plugins metadata | ||
const {plugins, templates} = await metadata({log:false, diff:true}) | ||
|
||
async function plugin(id) { | ||
const path = paths.join(__plugins, id) | ||
const readme = paths.join(path, "README.md") | ||
const examples = paths.join(path, "examples.yml") | ||
return { | ||
readme:{ | ||
path:readme, | ||
content:`${await fs.readFile(readme)}` | ||
}, | ||
examples:fss.existsSync(examples) ? yaml.load(await fs.readFile(examples), "utf8") ?? [] : [], | ||
options:plugins[id].readme.table | ||
} | ||
} | ||
|
||
//Plugins | ||
for (const id of Object.keys(plugins)) { | ||
const {examples, options, readme} = await plugin(id) | ||
//Plugin readme | ||
await fs.writeFile(readme.path, readme.content | ||
.replace(/(<!--examples-->)[\s\S]*(<!--\/examples-->)/g, `$1\n${examples.map(({test, prod, ...step}) => ["```yaml", yaml.dump(step), "```"].join("\n")).join("\n")}\n$2`) | ||
.replace(/(<!--options-->)[\s\S]*(<!--\/options-->)/g, `$1\n${options}\n$2`) | ||
) | ||
//Plugin tests | ||
} | ||
|
||
//Templates | ||
|
||
//Workflow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
- name: Detailed display | ||
uses: lowlighter/metrics@latest | ||
with: | ||
filename: metrics.plugin.achievements.svg | ||
token: ${{ secrets.METRICS_TOKEN }} | ||
base: "" | ||
plugin_achievements: yes | ||
plugin_achievements_only: sponsor, maintainer, octonaut | ||
test: | ||
timeout: 900000 | ||
|
||
- name: Compact display | ||
uses: lowlighter/metrics@latest | ||
with: | ||
filename: metrics.plugin.achievements.compact.svg | ||
token: ${{ secrets.METRICS_TOKEN }} | ||
base: "" | ||
plugin_achievements: yes | ||
plugin_achievements_only: polyglot, stargazer, sponsor, deployer, member, maintainer, developer, scripter, packager, explorer, infographile, manager | ||
plugin_achievements_display: compact | ||
plugin_achievements_threshold: X | ||
test: | ||
timeout: 900000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
- name: Recent activity | ||
uses: lowlighter/metrics@latest | ||
with: | ||
filename: metrics.plugin.activity.svg | ||
token: ${{ secrets.METRICS_TOKEN }} | ||
base: "" | ||
plugin_activity: yes | ||
plugin_activity_limit: 5 | ||
plugin_activity_days: 0 | ||
plugin_activity_filter: issue, pr, release, fork, review, ref/create |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
- name: Favorites anime and currently watching | ||
uses: lowlighter/metrics@latest | ||
with: | ||
filename: metrics.plugin.anilist.svg | ||
token: NOT_NEEDED | ||
plugin_anilist: yes | ||
plugin_anilist_medias: anime | ||
plugin_anilist_sections: favorites, watching | ||
plugin_anilist_limit: 1 | ||
|
||
- name: Favorites manga and currently reading | ||
uses: lowlighter/metrics@latest | ||
with: | ||
filename: metrics.plugin.anilist.manga.svg | ||
token: NOT_NEEDED | ||
plugin_anilist: yes | ||
plugin_anilist_medias: manga | ||
plugin_anilist_sections: favorites, reading | ||
plugin_anilist_limit: 1 | ||
|
||
- name: Favorites characters | ||
uses: lowlighter/metrics@latest | ||
with: | ||
filename: metrics.plugin.anilist.characters.svg | ||
token: NOT_NEEDED | ||
plugin_anilist: yes | ||
plugin_anilist_sections: characters | ||
plugin_anilist_limit_characters: 22 |
Oops, something went wrong.