Skip to content

Commit da57541

Browse files
committed
doc(plugins/base): update
1 parent 1007e25 commit da57541

File tree

2 files changed

+101
-62
lines changed

2 files changed

+101
-62
lines changed

source/plugins/base/README.md

Lines changed: 52 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
1-
### 🗃️ Base content
2-
3-
The *base* content is all metrics enabled by default.
4-
1+
<!--header-->
52
<table>
3+
<tr><th colspan="2"><h3>🗃️ Base content</h3></th></tr>
4+
<tr><td colspan="2" align="center"></td></tr>
5+
<tr>
6+
<th rowspan="3">Supported features<br><sub><a href="metadata.yml">→ Full specification</a></sub></th>
7+
<td><a href="/source/templates/classic"><code>📗 Classic template</code></a> <a href="/source/templates/repository"><code>📘 Repository template</code></a> <a href="/source/templates/terminal"><code>📙 Terminal template</code></a></td>
8+
</tr>
9+
<tr>
10+
<td><code>👤 Users</code> <code>👥 Organizations</code> <code>📓 Repositories</code></td>
11+
</tr>
612
<tr>
7-
<td align="center">
8-
<img src="https://github.com/lowlighter/metrics/blob/examples/metrics.classic.svg">
9-
<img width="900" height="1" alt="">
10-
</td>
11-
<td align="center">
12-
<img src="https://github.com/lowlighter/metrics/blob/examples/metrics.organization.svg">
13-
<img width="900" height="1" alt="">
14-
</td>
13+
<td><code>🔑 (scopeless)</code> <code>read:org (optional)</code> <code>read:user (optional)</code> <code>repo (optional)</code></td>
14+
</tr>
15+
<tr>
16+
<td colspan="2"><table><tr>
17+
<td align="center">
18+
<img src="https://github.com/lowlighter/metrics/blob/examples/metrics.classic.svg" alt=""></img>
19+
</td>
20+
<td align="center">
21+
<img src="https://github.com/lowlighter/metrics/blob/examples/metrics.organization.svg" alt=""></img>
22+
</td>
23+
</tr></table></td>
1524
</tr>
1625
</table>
26+
<!--/header-->
1727

18-
It contains the following sections:
19-
* `header`, which usually contains your username, your two-week commits calendars and a few additional data
20-
* `activity`, which contains your recent activity (commits, pull requests, issues, etc.)
21-
* `community`, which contains your community stats (following, sponsors, organizations, etc.)
22-
* `repositories`, which contains your repositories stats (license, forks, stars, etc.)
23-
* `metadata`, which contains informations about generated metrics
24-
25-
These are all enabled by default, but you can explicitely opt out from them.
26-
27-
#### ➡️ Available options
28+
## ➡️ Available options
2829

