docs: improve community plugins
This commit is contained in:
@@ -36,13 +36,31 @@ Generate metrics that can be embedded everywhere, including your GitHub profile
|
||||
<% } %> <%- readme.demo.replace(/<img src=/g, `<img alt="" width="400" src=`)?.split("\n")?.map((x, i) => i ? ` ${x}` : x)?.join("\n") %>
|
||||
<% if (cell === "odd") {
|
||||
-%> </tr>
|
||||
<% }}} -%>
|
||||
<% }}}} {
|
||||
let cell = 0
|
||||
const elements = Object.entries(plugins).filter(([key, value]) => (value.category === "community")&&(!value.deprecation))
|
||||
if (elements.length%2)
|
||||
elements.push(["", {readme:{demo:`<td align="center"><img width="900" height="1" alt=""></td>`}}])
|
||||
-%>
|
||||
<tr>
|
||||
<th colspan="2" align="center">
|
||||
<a href="/source/plugins/community/README.md">🎲 See also community plugins</a>
|
||||
</th>
|
||||
</tr>
|
||||
<%
|
||||
for (let i = 0; i < elements.length; i+=2) {
|
||||
const cells = [["even", elements[i]], ["odd", elements[i+1]]]
|
||||
for (const [cell, [plugin, {name, readme, authors}]] of cells) {
|
||||
if (cell === "even") {
|
||||
-%>
|
||||
<tr>
|
||||
<% } %> <th><% if (plugin) { %><a href="source/plugins/community/<%= plugin %>/README.md"><%= name -%></a><br><sup>by <%- authors.map(author => `<a href="https://github.com/${author}">@${author}</a>`).join(" ") %></sup>
|
||||
<%- readme.demo.replace(/<td.*?>([\s\S]+?)<\/td>/, `<details><summary>Render example</summary>$1</details>`).replace(/<img src=/g, `<img alt="" width="400" src=`)?.split("\n")?.map((x, i) => i ? ` ${x}` : x)?.join("\n") %>
|
||||
<% } %>
|
||||
</th>
|
||||
<% if (cell === "odd") {
|
||||
-%> </tr>
|
||||
<% }}}} %>
|
||||
<% {
|
||||
let cell = 0
|
||||
const elements = Object.entries(templates).filter(([key, value]) => (value)&&(!["community"].includes(key)))
|
||||
@@ -94,6 +112,11 @@ Generate metrics that can be embedded everywhere, including your GitHub profile
|
||||
<img src="/.github/readme/imgs/features_insights.gif" width="360">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" colspan="2">
|
||||
Test latest features and patches on <code><a href="https://beta-metrics.lecoq.io">🧪 Metrics beta</a></code>!
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" colspan="2">
|
||||
<b>Power user?</b><br>
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
elements.push(["", {readme:{demo:`<td align="center"><img width="900" height="1" alt=""></td>`}}])
|
||||
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) {
|
||||
for (const [cell, [plugin, {name, readme, authors}]] of cells) {
|
||||
if (cell === "even") { %> <tr><% } %>
|
||||
<th><% if (plugin) { %><a href="/source/plugins/community/<%= plugin %>/README.md"><%= name -%></a><% } %></th><%
|
||||
<th><% if (plugin) { %><a href="/source/plugins/community/<%= plugin %>/README.md"><%= name -%></a><br><sup>by <%- authors.map(author => `<a href="https://github.com/${author}">@${author}</a>`).join(" ") %></sup><% } %></th><%
|
||||
if (cell === "odd") { %>
|
||||
</tr>
|
||||
<% }}
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
<table>
|
||||
<tr><th colspan="2"><h3>📕 Community templates</h3></th></tr>
|
||||
<tr><td colspan="2" align="center">A template capable of rendering markdown from a given template file.</td></tr>
|
||||
<tr>
|
||||
<td colspan="2" align="center">
|
||||
<img src="https://github.com/lowlighter/metrics/blob/examples/metrics.markdown.png" alt=""></img>
|
||||
<img width="900" height="1" alt="">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<tr><td colspan="2" align="center">
|
||||
|
||||
Community templates are a way to use official releases of [lowlighter/metrics](https://github.com/lowlighter/metrics) while using templates from external repositories (owned or not).
|
||||
|
||||
</td></tr>
|
||||
</table>
|
||||
|
||||
## 📮 Using community templates
|
||||
|
||||
Use `setup_community_templates` option to specify additional external sources using following format:
|
||||
|
||||
Reference in New Issue
Block a user