docs: community plugins (update)

This commit is contained in:
lowlighter
2022-01-16 21:54:48 -05:00
parent b4f9c32f42
commit 5b944a70aa

View File

@@ -1,10 +1,15 @@
<table> <table>
<tr><th><h3>🎲 Community plugins</h3></th></tr> <tr><th colspan="2"><h3>🎲 Community plugins</h3></th></tr>
<tr><td 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"> <td align="center">
<% for (const [plugin, {name, category}] of Object.entries(plugins).filter(([key, value]) => (value)&&(value.category === "community")).sort(([an, a], [bn, b]) => a.category === b.category ? an.localeCompare(bn) : 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)) { %><%# -%>
<a href="/source/plugins/community/<%= plugin %>/README.md"><%- name %> <sub>`<%= plugin %>`</sub></a> <a href="/source/plugins/community/<%= plugin %>/README.md"><%- name %> <sub><code><%= plugin %></code></sub></a><br><% } %>
<img width="900" height="1" alt="">
</td>
<td align="center">
<% 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)) { %><%# -%>
<a href="/source/plugins/community/<%= plugin %>/README.md"><%- name %> <sub><code><%= plugin %></code></sub></a><br><% } %>
<img width="900" height="1" alt=""> <img width="900" height="1" alt="">
</td> </td>
</tr> </tr>
@@ -192,13 +197,13 @@ Plugin partials should be able to handle gracefully their own state and errors.
Below is a minimal snippet of a partial: Below is a minimal snippet of a partial:
```ejs ```ejs
<% if (plugins.{plugin_name}) { %> <<%= "%" %> if (plugins.{plugin_name}) { <%= "%" %>>
<% if (plugins.{plugin_name}.error) { %> <<%= "%" %> if (plugins.{plugin_name}.error) { <%= "%" %>>
<%= plugins.{plugin_name}.error.message %> <<%= "%=" %> plugins.{plugin_name}.error.message <%= "%" %>>
<% } else { %> <<%= "%" %> } else { <%= "%" %>>
<%# content %> <<%= "%#" %> content <%= "%" %>>
<% } %> <<%= "%" %> } <%= "%" %>>
<% } %> <<%= "%" %> } <%= "%" %>>
``` ```
Partials should have the match the same name as plugin handles, as they're used to display plugin compatibility in auto-generated header. Partials should have the match the same name as plugin handles, as they're used to display plugin compatibility in auto-generated header.