Skip to content

Idea: JavaScript macros in the YAML file #36

@simonw

Description

@simonw

This is just a harebrained idea at the moment: what if the YAML could define JavaScript that could be applied to all of the shots in the file, with customizations for each shot?

Something like this:

macros:
- javascript: |
    Array.from(
      document.querySelectorAll(
        ShotScraper.inputs.toRemove
      )
    ).forEach(el => el.style.display='none')
shots:
- url: https://site-one.com/
  output: one.png
  inputs:
    toRemove: "#ad,#footer"
- url: https://site-two.com/
  output: two.png
  inputs:
    toRemove: "#adbanner"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions