Update documentation
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} = await metadata({log:false})
|
const {plugins, templates, packaged} = 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}, {async:true, ...options})
|
const content = await ejs.renderFile(source, {plugins, templates, packaged}, {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)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ While metrics targets mainly user accounts, it's possible to render metrics for
|
|||||||

|

|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>💬 Metrics for organizations</summary>
|
<summary><b>💬 Metrics for organizations</b> <i>(click to expand)</i></summary>
|
||||||
|
|
||||||
Setup is the same as for user accounts, though you'll need to add `read:org` scope, **whether you're member of target organization or not**.
|
Setup is the same as for user accounts, though you'll need to add `read:org` scope, **whether you're member of target organization or not**.
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ To support private repositories, add full `repo` scope to your personal token.
|
|||||||
</details>
|
</details>
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>💬 Organizations memberships for user accounts</summary>
|
<summary><b>💬 Organizations memberships for user accounts</b> <i>(click to expand)</i></summary>
|
||||||
|
|
||||||
Only public memberships can be displayed by metrics by default.
|
Only public memberships can be displayed by metrics by default.
|
||||||
You can manage your membership visibility in the `People` tab of your organization:
|
You can manage your membership visibility in the `People` tab of your organization:
|
||||||
|
|||||||
7
.github/readme/partials/introduction.md
vendored
7
.github/readme/partials/introduction.md
vendored
@@ -1,5 +1,9 @@
|
|||||||
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!
|
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!
|
||||||
|
|
||||||
|
<% if (/[.]0-beta$/.test(packaged.version)) { %>
|
||||||
|
<sup>*⚠️ This is the documentation of **v<%= packaged.version.replace(/[.]0-beta$/, "") %>-beta** (`@master` branch) which includes [unreleased features](https://github.com/lowlighter/metrics/compare/latest...master), see documentation of **v<%= (Number(packaged.version.replace(/[.]0-beta$/, ""))-0.1).toFixed(1) %>** (`@latest` branch) [here](https://github.com/lowlighter/metrics/blob/latest/README.md).*</sup>
|
||||||
|
<% } %>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th align="center">For user accounts</th>
|
<th align="center">For user accounts</th>
|
||||||
@@ -13,6 +17,9 @@ Generate your metrics that you can embed everywhere, including your GitHub profi
|
|||||||
let cell = 0
|
let cell = 0
|
||||||
const elements = Object.entries(plugins).filter(([key, value]) => (value)&&(!["base", "core"].includes(key)))
|
const elements = Object.entries(plugins).filter(([key, value]) => (value)&&(!["base", "core"].includes(key)))
|
||||||
%>
|
%>
|
||||||
|
|
||||||
|
And you can customize these heavily with plugins, templates and hundreds of options!
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="2" align="center">
|
<th colspan="2" align="center">
|
||||||
|
|||||||
2
.github/readme/partials/setup/action.md
vendored
2
.github/readme/partials/setup/action.md
vendored
@@ -13,7 +13,7 @@ Assuming your username is `my-github-user`, you can then embed rendered metrics
|
|||||||
```
|
```
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>💬 How to setup?</summary>
|
<summary><b>💬 How to setup?</b> <i>(click to expand)</i></summary>
|
||||||
|
|
||||||
### 0. Setup your personal repository
|
### 0. Setup your personal repository
|
||||||
|
|
||||||
|
|||||||
2
.github/readme/partials/setup/shared.md
vendored
2
.github/readme/partials/setup/shared.md
vendored
@@ -9,7 +9,7 @@ For convenience, you can use the shared instance available at [metrics.lecoq.io]
|
|||||||
This is mostly intended for previews, to enjoy all features consider using GitHub Action instead.
|
This is mostly intended for previews, to enjoy all features consider using GitHub Action instead.
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>💬 Fair use</summary>
|
<summary><b>💬 Fair use</b> <i>(click to expand)</i></summary>
|
||||||
|
|
||||||
To ensure service availability, shared instance has a few limitations:
|
To ensure service availability, shared instance has a few limitations:
|
||||||
* Images are cached for 15 minutes
|
* Images are cached for 15 minutes
|
||||||
|
|||||||
2
.github/readme/partials/setup/web.md
vendored
2
.github/readme/partials/setup/web.md
vendored
@@ -11,7 +11,7 @@ Assuming your username is `my-github-user`, you can then embed rendered metrics
|
|||||||
```
|
```
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>💬 How to setup?</summary>
|
<summary><b>💬 How to setup?</b> <i>(click to expand)</i></summary>
|
||||||
|
|
||||||
### 0. Prepare your server
|
### 0. Prepare your server
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
const __metrics = path.join(path.dirname(url.fileURLToPath(import.meta.url)), "../../..")
|
const __metrics = path.join(path.dirname(url.fileURLToPath(import.meta.url)), "../../..")
|
||||||
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")
|
||||||
|
|
||||||
//Init
|
//Init
|
||||||
const logger = log ? console.debug : () => null
|
const logger = log ? console.debug : () => null
|
||||||
@@ -45,8 +46,11 @@
|
|||||||
const {classic, repository, community, ...templates} = Templates
|
const {classic, repository, community, ...templates} = Templates
|
||||||
Templates = {classic, repository, ...templates, community}
|
Templates = {classic, repository, ...templates, community}
|
||||||
|
|
||||||
|
//Packaged metadata
|
||||||
|
const packaged = JSON.parse(`${await fs.promises.readFile(__package)}`)
|
||||||
|
|
||||||
//Metadata
|
//Metadata
|
||||||
return {plugins:Plugins, templates:Templates}
|
return {plugins:Plugins, templates:Templates, packaged}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**Metadata extractor for templates */
|
/**Metadata extractor for templates */
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ The recent *posts* plugin displays recent articles you wrote on an external sour
|
|||||||
<table>
|
<table>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
<img src="https://github.com/lowlighter/lowlighter/blob/master/metrics.plugin.posts.svg">
|
<img src="https://github.com/lowlighter/lowlighter/blob/master/metrics.plugin.posts.svg">
|
||||||
|
<details><summary>With posts descriptions and cover images version</summary>
|
||||||
|
<img src="https://github.com/lowlighter/lowlighter/blob/master/metrics.plugin.posts.full.svg">
|
||||||
|
</details>
|
||||||
<img width="900" height="1" alt="">
|
<img width="900" height="1" alt="">
|
||||||
</td>
|
</td>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ The recent *tweets* plugin displays your latest tweets from your [Twitter](https
|
|||||||
<table>
|
<table>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
<img src="https://github.com/lowlighter/lowlighter/blob/master/metrics.plugin.tweets.svg">
|
<img src="https://github.com/lowlighter/lowlighter/blob/master/metrics.plugin.tweets.svg">
|
||||||
|
<details><summary>With tweets attachments version</summary>
|
||||||
|
<img src="https://github.com/lowlighter/lowlighter/blob/master/metrics.plugin.tweets.attachments.svg">
|
||||||
|
</details>
|
||||||
<img width="900" height="1" alt="">
|
<img width="900" height="1" alt="">
|
||||||
</td>
|
</td>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
Reference in New Issue
Block a user