Skip to content

Commit 618d982

Browse files
committed
doc(plugins/habits): update
1 parent a74d4e2 commit 618d982

File tree

2 files changed

+69
-49
lines changed

2 files changed

+69
-49
lines changed

source/plugins/habits/README.md

Lines changed: 48 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,29 @@
1-
### 💡 Coding habits
2-
3-
The coding *habits* plugin display metrics based on your recent activity, such as active hours or languages recently used.
4-
1+
<!--header-->
52
<table>
6-
<td align="center">
7-
<details open><summary>Recent activity charts</summary>
8-
<img src="https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.habits.charts.svg">
9-
</details>
10-
<details open><summary>Midly interesting facts</summary>
11-
<img src="https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.habits.facts.svg">
12-
</details>
13-
<img width="900" height="1" alt="">
14-
</td>
3+
<tr><th colspan="2"><h3>💡 Coding habits</h3></th></tr>
4+
<tr><td colspan="2" align="center"><p>This plugin display coding habits based on your recent activity, such as active hours and languages recently used.</p>
5+
</td></tr>
6+
<tr>
7+
<th rowspan="3">Supported features<br><sub><a href="metadata.yml">→ Full specification</a></sub></th>
8+
<td><a href="/source/templates/classic"><code>📗 Classic template</code></a></td>
9+
</tr>
10+
<tr>
11+
<td><code>👤 Users</code> <code>👥 Organizations</code></td>
12+
</tr>
13+
<tr>
14+
<td><code>🔑 (scopeless)</code> <code>read:org (optional)</code> <code>read:user (optional)</code> <code>repo (optional)</code></td>
15+
</tr>
16+
<tr>
17+
<td colspan="2" align="center">
18+
<details open><summary>Recent activity charts</summary><img src="https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.habits.charts.svg" alt=""></img></details>
19+
<details open><summary>Midly interesting facts</summary><img src="https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.habits.facts.svg" alt=""></img></details>
20+
<img width="900" height="1" alt="">
21+
</td>
22+
</tr>
1523
</table>
24+
<!--/header-->
1625

