diff --git a/.github/index.mjs b/.github/index.mjs index 55383ff4..1d23adfc 100644 --- a/.github/index.mjs +++ b/.github/index.mjs @@ -21,13 +21,13 @@ const staged = new Set() //Load plugins metadata - const {plugins, templates, packaged} = await metadata({log:false}) + const {plugins, templates, packaged, descriptor} = await metadata({log:false}) //Update generated files async function update({source, output, options = {}}) { //Regenerate file console.log(`Generating ${output}`) - const content = await ejs.renderFile(source, {plugins, templates, packaged}, {async:true, ...options}) + const content = await ejs.renderFile(source, {plugins, templates, packaged, descriptor}, {async:true, ...options}) //Save result const file = paths.join(__metrics, output) await fs.writeFile(file, content) diff --git a/.github/readme/README.md b/.github/readme/README.md index 9e6c4215..2df71f29 100644 --- a/.github/readme/README.md +++ b/.github/readme/README.md @@ -2,6 +2,6 @@ ![Build](https://github.com/lowlighter/metrics/workflows/Build/badge.svg) [![Metrics (examples)](https://github.com/lowlighter/lowlighter/actions/workflows/metrics.yml/badge.svg)](https://github.com/lowlighter/lowlighter/actions/workflows/metrics.yml) -<% for (const partial of ["introduction", "shared", "setup", "documentation", "license", "references"]) { -%> +<% for (const partial of ["introduction", "features", "shared", "setup", "documentation", "license", "references"]) { -%> <%- await include(`/partials/${partial}.md`) %> <% } %> diff --git a/.github/readme/partials/features.md b/.github/readme/partials/features.md new file mode 100644 index 00000000..b158b139 --- /dev/null +++ b/.github/readme/partials/features.md @@ -0,0 +1,9 @@ +## 🐙 Features + +* Create infographics from **<%= Object.entries(plugins).filter(([key, value]) => (value)&&(!["base", "core"].includes(key))).length %> plugins**, **<%= Object.entries(templates).filter(([key, value]) => (value)&&(!["community"].includes(key))).length %> templates** and **<%= Object.entries(descriptor.inputs).length %> options**! + * Even more **customization** with [community templates](source/templates/community) or by [forking this repository](https://github.com/lowlighter/metrics/network/members) and editing HTML/CSS/EJS +* Support **users** and **organizations** accounts, and even **repositories**! +* Save your metrics as **images** (SVG, PNG or JPG), **markdown**, **PDF** or **JSON**! + * Upload them through commits, pull request and gists, or handle output manually +* Test it live on [metrics.lecoq.io](https://metrics.lecoq.io)! + * Get a quick overview of any user with [✨ metrics insights](https://metrics.lecoq.io/about) diff --git a/source/app/metrics/metadata.mjs b/source/app/metrics/metadata.mjs index 2931ea4b..20e75b74 100644 --- a/source/app/metrics/metadata.mjs +++ b/source/app/metrics/metadata.mjs @@ -14,6 +14,7 @@ export default async function metadata({log = true} = {}) { const __templates = path.join(__metrics, "source/templates") const __plugins = path.join(__metrics, "source/plugins") const __package = path.join(__metrics, "package.json") + const __descriptor = path.join(__metrics, "action.yml") //Init const logger = log ? console.debug : () => null @@ -49,8 +50,11 @@ export default async function metadata({log = true} = {}) { //Packaged metadata const packaged = JSON.parse(`${await fs.promises.readFile(__package)}`) + //Descriptor metadata + const descriptor = yaml.load(`${await fs.promises.readFile(__descriptor, "utf-8")}`) + //Metadata - return {plugins:Plugins, templates:Templates, packaged} + return {plugins:Plugins, templates:Templates, packaged, descriptor} } /**Metadata extractor for templates */