name: 📸 Website screenshot
category: community
description: |
  This plugin displays a screenshot from any website.

  It can either show the full page or a portion restricted by a [CSS selector](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors).
examples:
  default: https://github.com/lowlighter/metrics/blob/examples/metrics.plugin.screenshot.svg
authors:
  - lowlighter
supports:
  - user
  - organization
  - repository
scopes: []
inputs:

  plugin_screenshot:
    description: |
      Enable screenshot plugin
    type: boolean
    default: no
    extras:
      - metrics.run.puppeteer.scrapping

  plugin_screenshot_title:
    description: |
      Title caption
    type: string
    default: Screenshot

  plugin_screenshot_url:
    description: |
      Website URL
    type: string
    default: ""
    example: https://metrics.lecoq.io

  plugin_screenshot_selector:
    description: |
      CSS Selector
    type: string
    default: body

  plugin_screenshot_mode:
    description: |
      Output mode

      - `image`: screenshot of selected element
      - `text`: keep [`innerText`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/innerText) of selected element
        - *⚠️ Any CSS style applied to text such as font size, weight or color will be removed*
    type: string
    default: image
    values:
      - image
      - text

  plugin_screenshot_viewport:
    description: |
      Viewport options
    type: json
    default: |
      {
        "width": 1280,
        "height": 1280
      }

  plugin_screenshot_wait:
    description: |
      Wait time before taking screenshot (ms)
    type: number
    min: 0
    default: 0

  plugin_screenshot_background:
    description: |
      Background
    type: boolean
    default: yes
