Add features section
This commit is contained in:
4
.github/index.mjs
vendored
4
.github/index.mjs
vendored
@@ -21,13 +21,13 @@
|
|||||||
const staged = new Set()
|
const staged = new Set()
|
||||||
|
|
||||||
//Load plugins metadata
|
//Load plugins metadata
|
||||||
const {plugins, templates, packaged} = await metadata({log:false})
|
const {plugins, templates, packaged, descriptor} = await metadata({log:false})
|
||||||
|
|
||||||
//Update generated files
|
//Update generated files
|
||||||
async function update({source, output, options = {}}) {
|
async function update({source, output, options = {}}) {
|
||||||
//Regenerate file
|
//Regenerate file
|
||||||
console.log(`Generating ${output}`)
|
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
|
//Save result
|
||||||
const file = paths.join(__metrics, output)
|
const file = paths.join(__metrics, output)
|
||||||
await fs.writeFile(file, content)
|
await fs.writeFile(file, content)
|
||||||
|
|||||||
2
.github/readme/README.md
vendored
2
.github/readme/README.md
vendored
@@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
 [](https://github.com/lowlighter/lowlighter/actions/workflows/metrics.yml)
|
 [](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`) %>
|
<%- await include(`/partials/${partial}.md`) %>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|||||||
9
.github/readme/partials/features.md
vendored
Normal file
9
.github/readme/partials/features.md
vendored
Normal file
@@ -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)
|
||||||
@@ -14,6 +14,7 @@ export default async function metadata({log = true} = {}) {
|
|||||||
const __templates = path.join(__metrics, "source/templates")
|
const __templates = path.join(__metrics, "source/templates")
|
||||||
const __plugins = path.join(__metrics, "source/plugins")
|
const __plugins = path.join(__metrics, "source/plugins")
|
||||||
const __package = path.join(__metrics, "package.json")
|
const __package = path.join(__metrics, "package.json")
|
||||||
|
const __descriptor = path.join(__metrics, "action.yml")
|
||||||
|
|
||||||
//Init
|
//Init
|
||||||
const logger = log ? console.debug : () => null
|
const logger = log ? console.debug : () => null
|
||||||
@@ -49,8 +50,11 @@ export default async function metadata({log = true} = {}) {
|
|||||||
//Packaged metadata
|
//Packaged metadata
|
||||||
const packaged = JSON.parse(`${await fs.promises.readFile(__package)}`)
|
const packaged = JSON.parse(`${await fs.promises.readFile(__package)}`)
|
||||||
|
|
||||||
|
//Descriptor metadata
|
||||||
|
const descriptor = yaml.load(`${await fs.promises.readFile(__descriptor, "utf-8")}`)
|
||||||
|
|
||||||
//Metadata
|
//Metadata
|
||||||
return {plugins:Plugins, templates:Templates, packaged}
|
return {plugins:Plugins, templates:Templates, packaged, descriptor}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**Metadata extractor for templates */
|
/**Metadata extractor for templates */
|
||||||
|
|||||||
Reference in New Issue
Block a user