Format .github code

This commit is contained in:
lowlighter
2021-08-19 22:39:50 +02:00
parent c9a1ef7102
commit fc9d97fd14
5 changed files with 187 additions and 187 deletions

View File

@@ -1,21 +1,21 @@
//Imports
import puppeteer from "puppeteer"
import puppeteer from "puppeteer"
//Setup browser
const browser = await puppeteer.launch({
headless:true,
executablePath:process.env.PUPPETEER_BROWSER_PATH,
args:["--no-sandbox", "--disable-extensions", "--disable-setuid-sandbox", "--disable-dev-shm-usage"],
ignoreDefaultArgs:["--disable-extensions"],
})
const page = await browser.newPage()
const browser = await puppeteer.launch({
headless:true,
executablePath:process.env.PUPPETEER_BROWSER_PATH,
args:["--no-sandbox", "--disable-extensions", "--disable-setuid-sandbox", "--disable-dev-shm-usage"],
ignoreDefaultArgs:["--disable-extensions"],
})
const page = await browser.newPage()
//Select markdown example and take screenshoot
await page.setViewport({width:600, height:600})
await page.goto("https://github.com/lowlighter/lowlighter/blob/master/metrics.markdown.md")
const clip = await page.evaluate(() => {
const {x, y, width, height} = document.querySelector("#readme").getBoundingClientRect()
return {x, y, width, height}
})
await page.screenshot({type:"png", path:"metrics.markdown.png", clip, omitBackground:true})
await browser.close()
await page.setViewport({width:600, height:600})
await page.goto("https://github.com/lowlighter/lowlighter/blob/master/metrics.markdown.md")
const clip = await page.evaluate(() => {
const {x, y, width, height} = document.querySelector("#readme").getBoundingClientRect()
return {x, y, width, height}
})
await page.screenshot({type:"png", path:"metrics.markdown.png", clip, omitBackground:true})
await browser.close()