docs: move templated files to a dedicated folder
This commit is contained in:
7
.github/readme/partials/templated/README.md
vendored
Normal file
7
.github/readme/partials/templated/README.md
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
# 📊 Metrics [<img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=280144&theme=dark" alt="" align="right" width="190" height="41">](https://www.producthunt.com/posts/github-metrics?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-github-metrics)
|
||||
|
||||
[](https://github.com/lowlighter/metrics/actions/workflows/ci.yml)
|
||||
|
||||
<% for (const partial of ["templated/introduction", "templated/documentation", "license"]) { -%>
|
||||
<%- await include(`/partials/${partial}.md`) %>
|
||||
<% } %>
|
||||
31
.github/readme/partials/templated/compatibility.md
vendored
Normal file
31
.github/readme/partials/templated/compatibility.md
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
# 🧰 Template/Plugin compatibility matrix
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th nowrap="nowrap">Template/Plugin</th><%# -%>
|
||||
<% for (const [plugin, {name, icon}] of Object.entries(plugins).filter(([key, value]) => (value)&&(!["core"].includes(key))&&(value.category !== "community"))) { %>
|
||||
<th nowrap="nowrap" align="center" title="<%= name %>"><%= icon %></th><% } %>
|
||||
</tr><%# -%>
|
||||
<% for (const [template, {name, readme}] of Object.entries(templates).filter(([key, value]) => (value)&&(!["community"].includes(key)))) { %>
|
||||
<tr>
|
||||
<td nowrap="nowrap"><%- name %></td><%# -%>
|
||||
<% for (const [plugin] of Object.entries(plugins).filter(([key, value]) => (value)&&(!["core"].includes(key))&&(value.category !== "community"))) { %>
|
||||
<td nowrap="nowrap" align="center" data-plugin="<%= plugin %>"><%= {true:"✔️", false:"❌", embed:"✓"}[readme.compatibility[plugin]] %></td><% } %>
|
||||
</tr><% } %>
|
||||
<tr>
|
||||
<td colspan="<%= Object.keys(plugins).length %>"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th nowrap="nowrap">Mode/Plugin</th><%# -%>
|
||||
<% for (const [plugin, {name, icon}] of Object.entries(plugins).filter(([key, value]) => (value)&&(!["core"].includes(key))&&(value.category !== "community"))) { %>
|
||||
<th nowrap="nowrap" align="center" title="<%= name %>"><%= icon %></th><% } %>
|
||||
</tr><%# -%>
|
||||
<% for (const {mode, icon} of [{mode:"user", icon:"👤"}, {mode:"organization", icon:"👥"}, {mode:"repository", icon:"📓"}]) { %>
|
||||
<tr>
|
||||
<td nowrap="nowrap"><%= icon %> <%- `${mode.charAt(0).toLocaleUpperCase()}${mode.substring(1)}` %></td><%# -%>
|
||||
<% for (const [plugin, {supports}] of Object.entries(plugins).filter(([key, value]) => (value)&&(!["core"].includes(key))&&(value.category !== "community"))) {%>
|
||||
<td nowrap="nowrap" align="center" data-plugin="<%= plugin %>"><%= supports.includes(mode) ? "✔️" : "❌" %></td><% } %>
|
||||
</tr><% } %>
|
||||
</table>
|
||||
|
||||
*Note: **markdown template** can actually render any kind of SVG metrics using [`embed` function](https://github.com/lowlighter/metrics/blob/master/source/templates/markdown/example.md#embedding-svg-metrics)*
|
||||
9
.github/readme/partials/templated/documentation.md
vendored
Normal file
9
.github/readme/partials/templated/documentation.md
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
# 📚 Documentation
|
||||
|
||||
<% if (/[.]0-beta$/.test(packaged.version)) { %>
|
||||
> <sup>*⚠️ This is the documentation of **v<%= packaged.version.replace(/[.]0-beta$/, "") %>-beta** (`@master`/`@main` branches) which includes [unreleased features](https://github.com/lowlighter/metrics/compare/latest...master). See documentation for [**v<%= (Number(packaged.version.replace(/[.]0-beta$/, ""))-0.01).toFixed(2).replace(/[.]0/, ".") %>** (`@latest` branch) here](https://github.com/lowlighter/metrics/blob/latest/README.md).*</sup>
|
||||
<% } %>
|
||||
|
||||
<% for (const partial of ["documentation/setup", "templated/templates", "templated/plugins", "documentation/contributing"]) { %>
|
||||
<%- await include(`/partials/${partial}.md`) -%>
|
||||
<% } %>
|
||||
104
.github/readme/partials/templated/introduction.md
vendored
Normal file
104
.github/readme/partials/templated/introduction.md
vendored
Normal file
@@ -0,0 +1,104 @@
|
||||
Generate metrics that can be embedded everywhere, including your GitHub profile readme! Supports users, organizations, and even repositories!
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th align="center">For user accounts</th>
|
||||
<th align="center">For organization accounts</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<%- plugins.base.readme.demo?.replace(/<img src=/g, `<img alt="" width="400" src=`) %>
|
||||
</tr>
|
||||
<% {
|
||||
let cell = 0
|
||||
const elements = Object.entries(plugins).filter(([key, value]) => (value)&&(!["base", "core"].includes(key)&&(value.category !== "community")))
|
||||
-%>
|
||||
<tr>
|
||||
<th colspan="2" align="center">
|
||||
<h3><a href="/README.md#-plugins">🧩 Customizable with <%= Object.entries(plugins).filter(([key, value]) => (value)&&(!["base", "core"].includes(key))).length %> plugins and <%= Object.entries(descriptor.inputs).length %> options!</a></h3>
|
||||
</th>
|
||||
</tr>
|
||||
<% if (elements.length%2)
|
||||
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) {
|
||||
if (cell === "even") {
|
||||
-%>
|
||||
<tr>
|
||||
<% } %> <th><% if (plugin) { %><a href="source/plugins/<%= plugin %>/README.md"><%= name -%></a><% } %></th>
|
||||
<% if (cell === "odd") {
|
||||
-%> </tr>
|
||||
<% }}
|
||||
for (const [cell, [plugin, {name, readme}]] of cells) {
|
||||
if (cell === "even") {
|
||||
-%>
|
||||
<tr>
|
||||
<% } %> <%- 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>
|
||||
<% }}} -%>
|
||||
<tr>
|
||||
<th colspan="2" align="center">
|
||||
<a href="/README.md#-pluginss">🎲 See also community plugins</a>
|
||||
</th>
|
||||
</tr>
|
||||
<% } %>
|
||||
<% {
|
||||
let cell = 0
|
||||
const elements = Object.entries(templates).filter(([key, value]) => (value)&&(!["community"].includes(key)))
|
||||
-%>
|
||||
<tr>
|
||||
<th colspan="2" align="center">
|
||||
<h3><a href="/README.md#%EF%B8%8F-templates">🖼️ And even more with <%= elements.length %>+ templates!</a></h3>
|
||||
</th>
|
||||
</tr>
|
||||
<% if (elements.length%2)
|
||||
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, [template, {name, readme}]] of cells) {
|
||||
if (cell === "even") {
|
||||
-%>
|
||||
<tr>
|
||||
<% } %> <th><a href="/source/templates/<%= template %>/README.md"><%- name -%></a></th>
|
||||
<% if (cell === "odd") {
|
||||
-%> </tr>
|
||||
<% }}
|
||||
for (const [cell, [template, {name, readme}]] of cells) {
|
||||
if (cell === "even") {
|
||||
-%>
|
||||
<tr>
|
||||
<% } %> <%- 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>
|
||||
<% }}} -%>
|
||||
<tr>
|
||||
<th colspan="2"><a href="/source/templates/community/README.md">📕 See also community templates</a></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2"><h2>🦑 Try it now!</h2></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><a href="https://metrics.lecoq.io">📊 Metrics embed</a></th>
|
||||
<th><a href="https://metrics.lecoq.io/about">✨ Metrics insights</a></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
Embed metrics images on your profile or blog!<br>
|
||||
Use <a href="https://github.com/marketplace/actions/metrics-embed">GitHub actions</a> for even more features!<br>
|
||||
<img src="/.github/readme/imgs/features_embed.gif" width="441">
|
||||
</td>
|
||||
<td align="center">
|
||||
Share your metrics with friends and on social medias!<br>
|
||||
No configuration needed!<br>
|
||||
<img src="/.github/readme/imgs/features_insights.gif" width="441">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" colspan="2">
|
||||
<b>Power user?</b><br>
|
||||
<a href="https://github.com/lowlighter/metrics/fork">Fork this repository</a> and edit HTML, CSS, JS and <a href="https://github.com/mde/ejs">EJS</a> for even more customization!
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<% } %>
|
||||
16
.github/readme/partials/templated/plugins.md
vendored
Normal file
16
.github/readme/partials/templated/plugins.md
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
## 🧩 Plugins
|
||||
|
||||
Plugins provide additional content and lets you customize rendered metrics.
|
||||
|
||||
**📦 Maintained by core team**
|
||||
<% { let previous = null; for (const [plugin, {name, category, authors = []}] of Object.entries(plugins).filter(([key, value]) => (value)&&(value.category !== "community")).sort(([an, a], [bn, b]) => a.category === b.category ? an.localeCompare(bn) : 0)) { %>
|
||||
<% if (previous !== category) { previous = category -%>
|
||||
* **<%= `${category.charAt(0).toLocaleUpperCase()}${category.substring(1)} plugins` %>**
|
||||
<% } -%>
|
||||
* [<%- name %> <sub>`<%= plugin %>`</sub>](/source/plugins/<%= plugin %>/README.md)<%# -%>
|
||||
<% }} %>
|
||||
|
||||
**🎲 Maintained by community**
|
||||
<% { let previous = null; for (const [plugin, {name, category, authors = []}] of Object.entries(plugins).filter(([key, value]) => (value)&&(value.category === "community")).sort(([an, a], [bn, b]) => a.category === b.category ? an.localeCompare(bn) : 0)) { %><%# -%>
|
||||
* [<%- name %> <sub>`<%= plugin %>`</sub>](/source/plugins/<%= plugin %>/README.md) by <%- authors.map(author => `[@${author}](https://github.com/${author})`).join(" ") %>
|
||||
<% }} %>
|
||||
7
.github/readme/partials/templated/templates.md
vendored
Normal file
7
.github/readme/partials/templated/templates.md
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
## 🖼️ Templates
|
||||
|
||||
Templates lets you change general appearance of rendered metrics.
|
||||
|
||||
<% for (const [template, {name}] of Object.entries(templates).filter(([key, value]) => value)) { %>
|
||||
* [<%- name %> <sub>`<%= template %>`</sub>](/source/templates/<%= template %>/README.md)<%# -%>
|
||||
<% } %>
|
||||
Reference in New Issue
Block a user