Files
metrics/source/plugins/core/README.md
2021-03-07 10:29:37 +01:00

3.6 KiB
Raw Blame History

🧱 Core

Metrics also have general options that impact global metrics rendering.

➡️ Available options

🌐 Set timezone

By default, dates are based on Greenwich meridian (GMT/UTC).

Set your timezone (see here for a list of supported timezones) using config_timezone option.

Examples workflows

- uses: lowlighter/metrics@latest
  with:
    # ... other options
    config_timezone: Europe/Paris

📦 Ordering content

You can order metrics content by using config_order option.

It is not mandatory to specify all partials of used templates. Omitted one will be appended using default order.

Examples workflows

- uses: lowlighter/metrics@latest
  with:
    # ... other options
    base: header
    plugin_isocalendar: yes
    plugin_languages: yes
    plugin_stars: yes
    config_order: base.header, isocalendar, languages, stars

🥳 Render GitHub custom emojis

GitHub provide additional emojis which are not registered in Unicode standard (:octocat:, :shipit:, :trollface:, ...). You can choose to render (or not) GitHub emojis.

It may increase filesize since it replace special strings by base64 images.

Examples workflows

- uses: lowlighter/metrics@latest
  with:
    # ... other options
    config_gemoji: yes

🙂 Using twemojis instead of emojis

You can choose to use twemojis instead of regular emojis so rendered metrics are more consistent across all platforms.

It may increase filesize since it replace unicode characters by SVG images.

Examples workflows

- uses: lowlighter/metrics@latest
  with:
    # ... other options
    config_twemoji: yes

🎞️ SVG CSS Animations

As rendered metrics use HTML and CSS, some templates have animations. You can choose to disable them by using config_animations option.

Examples workflows

- uses: lowlighter/metrics@latest
  with:
    # ... other options
    committer_branch: my-branch

🔲 Adjust padding

Height of rendered metrics is computed after being rendered through an headless browser. As it can depend on fonts and operating system, it is possible that final result is cropped or has blank space at the bottom.

You can adjust padding by using config_padding option.

Specify a single value to apply it to both height and with, and two values to use the first one for width and the second for height. Both positive and negative values are accepted, but you must specify a percentage.

Examples workflows

- uses: lowlighter/metrics@latest
  with:
    # ... other options
    config_padding: 6%, 10% # 6% width padding, 10% height padding

♻️ Retrying automatically failed rendering

Rendering is subject to external factors and can fail from time to time. It is possible to mitigate this issue using retries and retries_delay options to automatically retry later metrics rendering and avoid workflow fails.

Examples workflows

- uses: lowlighter/metrics@latest
  with:
    # ... other options
    retries: 3
    retries_delay: 300

💱 Convert output to PNG/JPEG

It is possible to convert output from SVG to PNG or JPEG images by using config_output option.

Note that png does not support animations while jpeg does not support both animations and transparency.

Examples workflows

- uses: lowlighter/metrics@latest
  with:
    # ... other options
    config_output: png