{"id":14984156,"url":"https://github.com/callmekatootie/carbonate","last_synced_at":"2025-08-22T05:34:40.875Z","repository":{"id":44618677,"uuid":"287927167","full_name":"callmekatootie/carbonate","owner":"callmekatootie","description":"Github Action to format fenced code blocks in github issues as images. Originally created as part of DEV Github Actions hackathon: https://dev.to/callmekatootie/jazz-up-the-code-blocks-in-github-issues-52e6","archived":false,"fork":false,"pushed_at":"2022-02-04T09:35:39.000Z","size":9119,"stargazers_count":237,"open_issues_count":2,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-10T01:15:29.875Z","etag":null,"topics":["action","carbon","formatter","imgur","prettier"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/carbonate","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/callmekatootie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-16T11:06:44.000Z","updated_at":"2025-03-02T05:18:58.000Z","dependencies_parsed_at":"2023-01-05T04:53:00.845Z","dependency_job_id":null,"html_url":"https://github.com/callmekatootie/carbonate","commit_stats":{"total_commits":33,"total_committers":3,"mean_commits":11.0,"dds":0.06060606060606055,"last_synced_commit":"76eddf4bd2b057e9b910e90a5e326cc84be407ba"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/callmekatootie%2Fcarbonate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/callmekatootie%2Fcarbonate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/callmekatootie%2Fcarbonate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/callmekatootie%2Fcarbonate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/callmekatootie","download_url":"https://codeload.github.com/callmekatootie/carbonate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137891,"owners_count":21053775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["action","carbon","formatter","imgur","prettier"],"created_at":"2024-09-24T14:08:33.953Z","updated_at":"2025-04-10T01:15:45.028Z","avatar_url":"https://github.com/callmekatootie.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Carbonate\n\nJazz 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.\n\n**BEFORE**\n\n![](https://i.imgur.com/FzLtUjP.png)\n\n**AFTER**\n\n![](https://i.imgur.com/B29aF97.png)\n\n\u003e First appeared at: https://stackoverflow.com/a/61269447/2104976\n\n## Features\n\nThe workflow of this action is as follows:\n\n- It extracts the code block for the issue description / comment and generates images for them\n- It then inserts the image at the code block\n- It also retains the original code block as a collapsed detail in the same issue / comment body\n\nAdditionally, it\n\n- Allows formatting the code using Prettier and controlling the styling of the images generated\n- Supports the following events:\n  - issue_comment:\n    - types: created\n  - issues:\n    - types: opened\n\n## Not supported (yet)\n\n- Generating images from multiple code blocks in the same issue description / comment\n- Generating images after the issue description / comment has been edited\n\n## Advantages of code images over code blocks\n\n- Easy to view and understand the image of the code v/s the code block text when using a mobile device. Why? Easier to scroll images v/s text.\n- Members will no longer have to rely on the issue reporters and commenters to format their code blocks correctly. Using the in built formatter, the code is always structured properly\n- Maintainers can style the code blocks to suit their project's language and guidelines and not put the onus of this on the issue reporter / commenter\n- [Carbon]((https://github.com/carbon-app/carbon)). Oh wow Carbon! It generates really beautiful images of code and it is aesthetically better to look at v/s plain code text\n\n## Pre-requisites\n\n[Register](https://api.imgur.com/oauth2/addclient) your application with Imgur to get a `client_id`. You will pass this as input to the action.\n\n## Usage\n\n```yaml\non:\n  issue_comment:\n    types: [created]\n  issues:\n    types: [opened]\n\njobs:\n  carbonate:\n    runs-on: ubuntu-latest\n    name: Generate beautiful images for code blocks present in issues\n    steps:\n      - name: Generate beautiful images for code blocks present in issues\n        uses: callmekatootie/carbonate@v1.0.2\n        with:\n          github-token: ${{ secrets.GITHUB_TOKEN }}\n          imgur-client-id: ${{ secrets.IMGUR_CLIENT_ID }}\n```\n\nMore inputs are available. See below.\n\n### Inputs\n\n#### github-token\n\nThis is the environment variable [GITHUB_TOKEN](https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#about-the-github_token-secret).\n\n#### imgur-client-id\n\nThe `client_id` that you obtained after [registration](https://api.imgur.com/oauth2/addclient) with imgur. The action will be carrying out anonymous uploads. **Required**.\n\n#### use-prettier\n\nThe action can use [Prettier](https://prettier.io/) 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'**\n\n#### prettier-parser\n\nThis input is only read if `use-prettier` input is `'true'`. You will specify the [parser](https://prettier.io/docs/en/options.html#parser) that you want Prettier to use for formatting the code. **Default value is 'babel'**\n\n#### prettier-options\n\nThis input is only read if `use-prettier` input is `'true'`. You can specify the format [options](https://prettier.io/docs/en/options.html) 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.\n\n#### carbon-options\n\nYou can specify the Carbon image generation configuration options. See [this](https://github.com/petersolopov/carbonara#post-apicook) 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.\n\n## References\n\n- [Carbon](https://github.com/carbon-app/carbon) - Generate beautiful images for code\n- [Carbonara](https://github.com/petersolopov/carbonara) - Unofficial API for Carbon\n- [Imgur](https://apidocs.imgur.com/) - Generated images are stored in Imgur\n- [Prettier](https://prettier.io) - Opinionated Code Formatter\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcallmekatootie%2Fcarbonate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcallmekatootie%2Fcarbonate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcallmekatootie%2Fcarbonate/lists"}