|
| 1 | +Generate your metrics that you can embed everywhere, including your GitHub profile readme! It works for both user and organization accounts, and even for repositories! |
| 2 | + |
| 3 | +<table> |
| 4 | + <tr> |
| 5 | + <th align="center">For user accounts</th> |
| 6 | + <th align="center">For organization accounts</th> |
| 7 | + </tr> |
| 8 | + <tr> |
| 9 | + <%- plugins.base.readme.demo?.replace(/<img src=/g, `<img alt="" width="400" src=`) %> |
| 10 | + </tr> |
| 11 | +</table> |
| 12 | +<% { |
| 13 | + let cell = 0 |
| 14 | + const elements = Object.entries(plugins).filter(([key, value]) => (value)&&(!["base", "core"].includes(key))) |
| 15 | + if (elements.length%2) |
| 16 | + elements.push(["", {}]) |
| 17 | +%> |
| 18 | +<table> |
| 19 | + <tr> |
| 20 | + <th colspan="2" align="center"> |
| 21 | + <a href="source/plugins/README.md">🧩 <%= elements.length %> plugins</a> |
| 22 | + </th> |
| 23 | + </tr> |
| 24 | +<% for (let i = 0; i < elements.length; i+=2) { |
| 25 | + const cells = [["even", elements[i]], ["odd", elements[i+1]]] |
| 26 | + for (const [cell, [plugin, {name, readme}]] of cells) { |
| 27 | + if (cell === "even") { |
| 28 | +-%> |
| 29 | + <tr> |
| 30 | +<% } %> <th><a href="source/plugins/<%= plugin %>/README.md"><%= name -%></a></th> |
| 31 | +<% if (cell === "odd") { |
| 32 | +-%> </tr> |
| 33 | +<% }} |
| 34 | + for (const [cell, [plugin, {name, readme}]] of cells) { |
| 35 | + if (cell === "even") { |
| 36 | +-%> |
| 37 | + <tr> |
| 38 | +<% } %> <%- readme.demo.replace(/<img src=/g, `<img alt="" width="400" src=`)?.split("\n")?.map((x, i) => i ? ` ${x}` : x)?.join("\n") %> |
| 39 | +<% if (cell === "odd") { |
| 40 | +-%> </tr> |
| 41 | +<% }}} -%> |
| 42 | + <tr> |
| 43 | + <th colspan="2" align="center"> |
| 44 | + <a href="https://github.com/lowlighter/metrics/projects/1">More to come soon!</a> |
| 45 | + </th> |
| 46 | + </tr> |
| 47 | +</table> |
| 48 | +<% } %> |
| 49 | +<% { |
| 50 | + let cell = 0 |
| 51 | + const elements = Object.entries(templates).filter(([key, value]) => value) |
| 52 | + if (elements.length%2) |
| 53 | + elements.push(["", {}]) |
| 54 | +%> |
| 55 | +<table> |
| 56 | + <tr> |
| 57 | + <th colspan="2" align="center"> |
| 58 | + <a href="source/templates/README.md">🖼️ <%= elements.length-1 %> templates</a> |
| 59 | + </th> |
| 60 | + </tr> |
| 61 | +<% for (let i = 0; i < elements.length; i+=2) { |
| 62 | + const cells = [["even", elements[i]], ["odd", elements[i+1]]] |
| 63 | + for (const [cell, [template, {name, readme}]] of cells) { |
| 64 | + if (cell === "even") { |
| 65 | +-%> |
| 66 | + <tr> |
| 67 | +<% } %> <th><a href="source/templates/<%= template %>/README.md"><%= name -%></a></th> |
| 68 | +<% if (cell === "odd") { |
| 69 | +-%> </tr> |
| 70 | +<% }} |
| 71 | + for (const [cell, [template, {name, readme}]] of cells) { |
| 72 | + if (cell === "even") { |
| 73 | +-%> |
| 74 | + <tr> |
| 75 | +<% } %> <%- readme.demo.replace(/<img src=/g, `<img alt="" width="400" src=`)?.split("\n")?.map((x, i) => i ? ` ${x}` : x)?.join("\n") %> |
| 76 | +<% if (cell === "odd") { |
| 77 | +-%> </tr> |
| 78 | +<% }}} -%> |
| 79 | +</table> |
| 80 | +<% } %> |
0 commit comments