docs: add support for disclaimer and notes

This commit is contained in:
lowlighter
2022-07-29 18:07:00 -04:00
parent 212d5c4d29
commit b8c6e2aaca
14 changed files with 38 additions and 5 deletions

View File

@@ -98,9 +98,11 @@ metadata.plugin = async function({__plugins, __templates, name, logger}) {
const {inputs, ...meta} = yaml.load(raw)
Object.assign(metadata.inputs, inputs)
//category
//Category
if (!categories.includes(meta.category))
meta.category = "community"
if ((meta.category === "github")&&(!meta.disclaimer))
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."
//Inputs parser
{
@@ -397,6 +399,8 @@ metadata.plugin = async function({__plugins, __templates, name, logger}) {
` <tr><th colspan="2"><h3>${meta.name}</h3></th></tr>`,
` <tr><td colspan="2" align="center">${marked.parse(meta.description ?? "", {silent: true})}</td></tr>`,
meta.deprecation ? ` <tr><th>⚠️ Deprecated</th><td>${marked.parse(meta.deprecation ?? "", {silent: true})}</td></tr>` : "",
meta.disclaimer ? ` <tr><th>⚠️ Disclaimer</th><td>${marked.parse(meta.disclaimer ?? "", {silent: true})}</td></tr>` : "",
meta.notes ? ` <tr><th> Additional notes</th><td>${marked.parse(meta.notes ?? "", {silent: true})}</td></tr>` : "",
meta.authors?.length ? `<tr><th>Authors</th><td>${[meta.authors].flat().map(author => `<a href="https://github.com/${author}">@${author}</a>`)}</td></tr>` : "",
" <tr>",
' <th rowspan="3">Supported features<br><sub><a href="metadata.yml">→ Full specification</a></sub></th>',

View File

@@ -2,6 +2,9 @@ name: 🌸 Anilist watch list and reading list
category: social
description: |
This plugin displays favorites animes, mangas and characters from a [AniList](https://anilist.co) account.
disclaimer: |
This plugin is not affiliated, associated, authorized, endorsed by, or in any way officially connected with [AniList](https://anilist.co).
All product and company names are trademarks™ or registered® trademarks of their respective holders.
examples:
+for anime watchers: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.anilist.svg
for manga readers: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.anilist.manga.svg

View File

@@ -2,7 +2,7 @@ name: ♐ Random code snippet
category: github
description: |
This plugin displays a random code snippet from recent activity history.
notes: |
> ⚠️ When improperly configured, this plugin could display private code.
> If you work with sensitive data or company code, it is advised to keep this plugin disabled.
> Use at your own risk, *metrics* and its authors cannot be held responsible for any resulting code leaks.

View File

@@ -2,6 +2,9 @@ name: 💉 Nightscout
category: community
description: |
This plugin displays blood sugar values from a [Nightscout](http://nightscout.info) site.
disclaimer: |
This plugin is not affiliated, associated, authorized, endorsed by, or in any way officially connected with [Nightscout](http://nightscout.info).
All product and company names are trademarks™ or registered® trademarks of their respective holders.
examples:
default: https://github.com/legoandmars/legoandmars/blob/master/metrics.plugin.nightscout.svg
authors:

View File

@@ -2,6 +2,9 @@ name: 💩 PoopMap plugin
category: community
description: |
This plugin displays statistics from a [PoopMap](https://poopmap.net) account.
disclaimer: |
This plugin is not affiliated, associated, authorized, endorsed by, or in any way officially connected with [PoopMap](https://poopmap.net).
All product and company names are trademarks™ or registered® trademarks of their respective holders.
examples:
default: https://github.com/matievisthekat/matievisthekat/blob/master/metrics.plugin.poopmap.svg
authors:

View File

@@ -2,6 +2,11 @@ name: 📜 Repository licenses
category: github
description: |
This plugin display repository license informations like permissions, limitations and conditions along with additional stats about dependencies.
notes: |
> ⚠️ This is **NOT** legal advice, use at your own risk
> 💣 This plugin **SHOULD NOT** be enabled on web instances, since it allows raw command injection.
> This could result in compromised server!
examples:
+permissions, limitations and conditions: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.licenses.svg
+licenses overview: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.licenses.ratio.svg

View File

@@ -4,6 +4,9 @@ description: |
This plugin can display top and recently listened music tracks or titles from a random playlist.
Different music providers are supported.
disclaimer: |
This plugin is not affiliated, associated, authorized, endorsed by, or in any way officially connected with any of the supported provider.
All product and company names are trademarks™ or registered® trademarks of their respective holders.
examples:
+random tracks from a playlist: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.music.playlist.svg
+recently listened: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.music.recent.svg

View File

@@ -4,6 +4,9 @@ description: |
This plugin displays performance statistics of a website.
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.
disclaimer: |
This plugin is not affiliated, associated, authorized, endorsed by, or in any way officially connected with [Google PageSpeed](https://pagespeed.web.dev/).
All product and company names are trademarks™ or registered® trademarks of their respective holders.
examples:
+PageSpeed scores: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.pagespeed.svg
PageSpeed scores with detailed report: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.pagespeed.detailed.svg

View File

@@ -2,7 +2,7 @@ name: 🗂️ GitHub projects
category: github
description: |
This plugin displays progress of profile and repository projects.
notes: |
> 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)
examples:
default: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.projects.svg

View File

@@ -4,7 +4,7 @@ description: |
This plugin displays a list of chosen featured repositories.
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.
notes: |
> ⚠️ Due to limitations of using SVG images inside `<img>` tags, clicking on a repository card will not redirect to repository page.
examples:
+featured: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.repositories.svg

View File

@@ -2,7 +2,7 @@ name: 🌇 GitHub Skyline
category: github
description: |
This plugin displays the 3D commits calendar from [skyline.github.com](https://skyline.github.com/).
notes: |
> ⚠️ This plugin significantly increase file size, consider using it as standalone.
examples:
+GitHub Skyline: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.skyline.svg

View File

@@ -2,6 +2,9 @@ name: 🗨️ Stack Overflow
category: social
description: |
This plugin displays stats, questions and answer from [Stack Overflow](https://stackoverflow.com/).
disclaimer: |
This plugin is not affiliated, associated, authorized, endorsed by, or in any way officially connected with [Stack Overflow](https://stackoverflow.com/).
All product and company names are trademarks™ or registered® trademarks of their respective holders.
examples:
default: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.stackoverflow.svg
index: 3

View File

@@ -2,6 +2,9 @@ name: 🐤 Latest tweets
category: social
description: |
This plugin displays the latest tweets from a [Twitter](https://twitter.com) account.
disclaimer: |
This plugin is not affiliated, associated, authorized, endorsed by, or in any way officially connected with [Twitter](https://twitter.com).
All product and company names are trademarks™ or registered® trademarks of their respective holders.
examples:
+latest tweets with attachments: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.tweets.attachments.svg
latest tweets: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.tweets.svg

View File

@@ -4,6 +4,9 @@ description: |
This plugin displays statistics from a [WakaTime](https://wakatime.com) account.
It is also compatible with self-hosted instances from [wakapi](https://github.com/muety/wakapi).
disclaimer: |
This plugin is not affiliated, associated, authorized, endorsed by, or in any way officially connected with [WakaTime](https://wakatime.com).
All product and company names are trademarks™ or registered® trademarks of their respective holders.
examples:
default: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.wakatime.svg
index: 8