html mode
This commit is contained in:
@@ -10,8 +10,8 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: ./
|
- uses: ./
|
||||||
with:
|
with:
|
||||||
format: txt
|
format: html
|
||||||
output: ./humans.txt
|
output: ./gh-pages/index.html
|
||||||
- uses: peaceiris/actions-gh-pages@v2
|
- uses: peaceiris/actions-gh-pages@v2
|
||||||
env:
|
env:
|
||||||
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ const chalk = require('chalk')
|
|||||||
|
|
||||||
const formatters = {
|
const formatters = {
|
||||||
txt: txtFormatter,
|
txt: txtFormatter,
|
||||||
|
html: htmlFormatter,
|
||||||
json: jsonFormatter,
|
json: jsonFormatter,
|
||||||
shell: (data, opts) => txtFormatter(data, { ...opts, colors: true}),
|
shell: (data, opts) => txtFormatter(data, { ...opts, colors: true}),
|
||||||
}
|
}
|
||||||
@@ -62,3 +63,12 @@ function mapColorRange(strings, base, total) {
|
|||||||
return strings.map((n, i) => chalk.hsl(((i + base) / total) * 360, 100, 50)(n))
|
return strings.map((n, i) => chalk.hsl(((i + base) / total) * 360, 100, 50)(n))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function htmlFormatter(data, opts) {
|
||||||
|
fs.writeSync(opts.output, `<!doctype html>
|
||||||
|
<meta charset='utf8' />
|
||||||
|
<title>Actions - humans.txt</title>
|
||||||
|
<body><pre>
|
||||||
|
`)
|
||||||
|
txtFormatter(data, opts)
|
||||||
|
fs.writeSync(opts.output, "</pre></body>")
|
||||||
|
}
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@ name: 'GitHub Actions humans.txt'
|
|||||||
description: 'List out the humans who help feed and tend the robots of GitHub Actions'
|
description: 'List out the humans who help feed and tend the robots of GitHub Actions'
|
||||||
inputs:
|
inputs:
|
||||||
format:
|
format:
|
||||||
description: 'How to output the people of actions - txt, json or ascii'
|
description: 'How to output the people of actions - txt, json, html or ascii'
|
||||||
default: 'ascii'
|
default: 'ascii'
|
||||||
output:
|
output:
|
||||||
description: 'Where to output the file - stdout otherwise'
|
description: 'Where to output the file - stdout otherwise'
|
||||||
|
|||||||
Reference in New Issue
Block a user