Jazz up the code blocks in your issues. Generate beautiful images for them to make it easier to follow. Meant to be used as a Github Action.
BEFORE
AFTER
First appeared at: https://stackoverflow.com/a/61269447/2104976
The workflow of this action is as follows:
Additionally, it
Register your application with Imgur to get a client_id
. You will pass this as input to the action.
on:
issue_comment:
types: [created]
issues:
types: [opened]
jobs:
carbonate:
runs-on: ubuntu-latest
name: Generate beautiful images for code blocks present in issues
steps:
- name: Generate beautiful images for code blocks present in issues
uses: callmekatootie/carbonate@v1.0.2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
imgur-client-id: ${{ secrets.IMGUR_CLIENT_ID }}
More inputs are available. See below.
This is the environment variable GITHUB_TOKEN.
The client_id
that you obtained after registration with imgur. The action will be carrying out anonymous uploads. Required.
The action can use Prettier to format the code block before the image is generated. Set this input's value to the String 'true'
if you want to use it or to the String 'false'
otherwise. Default value is 'true'
This input is only read if use-prettier
input is 'true'
. You will specify the parser that you want Prettier to use for formatting the code. Default value is 'babel'
This input is only read if use-prettier
input is 'true'
. You can specify the format options to use with Prettier. You need to pass the options object as a JSON string. If none is passed, the action will fall back to Prettier's default format options.
You can specify the Carbon image generation configuration options. See this for a list of supported options. You need to pass the options object as a JSON string. If none is passed, the action will use the options defined in the constants.js
file.