From 0df3f23fe8c4c2c51ff77489bcc767909118921a Mon Sep 17 00:00:00 2001 From: lowlighter <22963968+lowlighter@users.noreply.github.com> Date: Mon, 11 Jan 2021 22:33:46 +0100 Subject: [PATCH] Update README.md --- README.md | 178 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 105 insertions(+), 73 deletions(-) diff --git a/README.md b/README.md index 3f826b57..c08617cd 100644 --- a/README.md +++ b/README.md @@ -251,7 +251,7 @@ For a fully-featured experience, consider using this as a [GitHub Action](https: Setup a GitHub Action which runs periodically and pushes your generated metrics image on your repository. See all supported options in [action.yml](action.yml). -Assuming your username is `my-github-user`, you can then embed your metrics in your repository readme like below : +Assuming your username is `my-github-user`, you can then embed your metrics in your repository readme like below: ```markdown ![Metrics](https://github.com/my-github-user/my-github-user/blob/master/github-metrics.svg) @@ -266,7 +266,7 @@ Create a repository with the same name as your GitHub username if it's not alrea ![Setup personal repository](.github/readme/imgs/setup_personal_repository.png) -The `README.md` of it will be displayed on your user profile : +The `README.md` of it will be displayed on your user profile: ![GitHub Profile Example](.github/readme/imgs/example_github_profile.png) @@ -278,12 +278,12 @@ No additional scopes are needed, unless you want to include your private reposit ![Setup a GitHub personal token](.github/readme/imgs/setup_personal_token.png) -With a scope-less token, you can still display private contributions by enabling `Include private contributions on my profile` in your account settings : +With a scope-less token, you can still display private contributions by enabling `Include private contributions on my profile` in your account settings: ![Enable "Include private contributions on my profile`"](.github/readme/imgs/setup_private_contributions.png) Some plugins also require additional scopes, which is indicated in their respective documentation. -In case your token does not have the required scope (and `plugins_errors_fatal` is not enabled), it will be directly notified in the plugin render like below : +In case your token does not have the required scope (and `plugins_errors_fatal` is not enabled), it will be directly notified in the plugin render like below: ![Plugin error example](https://github.com/lowlighter/lowlighter/blob/master/metrics.plugin.error.svg) @@ -295,7 +295,7 @@ Go to the `Settings` of your personal repository to create a new secret and past ### 3. Create a new GitHub Action workflow on your personal repository -Create a new workflow from the `Actions` tab of your personal repository and paste the following : +Create a new workflow from the `Actions` tab of your personal repository and paste the following: ```yaml name: Metrics @@ -320,7 +320,7 @@ jobs: See all supported options in [action.yml](action.yml). -When using a token with additional permissions, it is advised to fork this repository to minimize security risks : +When using a token with additional permissions, it is advised to fork this repository to minimize security risks: ```yaml - uses: my-github-username/metrics@latest ``` @@ -345,7 +345,7 @@ Note that most of steps presented there are illustrative examples for this readm ### 4. Embed the link into your README.md -Edit your repository readme and add your metrics image : +Edit your repository readme and add your metrics image: ```markdown ![Metrics](https://github.com/my-github-user/my-github-user/blob/master/github-metrics.svg) @@ -357,7 +357,7 @@ Edit your repository readme and add your metrics image : For conveniency, you can use the shared instance available at [metrics.lecoq.io](https://metrics.lecoq.io) without any additional setup. -Assuming your username is `my-github-user`, you can embed your metrics in your repository readme like below : +Assuming your username is `my-github-user`, you can embed your metrics in your repository readme like below: ```markdown ![Metrics](https://metrics.lecoq.io/my-github-user) @@ -368,7 +368,7 @@ Visit [metrics.lecoq.io](https://metrics.lecoq.io) for more informations.
💬 Restrictions and fair use -Since GitHub API has rate limitations, the shared instance has a few limitations : +Since GitHub API has rate limitations, the shared instance has a few limitations: * Images are cached for 1 hour * Your generated metrics won't be updated during this amount of time when queried * A rate limiter is enabled, although it won't affect already cached users metrics @@ -405,7 +405,7 @@ No additional scopes are needed. Connect to server and ensure [NodeJS](https://nodejs.org/en/) is installed (see tested version in [workflow](.github/workflows/workflow.yml#L18)). -Run the following commands to clone this repository, install dependencies and copy configuration example file : +Run the following commands to clone this repository, install dependencies and copy configuration example file: ```shell git clone https://github.com/lowlighter/metrics.git @@ -430,7 +430,7 @@ See all supported options in [settings.example.json](settings.example.json). ### 4. Start your instance -Run the following command to start your instance once you've finished configuring it : +Run the following command to start your instance once you've finished configuring it: ```shell npm start @@ -440,7 +440,7 @@ From your browser, you should be able to access your web instance on the port yo ### 5. Embed the link into your README.md -Edit your repository readme and add your metrics image from your server domain : +Edit your repository readme and add your metrics image from your server domain: ```markdown ![Metrics](https://my-personal-domain.com/my-github-user) @@ -451,7 +451,7 @@ Edit your repository readme and add your metrics image from your server domain : To ensure that your instance will be restarted in case of reboots or crashs, you should setup it as a service. This is described below for linux-like systems which supports *systemd*. -Create a new service file `/etc/systemd/system/github_metrics.service` and paste the following after editing paths inside : +Create a new service file `/etc/systemd/system/github_metrics.service` and paste the following after editing paths inside: ``` [Unit] @@ -468,7 +468,7 @@ ExecStart=/usr/bin/node /path/to/metrics/index.mjs WantedBy=multi-user.target ``` -Reload services, enable it, start it and check if it is up and running : +Reload services, enable it, start it and check if it is up and running: ```shell systemctl daemon-reload @@ -482,7 +482,7 @@ systemctl status github_metrics
⚠️ HTTP errors code -The following errors code can be encountered on a web instance : +The following errors code can be encountered on a web instance: | Error code | Description | | ------------------------- | -------------------------------------------------------------------------- | @@ -512,7 +512,7 @@ For example, to opt-out from `activity`, `community` and `metadata`, append `?ba Plugins are disabled by default, but passing `?=1` will enable a specific ``. Plugin options can be passed with `?.