doc(plugins/code): update

This commit is contained in:
lowlighter
2022-01-15 21:19:37 -05:00
parent c3285f4283
commit 4a8f377685
2 changed files with 56 additions and 36 deletions

View File

@@ -1,17 +1,33 @@
### ♐ Code snippet of the day <!--header-->
> ⚠️ When improperly configured, this plugin could display private code. If you work with sensitive data or company code, it is advised to keep this plugin disabled. *Metrics* and its authors cannot be held responsible for any resulting code leaks, use at your own risk.
Display a random code snippet from your recent activity history.
<table> <table>
<td align="center"> <tr><th colspan="2"><h3>♐ Code snippet of the day</h3></th></tr>
<img src="https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.code.svg"> <tr><td colspan="2" align="center"><p>This plugin displays a random code snippet from your recent activity history.</p>
<blockquote>
<p>⚠️ When improperly configured, this plugin could display private code.
If you work with sensitive data or company code, it is advised to keep this plugin disabled.
Use at your own risk, <em>metrics</em> and its authors cannot be held responsible for any resulting code leaks.</p>
</blockquote>
</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"><code>📗 Classic template</code></a></td>
</tr>
<tr>
<td><code>👤 Users</code> <code>👥 Organizations</code></td>
</tr>
<tr>
<td><code>🔑 (scopeless)</code> <code>read:org (optional)</code> <code>read:user (optional)</code> <code>repo (optional)</code></td>
</tr>
<tr>
<td colspan="2" align="center">
<img src="https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.code.svg" alt=""></img>
<img width="900" height="1" alt=""> <img width="900" height="1" alt="">
</td> </td>
</tr>
</table> </table>
<!--/header-->
#### ➡️ Available options ## ➡️ Available options
<!--options--> <!--options-->
<table> <table>
@@ -20,7 +36,7 @@ Display a random code snippet from your recent activity history.
</tr> </tr>
<tr> <tr>
<td nowrap="nowrap"><code>plugin_code</code></td> <td nowrap="nowrap"><code>plugin_code</code></td>
<td rowspan="2"><p>Display a random code snippet from recent activity</p> <td rowspan="2"><p>Enable code plugin</p>
<img width="900" height="1" alt=""></td> <img width="900" height="1" alt=""></td>
</tr> </tr>
<tr> <tr>
@@ -30,7 +46,7 @@ Display a random code snippet from your recent activity history.
</tr> </tr>
<tr> <tr>
<td nowrap="nowrap"><code>plugin_code_lines</code></td> <td nowrap="nowrap"><code>plugin_code_lines</code></td>
<td rowspan="2"><p>Maximum number of line that a code snippet can contain</p> <td rowspan="2"><p>Display limit for code snippets</p>
<img width="900" height="1" alt=""></td> <img width="900" height="1" alt=""></td>
</tr> </tr>
<tr> <tr>
@@ -40,7 +56,7 @@ Display a random code snippet from your recent activity history.
</tr> </tr>
<tr> <tr>
<td nowrap="nowrap"><code>plugin_code_load</code></td> <td nowrap="nowrap"><code>plugin_code_load</code></td>
<td rowspan="2"><p>Number of events to load</p> <td rowspan="2"><p>Events to load</p>
<img width="900" height="1" alt=""></td> <img width="900" height="1" alt=""></td>
</tr> </tr>
<tr> <tr>
@@ -53,7 +69,8 @@ Display a random code snippet from your recent activity history.
</tr> </tr>
<tr> <tr>
<td nowrap="nowrap"><code>plugin_code_visibility</code></td> <td nowrap="nowrap"><code>plugin_code_visibility</code></td>
<td rowspan="2"><p>Set events visibility</p> <td rowspan="2"><p>Events visibility</p>
<p>Lets you hide private activity when using a <code>repo</code> scope token</p>
<img width="900" height="1" alt=""></td> <img width="900" height="1" alt=""></td>
</tr> </tr>
<tr> <tr>
@@ -64,7 +81,7 @@ Display a random code snippet from your recent activity history.
</tr> </tr>
<tr> <tr>
<td nowrap="nowrap"><code>plugin_code_skipped</code></td> <td nowrap="nowrap"><code>plugin_code_skipped</code></td>
<td rowspan="2"><p>Repositories to skip</p> <td rowspan="2"><p>Skipped repositories</p>
<img width="900" height="1" alt=""></td> <img width="900" height="1" alt=""></td>
</tr> </tr>
<tr> <tr>
@@ -75,20 +92,19 @@ Display a random code snippet from your recent activity history.
</tr> </tr>
<tr> <tr>
<td nowrap="nowrap"><code>plugin_code_languages</code></td> <td nowrap="nowrap"><code>plugin_code_languages</code></td>
<td rowspan="2"><p>Restrict code snippet languages</p> <td rowspan="2"><p>Restrict display to specific languages</p>
<img width="900" height="1" alt=""></td> <img width="900" height="1" alt=""></td>
</tr> </tr>
<tr> <tr>
<td nowrap="nowrap"><b>type:</b> <code>array</code> <td nowrap="nowrap">🌐 Web instances must configure <code>settings.json</code><br>
<b>type:</b> <code>array</code>
<i>(comma-separated)</i> <i>(comma-separated)</i>
<br></td> <br></td>
</tr> </tr>
</table> </table>
<!--/options--> <!--/options-->
*[→ Full specification](metadata.yml)* ## Examples workflows
#### Examples workflows
<!--examples--> <!--examples-->
```yaml ```yaml

View File

@@ -1,5 +1,13 @@
name: "♐ Code snippet of the day" name: "♐ Code snippet of the day"
category: github category: github
description: |
This plugin displays a random code snippet from your recent activity history.
> ⚠️ When improperly configured, this plugin could display private code.
> If you work with sensitive data or company code, it is advised to keep this plugin disabled.
> Use at your own risk, *metrics* and its authors cannot be held responsible for any resulting code leaks.
examples:
default: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.code.svg
index: 12 index: 12
supports: supports:
- user - user
@@ -8,49 +16,45 @@ scopes:
- public_access - public_access
inputs: inputs:
# Enable or disable plugin
plugin_code: plugin_code:
description: Display a random code snippet from recent activity description: Enable code plugin
type: boolean type: boolean
default: no default: no
# Maximum number of lines that a code snippet can contain
plugin_code_lines: plugin_code_lines:
description: Maximum number of line that a code snippet can contain description: Display limit for code snippets
type: number type: number
default: 12 default: 12
# Number of activity events to load
# A high number will consume more requests
plugin_code_load: plugin_code_load:
description: Number of events to load description: Events to load
type: number type: number
default: 100 default: 100
min: 100 min: 100
max: 1000 max: 1000
# Set events visibility (use this to restrict events when using a "repo" token)
plugin_code_visibility: plugin_code_visibility:
description: Set events visibility description: |
Events visibility
Lets you hide private activity when using a `repo` scope token
type: string type: string
default: public default: public
values: values:
- public - public
- all - all
# List of repositories that will be skipped
plugin_code_skipped: plugin_code_skipped:
description: Repositories to skip description: Skipped repositories
type: array type: array
format: comma-separated format: comma-separated
default: "" default: ""
example: my-repo-1, my-repo-2, owner/repo-3, ... example: my-repo-1, my-repo-2, owner/repo-3, ...
inherits: repositories_skipped inherits: repositories_skipped
# Restrict code snippet languages
# These are guessed through linguist
plugin_code_languages: plugin_code_languages:
description: Restrict code snippet languages extras: yes
description: Restrict display to specific languages
type: array type: array
format: comma-separated format: comma-separated
default: "" default: ""