17-
Using more events will improve accuracy of these metrics, although it'll increase the number of GitHub requests used.
18-
19-
Active hours and days are computed through your commit history, while indent style is deduced from your recent diffs.
20-
Recent languages activity is also computed from your recent diffs, using [github/linguist](https://github.com/github/linguist).
21-
22-
Use a full `repo` scope token to access **private** events.
23-
24-
By default, dates use Greenwich meridian (GMT/UTC). Be sure to set your timezone (see [here](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for a list of supported timezones) for accurate metrics.
25-
26-
> 🔣 On web instances, *recent languages activity* is an extra feature and must be enabled globally in `settings.json`
27-
28-
#### ➡️ Available options
26+
## ➡️ Available options
2927

3028
<!--options-->
3129
<table>
@@ -34,7 +32,7 @@ By default, dates use Greenwich meridian (GMT/UTC). Be sure to set your timezone
3432
</tr>
3533
<tr>
3634
<td nowrap="nowrap"><code>plugin_habits</code></td>
37-
<td rowspan="2"><p>Display coding habits metrics</p>
35+
<td rowspan="2"><p>Enable habits plugin</p>
3836
<img width="900" height="1" alt=""></td>
3937
</tr>
4038
<tr>
@@ -44,7 +42,8 @@ By default, dates use Greenwich meridian (GMT/UTC). Be sure to set your timezone
4442
</tr>
4543
<tr>
4644
<td nowrap="nowrap"><code>plugin_habits_from</code></td>
47-
<td rowspan="2"><p>Number of events to use</p>
45+
<td rowspan="2"><p>Events to use</p>
46+
<p>A higher number will increase stats accuracy</p>
4847
<img width="900" height="1" alt=""></td>
4948
</tr>
5049
<tr>
@@ -57,7 +56,7 @@ By default, dates use Greenwich meridian (GMT/UTC). Be sure to set your timezone
5756
</tr>
5857
<tr>
5958
<td nowrap="nowrap"><code>plugin_habits_days</code></td>
60-
<td rowspan="2"><p>Maximum event age</p>
59+
<td rowspan="2"><p>Event maximum age</p>
6160
<img width="900" height="1" alt=""></td>
6261
</tr>
6362
<tr>
@@ -70,7 +69,8 @@ By default, dates use Greenwich meridian (GMT/UTC). Be sure to set your timezone
7069
</tr>
7170
<tr>
7271
<td nowrap="nowrap"><code>plugin_habits_facts</code></td>
73-
<td rowspan="2"><p>Display coding habits collected facts based on recent activity</p>
72+
<td rowspan="2"><p>Toggle midly interesting facts display</p>
73+
<p>It includes indentation type, average number of characters per line of code, and most active time and day</p>
7474
<img width="900" height="1" alt=""></td>
7575
</tr>
7676
<tr>
@@ -80,7 +80,9 @@ By default, dates use Greenwich meridian (GMT/UTC). Be sure to set your timezone
8080
</tr>
8181
<tr>
8282
<td nowrap="nowrap"><code>plugin_habits_charts</code></td>
83-
<td rowspan="2"><p>Display coding habits charts based on recent activity</p>
83+
<td rowspan="2"><p>Toggle charts display</p>
84+
<p>It includes commit activity per hour of day and commit activity per day of week
85+
Recent language activity may also displayed (it requires extras features to be enabled for web instances) for historical reasons</p>
8486
<img width="900" height="1" alt=""></td>
8587
</tr>
8688
<tr>
@@ -91,7 +93,7 @@ By default, dates use Greenwich meridian (GMT/UTC). Be sure to set your timezone
9193
</tr>
9294
<tr>
9395
<td nowrap="nowrap"><code>plugin_habits_trim</code></td>
94-
<td rowspan="2"><p>Trim unused hours on daily chart</p>
96+
<td rowspan="2"><p>Trim unused hours on charts</p>
9597
<img width="900" height="1" alt=""></td>
9698
</tr>
9799
<tr>
@@ -102,9 +104,20 @@ By default, dates use Greenwich meridian (GMT/UTC). Be sure to set your timezone
102104
</table>
103105
<!--/options-->
104106

105-
*[→ Full specification](metadata.yml)*
107+
## 🌐 Configure used timezone
108+
109+
By default, dates use Greenwich meridian (GMT/UTC).
106110

107-
#### ℹ️ Examples workflows
111+
Configure `config_timezone` (see [supported timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)) to avoid time offsets.
112+
113+
*Example: configuring timezone*
114+
```yaml
115+
- uses: lowlighter/metrics@latest
116+
with:
117+
config_timezone: Europe/Paris
118+
```
119+
120+
## ℹ️ Examples workflows
108121
109122
<!--examples-->
110123
```yaml
@@ -134,3 +147,5 @@ with:
134147

135148
```
136149
<!--/examples-->
150+
151+

source/plugins/habits/metadata.yml

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: "💡 Coding habits"
22
category: github
3+
description: This plugin display coding habits based on your recent activity, such as active hours and languages recently used.
4+
examples:
5+
+recent activity charts: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.habits.charts.svg
6+
+midly interesting facts: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.habits.facts.svg
37
index: 5
48
supports:
59
- user
@@ -8,46 +12,47 @@ scopes:
812
- public_access
913
inputs:
1014

11-
# Enable or disable plugin
1215
plugin_habits:
13-
description: Display coding habits metrics
16+
description: Enable habits plugin
1417
type: boolean
1518
default: no
1619

17-
# Number of events to use to computes habits
18-
# Using more will result in more accurate metrics, but you may hit GitHub rate-limit more easily
1920
plugin_habits_from:
20-
description: Number of events to use
21+
description: |
22+
Events to use
23+
24+
A higher number will increase stats accuracy
2125
type: number
2226
default: 200
2327
min: 1
2428
max: 1000
2529

26-
# Filter used events to compute habits by age
2730
plugin_habits_days:
28-
description: Maximum event age
31+
description: Event maximum age
2932
type: number
3033
default: 14
3134
min: 1
3235
max: 30
3336

34-
# Display tidbits about your most active hours/days, indents used (spaces/tabs), etc.
35-
# This is deduced from your recent activity
3637
plugin_habits_facts:
37-
description: Display coding habits collected facts based on recent activity
38+
description: |
39+
Toggle midly interesting facts display
40+
41+
It includes indentation type, average number of characters per line of code, and most active time and day
3842
type: boolean
3943
default: yes
4044

41-
# Display charts of most active time of the day and most active day of the week
42-
# Also display languages recently used (this is not the same as plugin_languages, as the latter is an all-time stats)
4345
plugin_habits_charts:
44-
description: Display coding habits charts based on recent activity
46+
extras: yes
47+
description: |
48+
Toggle charts display
49+
50+
It includes commit activity per hour of day and commit activity per day of week
51+
Recent language activity may also displayed (it requires extras features to be enabled for web instances) for historical reasons
4552
type: boolean
4653
default: no
47-
extras: yes
4854

49-
# Trim unused hours on daily chart
5055
plugin_habits_trim:
51-
description: Trim unused hours on daily chart
56+
description: Trim unused hours on charts
5257
type: boolean
5358
default: no

0 commit comments

Comments
 (0)