Skip to content

Commit b8c6e2a

Browse files
committed
docs: add support for disclaimer and notes
1 parent 212d5c4 commit b8c6e2a

File tree

14 files changed

+38
-5
lines changed

14 files changed

+38
-5
lines changed

source/app/metrics/metadata.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,11 @@ metadata.plugin = async function({__plugins, __templates, name, logger}) {
9898
const {inputs, ...meta} = yaml.load(raw)
9999
Object.assign(metadata.inputs, inputs)
100100

101-
//category
101+
//Category
102102
if (!categories.includes(meta.category))
103103
meta.category = "community"
104+
if ((meta.category === "github")&&(!meta.disclaimer))
105+
meta.disclaimer = "This plugin is not affiliated, associated, authorized, endorsed by, or in any way officially connected with [GitHub](https://github.com).\nAll product and company names are trademarks™ or registered® trademarks of their respective holders."
104106

105107
//Inputs parser
106108
{
@@ -397,6 +399,8 @@ metadata.plugin = async function({__plugins, __templates, name, logger}) {
397399
` <tr><th colspan="2"><h3>${meta.name}</h3></th></tr>`,
398400
` <tr><td colspan="2" align="center">${marked.parse(meta.description ?? "", {silent: true})}</td></tr>`,
399401
meta.deprecation ? ` <tr><th>⚠️ Deprecated</th><td>${marked.parse(meta.deprecation ?? "", {silent: true})}</td></tr>` : "",
402+
meta.disclaimer ? ` <tr><th>⚠️ Disclaimer</th><td>${marked.parse(meta.disclaimer ?? "", {silent: true})}</td></tr>` : "",
403+
meta.notes ? ` <tr><th>ℹ Additional notes</th><td>${marked.parse(meta.notes ?? "", {silent: true})}</td></tr>` : "",
400404
meta.authors?.length ? `<tr><th>Authors</th><td>${[meta.authors].flat().map(author => `<a href="https://github.com/${author}">@${author}</a>`)}</td></tr>` : "",
401405
" <tr>",
402406
' <th rowspan="3">Supported features<br><sub><a href="metadata.yml">→ Full specification</a></sub></th>',

source/plugins/anilist/metadata.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: 🌸 Anilist watch list and reading list
22
category: social
33
description: |
44
This plugin displays favorites animes, mangas and characters from a [AniList](https://anilist.co) account.
5+
disclaimer: |
6+
This plugin is not affiliated, associated, authorized, endorsed by, or in any way officially connected with [AniList](https://anilist.co).
7+
All product and company names are trademarks™ or registered® trademarks of their respective holders.
58
examples:
69
+for anime watchers: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.anilist.svg
710
for manga readers: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.anilist.manga.svg

source/plugins/code/metadata.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: ♐ Random code snippet
22
category: github
33
description: |
44
This plugin displays a random code snippet from recent activity history.
5-
5+
notes: |
66
> ⚠️ When improperly configured, this plugin could display private code.
77
> If you work with sensitive data or company code, it is advised to keep this plugin disabled.
88
> Use at your own risk, *metrics* and its authors cannot be held responsible for any resulting code leaks.

source/plugins/community/nightscout/metadata.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: 💉 Nightscout
22
category: community
33
description: |
44
This plugin displays blood sugar values from a [Nightscout](http://nightscout.info) site.
5+
disclaimer: |
6+
This plugin is not affiliated, associated, authorized, endorsed by, or in any way officially connected with [Nightscout](http://nightscout.info).
7+
All product and company names are trademarks™ or registered® trademarks of their respective holders.
58
examples:
69
default: https://github.com/legoandmars/legoandmars/blob/master/metrics.plugin.nightscout.svg
710
authors:

source/plugins/community/poopmap/metadata.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: 💩 PoopMap plugin
22
category: community
33
description: |
44
This plugin displays statistics from a [PoopMap](https://poopmap.net) account.
5+
disclaimer: |
6+
This plugin is not affiliated, associated, authorized, endorsed by, or in any way officially connected with [PoopMap](https://poopmap.net).
7+
All product and company names are trademarks™ or registered® trademarks of their respective holders.
58
examples:
69
default: https://github.com/matievisthekat/matievisthekat/blob/master/metrics.plugin.poopmap.svg
710
authors:

source/plugins/licenses/metadata.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: 📜 Repository licenses
22
category: github
33
description: |
44
This plugin display repository license informations like permissions, limitations and conditions along with additional stats about dependencies.
5+
notes: |
6+
> ⚠️ This is **NOT** legal advice, use at your own risk
7+
8+
> 💣 This plugin **SHOULD NOT** be enabled on web instances, since it allows raw command injection.
9+
> This could result in compromised server!
510
examples:
611
+permissions, limitations and conditions: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.licenses.svg
712
+licenses overview: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.licenses.ratio.svg

source/plugins/music/metadata.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ description: |
44
This plugin can display top and recently listened music tracks or titles from a random playlist.
55
66
Different music providers are supported.
7+
disclaimer: |
8+
This plugin is not affiliated, associated, authorized, endorsed by, or in any way officially connected with any of the supported provider.
9+
All product and company names are trademarks™ or registered® trademarks of their respective holders.
710
examples:
811
+random tracks from a playlist: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.music.playlist.svg
912
+recently listened: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.music.recent.svg

source/plugins/pagespeed/metadata.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ description: |
44
This plugin displays performance statistics of a website.
55
66
It uses [Google's PageSpeed API](https://developers.google.com/speed/docs/insights/v5/get-started) (same as [web.dev](https://web.dev)), see [performance scoring](https://web.dev/performance-scoring/) and [score calculator](https://googlechrome.github.io/lighthouse/scorecalc/) for more informations about results.
7+
disclaimer: |
8+
This plugin is not affiliated, associated, authorized, endorsed by, or in any way officially connected with [Google PageSpeed](https://pagespeed.web.dev/).
9+
All product and company names are trademarks™ or registered® trademarks of their respective holders.
710
examples:
811
+PageSpeed scores: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.pagespeed.svg
912
PageSpeed scores with detailed report: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.pagespeed.detailed.svg

source/plugins/projects/metadata.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: 🗂️ GitHub projects
22
category: github
33
description: |
44
This plugin displays progress of profile and repository projects.
5-
5+
notes: |
66
> ℹ️ This plugin currently only supports [GitHub projects boards](https://docs.github.com/en/issues/organizing-your-work-with-project-boards/managing-project-boards/about-project-boards) and not [GitHub projects (beta)](https://docs.github.com/en/issues/trying-out-the-new-projects-experience/about-projects)
77
examples:
88
default: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.projects.svg

source/plugins/repositories/metadata.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: |
44
This plugin displays a list of chosen featured repositories.
55
66
Since it is possible to [pin repositories](https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-github-profile/customizing-your-profile/pinning-items-to-your-profile) on GitHub, this plugin is mostly intended for external usage.
7-
7+
notes: |
88
> ⚠️ Due to limitations of using SVG images inside `<img>` tags, clicking on a repository card will not redirect to repository page.
99
examples:
1010
+featured: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.repositories.svg

0 commit comments

Comments
 (0)