Files
metrics/source/plugins/wakatime/README.md
2023-08-25 04:21:38 +00:00

183 lines
6.1 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!--header-->
<table>
<tr><td colspan="2"><a href="/README.md#-plugins">← Back to plugins index</a></td></tr>
<tr><th colspan="2"><h3>⏰ WakaTime</h3></th></tr>
<tr><td colspan="2" align="center"><p>This plugin displays statistics from a <a href="https://wakatime.com">WakaTime</a> account.</p>
<p>It is also compatible with self-hosted instances from <a href="https://github.com/muety/wakapi">wakapi</a>.</p>
</td></tr>
<tr><th>⚠️ Disclaimer</th><td><p>This plugin is not affiliated, associated, authorized, endorsed by, or in any way officially connected with <a href="https://wakatime.com">WakaTime</a>.
All product and company names are trademarks™ or registered® trademarks of their respective holders.</p>
</td></tr>
<tr>
<th rowspan="3">Supported features<br><sub><a href="metadata.yml">→ Full specification</a></sub></th>
<td><a href="/source/templates/classic/README.md"><code>📗 Classic template</code></a></td>
</tr>
<tr>
<td><code>👤 Users</code></td>
</tr>
<tr>
<td><code>🗝️ plugin_wakatime_token</code></td>
</tr>
<tr>
<td colspan="2" align="center">
<img src="https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.wakatime.svg" alt=""></img>
<img width="900" height="1" alt="">
</td>
</tr>
</table>
<!--/header-->
## ➡️ Available options
<!--options-->
<table>
<tr>
<td align="center" nowrap="nowrap">Option</i></td><td align="center" nowrap="nowrap">Description</td>
</tr>
<tr>
<td nowrap="nowrap"><h4><code>plugin_wakatime</code></h4></td>
<td rowspan="2"><p>Enable wakatime plugin</p>
<img width="900" height="1" alt=""></td>
</tr>
<tr>
<td nowrap="nowrap"><b>type:</b> <code>boolean</code>
<br>
<b>default:</b> no<br></td>
</tr>
<tr>
<td nowrap="nowrap"><h4><code>plugin_wakatime_token</code></h4></td>
<td rowspan="2"><p>WakaTime API token</p>
<img width="900" height="1" alt=""></td>
</tr>
<tr>
<td nowrap="nowrap">🔐 Token<br>
<b>type:</b> <code>token</code>
<br></td>
</tr>
<tr>
<td nowrap="nowrap"><h4><code>plugin_wakatime_url</code></h4></td>
<td rowspan="2"><p>WakaTime URL</p>
<p>Can be used to specify a <a href="https://github.com/muety/wakapi">wakapi</a> instance</p>
<img width="900" height="1" alt=""></td>
</tr>
<tr>
<td nowrap="nowrap"><b>type:</b> <code>string</code>
<br>
<b>default:</b> https://wakatime.com<br></td>
</tr>
<tr>
<td nowrap="nowrap"><h4><code>plugin_wakatime_user</code></h4></td>
<td rowspan="2"><p>WakaTime username</p>
<img width="900" height="1" alt=""></td>
</tr>
<tr>
<td nowrap="nowrap">⏯️ Cannot be preset<br>
<b>type:</b> <code>string</code>
<br>
<b>default:</b> current<br></td>
</tr>
<tr>
<td nowrap="nowrap"><h4><code>plugin_wakatime_sections</code></h4></td>
<td rowspan="2"><p>Displayed sections</p>
<ul>
<li><code>time</code>: show total coding time and daily average</li>
<li><code>projects</code>: show most time spent project</li>
<li><code>projects-graphs</code>: show most time spent projects graphs</li>
<li><code>languages</code>: show most used language</li>
<li><code>languages-graphs</code>: show languages graphs</li>
<li><code>editors</code>: show most used code editor</li>
<li><code>editors-graphs</code>: show code editors graphs</li>
<li><code>os</code>: show most used operating system</li>
<li><code>os-graphs</code>: show operating systems graphs</li>
</ul>
<img width="900" height="1" alt=""></td>
</tr>
<tr>
<td nowrap="nowrap"><b>type:</b> <code>array</code>
<br>
<b>default:</b> time, projects, projects-graphs, languages, languages-graphs, editors, os<br>
<b>allowed values:</b><ul><li>time</li><li>projects</li><li>projects-graphs</li><li>languages</li><li>languages-graphs</li><li>editors</li><li>editors-graphs</li><li>os</li><li>os-graphs</li></ul></td>
</tr>
<tr>
<td nowrap="nowrap"><h4><code>plugin_wakatime_days</code></h4></td>
<td rowspan="2"><p>Time range</p>
<img width="900" height="1" alt=""></td>
</tr>
<tr>
<td nowrap="nowrap"><b>type:</b> <code>string</code>
<br>
<b>default:</b> 7<br>
<b>allowed values:</b><ul><li>7</li><li>30</li><li>180</li><li>365</li></ul></td>
</tr>
<tr>
<td nowrap="nowrap"><h4><code>plugin_wakatime_limit</code></h4></td>
<td rowspan="2"><p>Display limit (entries per graph)</p>
<img width="900" height="1" alt=""></td>
</tr>
<tr>
<td nowrap="nowrap"><b>type:</b> <code>number</code>
<i>(0 ≤
𝑥)</i>
<br>
<b>zero behaviour:</b> disable</br>
<b>default:</b> 5<br></td>
</tr>
<tr>
<td nowrap="nowrap"><h4><code>plugin_wakatime_languages_other</code></h4></td>
<td rowspan="2"><p>Other languages</p>
<img width="900" height="1" alt=""></td>
</tr>
<tr>
<td nowrap="nowrap"><b>type:</b> <code>boolean</code>
<br>
<b>default:</b> no<br></td>
</tr>
<tr>
<td nowrap="nowrap"><h4><code>plugin_wakatime_languages_ignored</code></h4></td>
<td rowspan="2"><p>Ignored languages</p>
<img width="900" height="1" alt=""></td>
</tr>
<tr>
<td nowrap="nowrap"><b>type:</b> <code>array</code>
<i>(comma-separated)</i>
<br></td>
</tr>
<tr>
<td nowrap="nowrap"><h4><code>plugin_wakatime_repositories_visibility</code></h4></td>
<td rowspan="2"><p>Repositories visibility</p>
<p>Can be used to toggle private activity visibility</p>
<img width="900" height="1" alt=""></td>
</tr>
<tr>
<td nowrap="nowrap"><b>type:</b> <code>string</code>
<br>
<b>default:</b> all<br>
<b>allowed values:</b><ul><li>public</li><li>all</li></ul></td>
</tr>
</table>
<!--/options-->
## 🗝️ Obtaining a WakaTime token
Create a [WakaTime account](https://wakatime.com) and retrieve API key in [Account settings](https://wakatime.com/settings/account).
![WakaTime API token](/.github/readme/imgs/plugin_wakatime_token.png)
Then setup [WakaTime plugins](https://wakatime.com/plugins) to be ready to go!
## Examples workflows
<!--examples-->
```yaml
name: WakaTime
uses: lowlighter/metrics@latest
with:
filename: metrics.plugin.wakatime.svg
token: NOT_NEEDED
base: ""
plugin_wakatime: yes
plugin_wakatime_sections: time, projects, projects-graphs, languages, languages-graphs, editors, os
plugin_wakatime_token: ${{ secrets.WAKATIME_TOKEN }}
```
<!--/examples-->