Skip to content

Commit 5a82148

Browse files
committed
Update documentation
1 parent df6638f commit 5a82148

File tree

9 files changed

+25
-8
lines changed

9 files changed

+25
-8
lines changed

.github/index.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
const staged = new Set()
2222

2323
//Load plugins metadata
24-
const {plugins, templates} = await metadata({log:false})
24+
const {plugins, templates, packaged} = await metadata({log:false})
2525

2626
//Update generated files
2727
async function update({source, output, options = {}}) {
2828
//Regenerate file
2929
console.log(`Generating ${output}`)
30-
const content = await ejs.renderFile(source, {plugins, templates}, {async:true, ...options})
30+
const content = await ejs.renderFile(source, {plugins, templates, packaged}, {async:true, ...options})
3131
//Save result
3232
const file = paths.join(__metrics, output)
3333
await fs.writeFile(file, content)

.github/readme/partials/documentation/organizations.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ While metrics targets mainly user accounts, it's possible to render metrics for
55
![Metrics (organization account)](https://github.com/lowlighter/lowlighter/blob/master/metrics.organization.svg)
66

77
<details>
8-
<summary>💬 Metrics for organizations</summary>
8+
<summary><b>💬 Metrics for organizations</b> <i>(click to expand)</i></summary>
99

1010
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**.
1111

@@ -33,7 +33,7 @@ To support private repositories, add full `repo` scope to your personal token.
3333
</details>
3434
3535
<details>
36-
<summary>💬 Organizations memberships for user accounts</summary>
36+
<summary><b>💬 Organizations memberships for user accounts</b> <i>(click to expand)</i></summary>
3737
3838
Only public memberships can be displayed by metrics by default.
3939
You can manage your membership visibility in the `People` tab of your organization:

.github/readme/partials/introduction.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
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!
22

3+
<% if (/[.]0-beta$/.test(packaged.version)) { %>
4+
<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>
5+
<% } %>
6+
37
<table>
48
<tr>
59
<th align="center">For user accounts</th>
@@ -13,6 +17,9 @@ Generate your metrics that you can embed everywhere, including your GitHub profi
1317
let cell = 0
1418
const elements = Object.entries(plugins).filter(([key, value]) => (value)&&(!["base", "core"].includes(key)))
1519
%>
20+
21+
And you can customize these heavily with plugins, templates and hundreds of options!
22+
1623
<table>
1724
<tr>
1825
<th colspan="2" align="center">

.github/readme/partials/setup/action.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Assuming your username is `my-github-user`, you can then embed rendered metrics
1313
```
1414

1515
<details>
16-
<summary>💬 How to setup?</summary>
16+
<summary><b>💬 How to setup?</b> <i>(click to expand)</i></summary>
1717

1818
### 0. Setup your personal repository
1919

.github/readme/partials/setup/shared.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ For convenience, you can use the shared instance available at [metrics.lecoq.io]
99
This is mostly intended for previews, to enjoy all features consider using GitHub Action instead.
1010

1111
<details>
12-
<summary>💬 Fair use</summary>
12+
<summary><b>💬 Fair use</b> <i>(click to expand)</i></summary>
1313

1414
To ensure service availability, shared instance has a few limitations:
1515
* Images are cached for 15 minutes

.github/readme/partials/setup/web.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Assuming your username is `my-github-user`, you can then embed rendered metrics
1111
```
1212

1313
<details>
14-
<summary>💬 How to setup?</summary>
14+
<summary><b>💬 How to setup?</b> <i>(click to expand)</i></summary>
1515

1616
### 0. Prepare your server
1717

source/app/metrics/metadata.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
const __metrics = path.join(path.dirname(url.fileURLToPath(import.meta.url)), "../../..")
1414
const __templates = path.join(__metrics, "source/templates")
1515
const __plugins = path.join(__metrics, "source/plugins")
16+
const __package = path.join(__metrics, "package.json")
1617

1718
//Init
1819
const logger = log ? console.debug : () => null
@@ -45,8 +46,11 @@
4546
const {classic, repository, community, ...templates} = Templates
4647
Templates = {classic, repository, ...templates, community}
4748

49+
//Packaged metadata
50+
const packaged = JSON.parse(`${await fs.promises.readFile(__package)}`)
51+
4852
//Metadata
49-
return {plugins:Plugins, templates:Templates}
53+
return {plugins:Plugins, templates:Templates, packaged}
5054
}
5155

5256
/**Metadata extractor for templates */

source/plugins/posts/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ The recent *posts* plugin displays recent articles you wrote on an external sour
55
<table>
66
<td align="center">
77
<img src="https://github.com/lowlighter/lowlighter/blob/master/metrics.plugin.posts.svg">
8+
<details><summary>With posts descriptions and cover images version</summary>
9+
<img src="https://github.com/lowlighter/lowlighter/blob/master/metrics.plugin.posts.full.svg">
10+
</details>
811
<img width="900" height="1" alt="">
912
</td>
1013
</table>

source/plugins/tweets/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ The recent *tweets* plugin displays your latest tweets from your [Twitter](https
55
<table>
66
<td align="center">
77
<img src="https://github.com/lowlighter/lowlighter/blob/master/metrics.plugin.tweets.svg">
8+
<details><summary>With tweets attachments version</summary>
9+
<img src="https://github.com/lowlighter/lowlighter/blob/master/metrics.plugin.tweets.attachments.svg">
10+
</details>
811
<img width="900" height="1" alt="">
912
</td>
1013
</table>

0 commit comments

Comments
 (0)