2930
<!--options-->
3031
<table>
@@ -33,7 +34,16 @@ These are all enabled by default, but you can explicitely opt out from them.
3334
</tr>
3435
<tr>
3536
<td nowrap="nowrap"><code>base</code></td>
36-
<td rowspan="2"><p>Metrics base content</p>
37+
<td rowspan="2"><p>Base content</p>
38+
<p>The following sections are supported:</p>
39+
<ul>
40+
<li><code>header</code>, which usually contains username, two-week commits calendars and a few additional data</li>
41+
<li><code>activity</code>, which contains recent activity (commits, pull requests, issues, etc.)</li>
42+
<li><code>community</code>, which contains community stats (following, sponsors, organizations, etc.)</li>
43+
<li><code>repositories</code>, which contains repositories stats (license, forks, stars, etc.)</li>
44+
<li><code>metadata</code>, which contains informations about generated metrics</li>
45+
</ul>
46+
<p>These are all enabled by default, but it is possible to explicitely opt out from them.</p>
3747
<img width="900" height="1" alt=""></td>
3848
</tr>
3949
<tr>
@@ -45,7 +55,8 @@ These are all enabled by default, but you can explicitely opt out from them.
4555
</tr>
4656
<tr>
4757
<td nowrap="nowrap"><code>repositories</code></td>
48-
<td rowspan="2"><p>Number of repositories to use</p>
58+
<td rowspan="2"><p>Repositories to fetch</p>
59+
<p>A higher value result in more accurate metrics but can hit GitHub API rate-limit more easily (especially with a lot of plugins enabled)</p>
4960
<img width="900" height="1" alt=""></td>
5061
</tr>
5162
<tr>
@@ -57,7 +68,9 @@ These are all enabled by default, but you can explicitely opt out from them.
5768
</tr>
5869
<tr>
5970
<td nowrap="nowrap"><code>repositories_batch</code></td>
60-
<td rowspan="2"><p>Number of repositories to load at once by queries</p>
71+
<td rowspan="2"><p>Repositories to fetch at a time</p>
72+
<p>If you receive <code>Something went wrong while executing your query</code> (which is usually caused by API timeout),
73+
try lowering this value.</p>
6174
<img width="900" height="1" alt=""></td>
6275
</tr>
6376
<tr>
@@ -70,7 +83,7 @@ These are all enabled by default, but you can explicitely opt out from them.
7083
</tr>
7184
<tr>
7285
<td nowrap="nowrap"><code>repositories_forks</code></td>
73-
<td rowspan="2"><p>Include forks in metrics</p>
86+
<td rowspan="2"><p>Include forks</p>
7487
<img width="900" height="1" alt=""></td>
7588
</tr>
7689
<tr>
@@ -81,6 +94,14 @@ These are all enabled by default, but you can explicitely opt out from them.
8194
<tr>
8295
<td nowrap="nowrap"><code>repositories_affiliations</code></td>
8396
<td rowspan="2"><p>Repositories affiliations</p>
97+
<ul>
98+
<li><code>owner</code>: owned repositories</li>
99+
<li><code>collaborator</code>: repositories with push access</li>
100+
<li><code>organization_member</code>: repositories from an organization where user is a member</li>
101+
</ul>
102+
<p>Some plugin outputs may be affected by this setting too.</p>
103+
<p>Set to <code>&quot;&quot;</code> to disable and fetch all repositories related to you.
104+
Broad affiliation will result in less representative metrics.</p>
84105
<img width="900" height="1" alt=""></td>
85106
</tr>
86107
<tr>
@@ -92,7 +113,7 @@ These are all enabled by default, but you can explicitely opt out from them.
92113
</tr>
93114
<tr>
94115
<td nowrap="nowrap"><code>repositories_skipped</code></td>
95-
<td rowspan="2"><p>Default repositories to skip</p>
116+
<td rowspan="2"><p>Default skipped repositories</p>
96117
<img width="900" height="1" alt=""></td>
97118
</tr>
98119
<tr>
@@ -103,7 +124,7 @@ These are all enabled by default, but you can explicitely opt out from them.
103124
</tr>
104125
<tr>
105126
<td nowrap="nowrap"><code>users_ignored</code></td>
106-
<td rowspan="2"><p>Default users to ignore</p>
127+
<td rowspan="2"><p>Default ignored users</p>
107128
<img width="900" height="1" alt=""></td>
108129
</tr>
109130
<tr>
@@ -116,7 +137,8 @@ These are all enabled by default, but you can explicitely opt out from them.
116137
</tr>
117138
<tr>
118139
<td nowrap="nowrap"><code>commits_authoring</code></td>
119-
<td rowspan="2"><p>List of surnames or email addresses you use when authoring commits</p>
140+
<td rowspan="2"><p>Name, username, email addresses that has been used for authoring commits</p>
141+
<p>This setting can be used to detect commits ownerships in some plugin</p>
120142
<img width="900" height="1" alt=""></td>
121143
</tr>
122144
<tr>
@@ -129,9 +151,7 @@ These are all enabled by default, but you can explicitely opt out from them.
129151
</table>
130152
<!--/options-->
131153

132-
*[→ Full specification](metadata.yml)*
133-
134-
#### ℹ️ Examples workflows
154+
## ℹ️ Examples workflows
135155

