docs: community plugins examples

This commit is contained in:
lowlighter
2022-01-18 13:10:14 -05:00
parent d7a3479fc2
commit dd35715902
2 changed files with 38 additions and 17 deletions

View File

@@ -1,18 +1,24 @@
<table> <table>
<tr><th colspan="2"><h3>🎲 Community plugins</h3></th></tr> <tr><th colspan="2"><h3>🎲 Community plugins</h3></th></tr>
<tr><td colspan="2" align="center">Additional plugins maintained by community for even more features!</td></tr> <tr><td colspan="2" align="center">Additional plugins maintained by community for even more features!</td></tr>
<tr> <% {
<td align="center"> let cell = 0
<% 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)) { %><%# -%> const elements = Object.entries(plugins).filter(([key, value]) => (value)&&(value.category === "community"))
<a href="/source/plugins/community/<%= plugin %>/README.md"><%- name %> <sub><code><%= plugin %></code></sub></a><br><% } %> if (elements.length%2)
<img width="900" height="1" alt=""> elements.push(["", {readme:{demo:`<td align="center"><img width="900" height="1" alt=""></td>`}}])
</td> for (let i = 0; i < elements.length; i+=2) {
<td align="center"> const cells = [["even", elements[i]], ["odd", elements[i+1]]]
<% 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)) { %><%# -%> for (const [cell, [plugin, {name, readme}]] of cells) {
<a href="/source/plugins/community/<%= plugin %>/README.md"><%- name %> <sub><code><%= plugin %></code></sub></a><br><% } %> if (cell === "even") { %> <tr><% } %>
<img width="900" height="1" alt=""> <th><% if (plugin) { %><a href="source/plugins/community/<%= plugin %>/README.md"><%= name -%></a><% } %></th><%
</td> if (cell === "odd") { %>
</tr> </tr>
<% }}
for (const [cell, [plugin, {name, readme}]] of cells) {
if (cell === "even") { %> <tr><% } %>
<%- readme.demo.replace(/<img src=/g, `<img alt="" width="400" src=`) %><%
if (cell === "odd") { %>
</tr><% }}}} %>
</table> </table>
## 📪 Creating community plugins ## 📪 Creating community plugins
@@ -87,7 +93,6 @@ inputs:
description: Enable {name} plugin description: Enable {name} plugin
type: boolean type: boolean
default: no default: no
``` ```
> 💡 It is important to correctly define `metadata.yml` because *metrics* will use its content for various usage > 💡 It is important to correctly define `metadata.yml` because *metrics* will use its content for various usage

View File

@@ -2,12 +2,29 @@
<tr><th colspan="2"><h3>🎲 Community plugins</h3></th></tr> <tr><th colspan="2"><h3>🎲 Community plugins</h3></th></tr>
<tr><td colspan="2" align="center">Additional plugins maintained by community for even more features!</td></tr> <tr><td colspan="2" align="center">Additional plugins maintained by community for even more features!</td></tr>
<tr> <tr>
<td align="center"> <th><a href="source/plugins/community/nightscout/README.md">💉 Nightscout</a></th>
<a href="/source/plugins/community/nightscout/README.md">💉 Nightscout <sub><code>nightscout</code></sub></a><br> <a href="/source/plugins/community/screenshot/README.md">📸 Website screenshot <sub><code>screenshot</code></sub></a><br> <th><a href="source/plugins/community/poopmap/README.md">💩 PoopMap plugin</a></th>
</tr>
<tr>
<td align="center">
<img alt="" width="400" src="https://github.com/legoandmars/legoandmars/blob/master/metrics.plugin.nightscout.svg" alt=""></img>
<img width="900" height="1" alt=""> <img width="900" height="1" alt="">
</td> </td>
<td align="center"> <td align="center">
<a href="/source/plugins/community/poopmap/README.md">💩 PoopMap plugin <sub><code>poopmap</code></sub></a><br> <a href="/source/plugins/community/stock/README.md">💹 Stock prices <sub><code>stock</code></sub></a><br> <img alt="" width="400" src="https://github.com/matievisthekat/matievisthekat/blob/master/metrics.plugin.poopmap.svg" alt=""></img>
<img width="900" height="1" alt="">
</td>
</tr> <tr>
<th><a href="source/plugins/community/screenshot/README.md">📸 Website screenshot</a></th>
<th><a href="source/plugins/community/stock/README.md">💹 Stock prices</a></th>
</tr>
<tr>
<td align="center">
<img alt="" width="400" src="https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.screenshot.svg" alt=""></img>
<img width="900" height="1" alt="">
</td>
<td align="center">
<img alt="" width="400" src="https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.stock.svg" alt=""></img>
<img width="900" height="1" alt=""> <img width="900" height="1" alt="">
</td> </td>
</tr> </tr>
@@ -85,7 +102,6 @@ inputs:
description: Enable {name} plugin description: Enable {name} plugin
type: boolean type: boolean
default: no default: no
``` ```
> 💡 It is important to correctly define `metadata.yml` because *metrics* will use its content for various usage > 💡 It is important to correctly define `metadata.yml` because *metrics* will use its content for various usage