From 91cc3c07959c3d823c70a19d3f8d7bf3d2cfdac2 Mon Sep 17 00:00:00 2001 From: lowlighter <22963968+lowlighter@users.noreply.github.com> Date: Thu, 25 Nov 2021 21:41:08 -0500 Subject: [PATCH] docs: split community plugins from core maintained ones --- .github/quickstart/plugin/metadata.yml | 8 ++++---- .../readme/partials/documentation/compatibility.md | 8 ++++---- .github/readme/partials/documentation/plugins.md | 7 ++++--- .github/readme/partials/introduction.md | 4 ++-- CONTRIBUTING.md | 12 ++++++------ source/app/metrics/metadata.mjs | 2 +- source/plugins/nightscout/metadata.yml | 4 +++- 7 files changed, 24 insertions(+), 21 deletions(-) diff --git a/.github/quickstart/plugin/metadata.yml b/.github/quickstart/plugin/metadata.yml index 7e1a39fe..9a419b5f 100644 --- a/.github/quickstart/plugin/metadata.yml +++ b/.github/quickstart/plugin/metadata.yml @@ -1,9 +1,9 @@ name: "🧩 <%= `${name.charAt(0).toLocaleUpperCase()}${name.substring(1)}` %>" -category: other # Set plugin category ("github", "social" or "other") +category: community # Leave as it supports: - - user # Support users account - - organization # Support organizations account - - repository # Support repositories metrics + - user # Support users account + - organization # Support organizations account + - repository # Support repositories metrics inputs: # Enable or disable plugin diff --git a/.github/readme/partials/documentation/compatibility.md b/.github/readme/partials/documentation/compatibility.md index 10e6499c..2e1bdb0e 100644 --- a/.github/readme/partials/documentation/compatibility.md +++ b/.github/readme/partials/documentation/compatibility.md @@ -3,13 +3,13 @@ <%# -%> - <% for (const [plugin, {name, icon}] of Object.entries(plugins).filter(([key, value]) => (value)&&(!["core"].includes(key)))) { %> + <% for (const [plugin, {name, icon}] of Object.entries(plugins).filter(([key, value]) => (value)&&(!["core"].includes(key))&&(value.category !== "community"))) { %> <% } %> <%# -%> <% for (const [template, {name, readme}] of Object.entries(templates).filter(([key, value]) => (value)&&(!["community"].includes(key)))) { %> <%# -%> - <% for (const [plugin] of Object.entries(plugins).filter(([key, value]) => (value)&&(!["core"].includes(key)))) { %> + <% for (const [plugin] of Object.entries(plugins).filter(([key, value]) => (value)&&(!["core"].includes(key))&&(value.category !== "community"))) { %> <% } %> <% } %> @@ -17,13 +17,13 @@ <%# -%> - <% for (const [plugin, {name, icon}] of Object.entries(plugins).filter(([key, value]) => (value)&&(!["core"].includes(key)))) { %> + <% for (const [plugin, {name, icon}] of Object.entries(plugins).filter(([key, value]) => (value)&&(!["core"].includes(key))&&(value.category !== "community"))) { %> <% } %> <%# -%> <% for (const {mode, icon} of [{mode:"user", icon:"👤"}, {mode:"organization", icon:"👥"}, {mode:"repository", icon:"📓"}]) { %> <%# -%> - <% for (const [plugin, {supports}] of Object.entries(plugins).filter(([key, value]) => (value)&&(!["core"].includes(key)))) {%> + <% for (const [plugin, {supports}] of Object.entries(plugins).filter(([key, value]) => (value)&&(!["core"].includes(key))&&(value.category !== "community"))) {%> <% } %> <% } %>
Template/Plugin<%= icon %>
<%- name %><%= {true:"✔️", false:"❌", embed:"✓"}[readme.compatibility[plugin]] %>
Mode/Plugin<%= icon %>
<%= icon %> <%- `${mode.charAt(0).toLocaleUpperCase()}${mode.substring(1)}` %><%= supports.includes(mode) ? "✔️" : "❌" %>
diff --git a/.github/readme/partials/documentation/plugins.md b/.github/readme/partials/documentation/plugins.md index 6a3ff845..e12a10a4 100644 --- a/.github/readme/partials/documentation/plugins.md +++ b/.github/readme/partials/documentation/plugins.md @@ -1,10 +1,11 @@ ## 🧩 Plugins Plugins are features which provide additional content and lets you customize your rendered metrics. + See their respective documentation for more informations about how to setup them: -<% { let previous = null; for (const [plugin, {name, category}] of Object.entries(plugins).filter(([key, value]) => value).sort(([an, a], [bn, b]) => a.category === b.category ? an.localeCompare(bn) : 0)) { %> +<% { let previous = null; for (const [plugin, {name, category, authors = []}] of Object.entries(plugins).filter(([key, value]) => value).sort(([an, a], [bn, b]) => a.category === b.category ? an.localeCompare(bn) : 0)) { %> <% if (previous !== category) { previous = category -%> -* **<%= `${category.charAt(0).toLocaleUpperCase()}${category.substring(1)}` %>** +* **<%= `${category.charAt(0).toLocaleUpperCase()}${category.substring(1)}` %>**<% if (category === "community") { %> *(provided and maintained by contributors)*<% } %> <% } -%> - * [<%- name %>](/source/plugins/<%= plugin %>/README.md)<%# -%> + * [<%- name %>](/source/plugins/<%= plugin %>/README.md)<% if (category === "community") { %> <%- authors.map(author => `[@${author}](https://github.com/${author})`).join(" ") %><% } %><%# -%> <% }} %> diff --git a/.github/readme/partials/introduction.md b/.github/readme/partials/introduction.md index e8a7b017..7cd99108 100644 --- a/.github/readme/partials/introduction.md +++ b/.github/readme/partials/introduction.md @@ -15,7 +15,7 @@ Generate your metrics that you can embed everywhere, including your GitHub profi <% { let cell = 0 - const elements = Object.entries(plugins).filter(([key, value]) => (value)&&(!["base", "core"].includes(key))) + const elements = Object.entries(plugins).filter(([key, value]) => (value)&&(!["base", "core"].includes(key)&&(!value.community))) %> And you can customize these heavily with plugins, templates and hundreds of options! @@ -34,7 +34,7 @@ And you can customize these heavily with plugins, templates and hundreds of opti if (cell === "even") { -%> -<% } %> <%= name -%> +<% } %> <% if (plugin) { %><%= name -%><% } %> <% if (cell === "odd") { -%> <% }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 06df3409..c2db95f0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,7 +26,7 @@ Review below which contributions are accepted: ✔️ @@ -423,12 +423,12 @@ For example: Here's an example: ```yaml name: "🧩 Plugin name (with emoji icon)" -category: github # Plugin category ("github", "social" or "other") -index: ~ # Leave as it (this is used to order plugins on metrics README.md) +category: community # Leave as it +index: ~ # Leave as it supports: - - user # Support users account - - organization # Support organizations account - - repository # Support repositories metrics + - user # Support users account + - organization # Support organizations account + - repository # Support repositories metrics inputs: # A comment detailing input purposes diff --git a/source/app/metrics/metadata.mjs b/source/app/metrics/metadata.mjs index 9a03ac57..1b2da06d 100644 --- a/source/app/metrics/metadata.mjs +++ b/source/app/metrics/metadata.mjs @@ -5,7 +5,7 @@ import path from "path" import url from "url" //Defined categories -const categories = ["core", "github", "social", "other"] +const categories = ["core", "github", "social", "other", "community"] /**Metadata descriptor parser */ export default async function metadata({log = true} = {}) { diff --git a/source/plugins/nightscout/metadata.yml b/source/plugins/nightscout/metadata.yml index 193f7058..ade399fa 100644 --- a/source/plugins/nightscout/metadata.yml +++ b/source/plugins/nightscout/metadata.yml @@ -1,5 +1,7 @@ name: "💉 Nightscout" -category: other +category: community +authors: + - legoandmars index: 3 supports: - user