136156
<!--examples-->
137157
```yaml

source/plugins/base/metadata.yml

Lines changed: 49 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: "🗃️ Base content"
22
category: core
3+
description:
4+
examples:
5+
default1: https://github.com/lowlighter/metrics/blob/examples/metrics.classic.svg
6+
default2: https://github.com/lowlighter/metrics/blob/examples/metrics.organization.svg
37
supports:
48
- user
59
- organization
@@ -10,76 +14,91 @@ inputs:
1014

1115
# Base content
1216
base:
13-
description: Metrics base content
17+
description: |
18+
Base content
19+
20+
The following sections are supported:
21+
* `header`, which usually contains username, two-week commits calendars and a few additional data
22+
* `activity`, which contains recent activity (commits, pull requests, issues, etc.)
23+
* `community`, which contains community stats (following, sponsors, organizations, etc.)
24+
* `repositories`, which contains repositories stats (license, forks, stars, etc.)
25+
* `metadata`, which contains informations about generated metrics
26+
27+
These are all enabled by default, but it is possible to explicitely opt out from them.
1428
type: array
1529
format: comma-separated
1630
default: header, activity, community, repositories, metadata
1731
values:
18-
- header # name, commits calendar, ...
19-
- activity # commits, issues/pull requests opened, ...
20-
- community # following, stars, sponsors, ...
21-
- repositories # license, stars, forks, ...
22-
- metadata # svg generation metadata
32+
- header
33+
- activity
34+
- community
35+
- repositories
36+
- metadata
2337

24-
# Number of repositories to use to computes metrics
25-
# Using more will result in more accurate metrics, but you may hit GitHub rate-limit more easily if you use a lot of plugins
2638
repositories:
27-
description: Number of repositories to use
39+
description: |
40+
Repositories to fetch
41+
42+
A higher value result in more accurate metrics but can hit GitHub API rate-limit more easily (especially with a lot of plugins enabled)
2843
type: number
2944
default: 100
3045
min: 0
3146

32-
# Number of repositories to load at once by queries
33-
# If you encounter GitHub queries timeouts, using a lower value here may solve issues
3447
repositories_batch:
35-
description: Number of repositories to load at once by queries
48+
description: |
49+
Repositories to fetch at a time
50+
51+
If you receive `Something went wrong while executing your query` (which is usually caused by API timeout),
52+
try lowering this value.
3653
type: number
3754
default: 100
3855
max: 100
3956
min: 1
4057

41-
# Include forked repositories into metrics
4258
repositories_forks:
43-
description: Include forks in metrics
59+
description: Include forks
4460
type: boolean
4561
default: no
4662

47-
# Filter repositories by user affiliations (you can specify multiple affiliations constraints)
48-
# Set to "" to use all repositories related to you
49-
# Note that it may affect some plugin outputs (broad affiliations will result in less representative metrics)
5063
repositories_affiliations:
51-
description: Repositories affiliations
64+
description: |
65+
Repositories affiliations
66+
- `owner`: owned repositories
67+
- `collaborator`: repositories with push access
68+
- `organization_member`: repositories from an organization where user is a member
69+
70+
Some plugin outputs may be affected by this setting too.
71+
72+
Set to `""` to disable and fetch all repositories related to you.
73+
Broad affiliation will result in less representative metrics.
5274
type: array
5375
format: comma-separated
5476
default: owner
5577
values:
56-
- owner # Use repositories you own
57-
- collaborator # Use repositories you push access
58-
- organization_member # Use repositories where you're an organization member
78+
- owner
79+
- collaborator
80+
- organization_member
5981

60-
# List of default repositories that will be skipped
61-
# Plugins supporting a "skip repositories option" will automatically append repositories listed in this option
6282
repositories_skipped:
63-
description: Default repositories to skip
83+
description: Default skipped repositories
6484
type: array
6585
format: comma-separated
6686
default: ""
6787
example: my-repo-1, my-repo-2, owner/repo-3, ...
6888
global: yes
6989

70-
# List of default ignored users
71-
# Plugins supporting a "skip users option" will automatically append users listed in this option
7290
users_ignored:
73-
description: Default users to ignore
91+
description: Default ignored users
7492
type: array
7593
format: comma-separated
7694
default: github-actions[bot], dependabot[bot], dependabot-preview[bot]
7795
global: yes
7896

79-
# List of surnames or email addresses you use when authoring commits
80-
# These are mostly used to perform commits analysis to detect ownership
8197
commits_authoring:
82-
description: List of surnames or email addresses you use when authoring commits
98+
description: |
99+
Name, username, email addresses that has been used for authoring commits
100+
101+
This setting can be used to detect commits ownerships in some plugin
83102
type: array
84103
format: comma-seperated
85104
default: .user.login

0 commit comments

Comments
 (0)