From dd357159020f653ef53e6cb81b6e41752d64231e Mon Sep 17 00:00:00 2001 From: lowlighter <22963968+lowlighter@users.noreply.github.com> Date: Tue, 18 Jan 2022 13:10:14 -0500 Subject: [PATCH] docs: community plugins examples --- .../partials/templated/plugins.community.md | 29 +++++++++++-------- source/plugins/community/README.md | 26 +++++++++++++---- 2 files changed, 38 insertions(+), 17 deletions(-) diff --git a/.github/readme/partials/templated/plugins.community.md b/.github/readme/partials/templated/plugins.community.md index a609bc0c..03b76b5a 100644 --- a/.github/readme/partials/templated/plugins.community.md +++ b/.github/readme/partials/templated/plugins.community.md @@ -1,18 +1,24 @@ - - - +<% { + let cell = 0 + const elements = Object.entries(plugins).filter(([key, value]) => (value)&&(value.category === "community")) + if (elements.length%2) + elements.push(["", {readme:{demo:``}}]) + for (let i = 0; i < elements.length; i+=2) { + const cells = [["even", elements[i]], ["odd", elements[i+1]]] + for (const [cell, [plugin, {name, readme}]] of cells) { + if (cell === "even") { %> <% } %> + <% + if (cell === "odd") { %> +<% }} + for (const [cell, [plugin, {name, readme}]] of cells) { + if (cell === "even") { %> <% } %> +<%- readme.demo.replace(/<% + if (cell === "odd") { %> + <% }}}} %>

🎲 Community plugins

Additional plugins maintained by community for even more features!
- <% for (const [plugin, {name, category}] of Object.entries(plugins).filter(([key, value], index) => (index%2 === 0)&&(value)&&(value.category === "community")).sort(([an, a], [bn, b]) => a.category === b.category ? an.localeCompare(bn) : 0)) { %><%# -%> - <%- name %> <%= plugin %>
<% } %> - -
- <% for (const [plugin, {name, category}] of Object.entries(plugins).filter(([key, value], index) => (index%2 === 1)&&(value)&&(value.category === "community")).sort(([an, a], [bn, b]) => a.category === b.category ? an.localeCompare(bn) : 0)) { %><%# -%> - <%- name %> <%= plugin %>
<% } %> - -
<% if (plugin) { %><%= name -%><% } %>
## 📪 Creating community plugins @@ -87,7 +93,6 @@ inputs: description: Enable {name} plugin type: boolean default: no - ``` > 💡 It is important to correctly define `metadata.yml` because *metrics* will use its content for various usage diff --git a/source/plugins/community/README.md b/source/plugins/community/README.md index e11503af..879c2a62 100644 --- a/source/plugins/community/README.md +++ b/source/plugins/community/README.md @@ -2,12 +2,29 @@

🎲 Community plugins

Additional plugins maintained by community for even more features! - - 💉 Nightscout nightscout
📸 Website screenshot screenshot
+ 💉 Nightscout + 💩 PoopMap plugin + + + + - - 💩 PoopMap plugin poopmap
💹 Stock prices stock
+ + + + + + 📸 Website screenshot + 💹 Stock prices + + + + + + + + @@ -85,7 +102,6 @@ inputs: description: Enable {name} plugin type: boolean default: no - ``` > 💡 It is important to correctly define `metadata.yml` because *metrics* will use its content for various usage