{"id":14971009,"url":"https://github.com/jamessimone/gatsby-remark-codefence","last_synced_at":"2025-10-26T14:30:59.526Z","repository":{"id":57244814,"uuid":"266552936","full_name":"jamessimone/gatsby-remark-codefence","owner":"jamessimone","description":"Add codefence to your gatsby site's markdown","archived":false,"fork":false,"pushed_at":"2021-05-24T02:52:09.000Z","size":115,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-16T21:05:15.228Z","etag":null,"topics":["code-formatter","gatsby","gatsby-plugin","gatsby-remark","gatsbyjs","remark-plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jamessimone.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-24T14:02:10.000Z","updated_at":"2023-04-26T19:46:30.000Z","dependencies_parsed_at":"2022-09-01T06:12:06.339Z","dependency_job_id":null,"html_url":"https://github.com/jamessimone/gatsby-remark-codefence","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamessimone%2Fgatsby-remark-codefence","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamessimone%2Fgatsby-remark-codefence/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamessimone%2Fgatsby-remark-codefence/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamessimone%2Fgatsby-remark-codefence/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamessimone","download_url":"https://codeload.github.com/jamessimone/gatsby-remark-codefence/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236575794,"owners_count":19171266,"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":["code-formatter","gatsby","gatsby-plugin","gatsby-remark","gatsbyjs","remark-plugin"],"created_at":"2024-09-24T13:44:29.765Z","updated_at":"2025-10-26T14:30:54.179Z","avatar_url":"https://github.com/jamessimone.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gatsby Remark Codefence\n\n[![npm](https://img.shields.io/npm/v/gatsby-remark-codefence/latest.svg?style=flat-square)](https://www.npmjs.com/package/gatsby-remark-codefence)\n\nThis plugin hooks into [gatsby-transformer-remark](https://www.gatsbyjs.org/packages/gatsby-transformer-remark/) to add [Codefence](https://codefence.io/) styled code formatting blocks to your website.\n\nCodefence creates interactive and runnable code sections; this plugin transform generic code formatted blocks in Markdown into their associated Codefence blocks.\n\nThus, this:\n\n```js heading=\"Example JavaScript\"\nconst exampleList = [\"a\", \"b\", \"c\", true, \"d\"];\nexampleList.forEach((example) =\u003e console.log(example));\n```\n\nBecomes this:\n\n![Example Codefence](./example-codefence-start.PNG)\n\nWhich can then be run within the browser to produce:\n\n![Example codefence after running](./example-codefence.PNG)\n\n## Installation\n\nYou can add `gatsby-remark-codefence` to your Gatsby site using NPM or yarn:\n\n- `npm install --save gatsby-remark-codefence`\n- `yarn add gatsby-remark-codefence`\n\nAfter that, all you need to do is add `gatsby-remark-codefence` to your list of Remark plugins in your `gatsby-config.js` file:\n\n```javascript\n// In gatsby-config.js\nplugins: [\n  {\n    resolve: `gatsby-transformer-remark`,\n    options: {\n      plugins: [\n        //...\n        `gatsby-remark-codefence`,\n      ],\n    },\n  },\n];\n```\n\n**Note**: order matters within your `gatsby-transformer-remark` plugin; if you have other code formatting markdown plugins installed (like `gatsby-remark-prismjs`), whichever plugin is listed first will take precedence when applying code formatting.\n\n## Usage\n\nFor a full list of the available options that can be used when formatting your Codefence sections, please refer to [their documentation](https://codefence.io/#getting-started). At the time of publication, these are the options that you can use when formatting:\n\n- `lang`: this is determined by the language set on the triple-backtick, at the moment the following languages are supported -- Ada, C/C++, C#, Clojure, Crystal, D, Dart, Elixir, Erlang, Forth, GNU Assembly, Go, Haskell, Java, JavaScript, Kotlin, Lua, Perl, PHP, Python, R, Raku, Ruby, Rust, Scala, Swift, TypeScript, Zig\n- `version`: some of the languages supported have multiple versions that you can specify. Check the Codefence site for the up-to-date list, not all languages have configurable versions\n- `heading`: this is an extremely useful option, which shows a heading title for your code section (as shown in the example)\n- `artifact`: if your code produces a file, this allows you to export that file so that it can be viewed in the results when your code is run\n- `cache` : set to false using \"cache=false\" on the opening line of your code if you are printing something like the current time in your examples, otherwise after the first time you use a code section, it becomes cached by Codefence. Otherwise, examples are cached for 24hrs at a time until their contents change.\n\n## Contributions\n\nContributions are welcome!\n\nMany thanks to:\n\n- [Ben Phelps](https://github.com/benphelps), Codefence creator, for fixing several issues found while working on this plugin and contributing high-resolution images to the Readme\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamessimone%2Fgatsby-remark-codefence","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamessimone%2Fgatsby-remark-codefence","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamessimone%2Fgatsby-remark-codefence/lists"}