docs: move templated files to a dedicated folder
This commit is contained in:
@@ -2,6 +2,6 @@
|
||||
|
||||
[](https://github.com/lowlighter/metrics/actions/workflows/ci.yml)
|
||||
|
||||
<% for (const partial of ["introduction", "documentation", "license"]) { -%>
|
||||
<% 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)*
|
||||
@@ -4,6 +4,6 @@
|
||||
> <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 ["setup", "templates", "plugins", "contributing"]) { %>
|
||||
<%- await include(`/partials/documentation/${partial}.md`) -%>
|
||||
<% for (const partial of ["documentation/setup", "templated/templates", "templated/plugins", "documentation/contributing"]) { %>
|
||||
<%- await include(`/partials/${partial}.md`) -%>
|
||||
<% } %>
|
||||
8
.github/scripts/build.mjs
vendored
8
.github/scripts/build.mjs
vendored
@@ -17,6 +17,7 @@ const __metrics = paths.join(paths.dirname(url.fileURLToPath(import.meta.url)),
|
||||
const __action = paths.join(__metrics, "source/app/action")
|
||||
const __web = paths.join(__metrics, "source/app/web")
|
||||
const __readme = paths.join(__metrics, ".github/readme")
|
||||
const __documentation = paths.join(__metrics, ".github/readme/partials/templated")
|
||||
const __templates = paths.join(paths.join(__metrics, "source/templates/"))
|
||||
const __plugins = paths.join(paths.join(__metrics, "source/plugins/"))
|
||||
const __test_cases = paths.join(paths.join(__metrics, "tests/cases"))
|
||||
@@ -37,9 +38,10 @@ for (const step of ["config", "documentation"]) {
|
||||
await update({ source: paths.join(__web, "settings.example.json"), output: "settings.example.json" })
|
||||
break
|
||||
case "documentation":
|
||||
await update({ source: paths.join(__readme, "README.md"), output: "README.md", options: { root: __readme } })
|
||||
await update({ source: paths.join(__readme, "partials/documentation/plugins.md"), output: "source/plugins/README.md" })
|
||||
await update({ source: paths.join(__readme, "partials/documentation/templates.md"), output: "source/templates/README.md" })
|
||||
await update({ source: paths.join(__documentation, "README.md"), output: "README.md", options: { root: __readme } })
|
||||
await update({ source: paths.join(__documentation, "plugins.md"), output: "source/plugins/README.md" })
|
||||
await update({ source: paths.join(__documentation, "templates.md"), output: "source/templates/README.md" })
|
||||
await update({ source: paths.join(__documentation, "compatibility.md"), output: ".github/readme/partials/documentation/compatibility.md" })
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user