{"id":29429593,"url":"https://github.com/show-docs/remark-code-example","last_synced_at":"2025-10-24T06:49:06.802Z","repository":{"id":49831476,"uuid":"473668299","full_name":"show-docs/remark-code-example","owner":"show-docs","description":"Remark plugin to copy live code block as code sample.","archived":false,"fork":false,"pushed_at":"2024-05-30T07:57:28.000Z","size":811,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-09T14:59:32.636Z","etag":null,"topics":["code-block","doc","document","documentation","docusaurus","markdown","remark","remark-plugin","remarkjs","site-generator"],"latest_commit_sha":null,"homepage":"","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/show-docs.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-03-24T15:38:27.000Z","updated_at":"2025-08-01T03:56:50.000Z","dependencies_parsed_at":"2023-12-02T09:03:32.514Z","dependency_job_id":"bcbebf73-f406-4e69-80df-1fb7ef4d5d04","html_url":"https://github.com/show-docs/remark-code-example","commit_stats":null,"previous_names":["nice-move/remark-code-example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/show-docs/remark-code-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/show-docs%2Fremark-code-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/show-docs%2Fremark-code-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/show-docs%2Fremark-code-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/show-docs%2Fremark-code-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/show-docs","download_url":"https://codeload.github.com/show-docs/remark-code-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/show-docs%2Fremark-code-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271657552,"owners_count":24797935,"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","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-block","doc","document","documentation","docusaurus","markdown","remark","remark-plugin","remarkjs","site-generator"],"created_at":"2025-07-12T16:11:31.990Z","updated_at":"2025-10-24T06:49:01.742Z","avatar_url":"https://github.com/show-docs.png","language":"JavaScript","readme":"# remark-code-example\n\nRemark plugin to copy live code block as code example.\n\n[![npm][npm-badge]][npm-url]\n[![github][github-badge]][github-url]\n![node][node-badge]\n\n[npm-url]: https://www.npmjs.com/package/remark-code-example\n[npm-badge]: https://img.shields.io/npm/v/remark-code-example.svg?style=flat-square\u0026logo=npm\n[github-url]: https://github.com/nice-move/remark-code-example\n[github-badge]: https://img.shields.io/npm/l/remark-code-example.svg?style=flat-square\u0026colorB=blue\u0026logo=github\n[node-badge]: https://img.shields.io/node/v/remark-code-example.svg?style=flat-square\u0026colorB=green\u0026logo=node.js\n\n## Installation\n\n```sh\nnpm install remark remark-code-example --save-dev\n```\n\n## Usage\n\n```mjs\nimport readFileSync from 'node:fs';\n\nimport { remark } from 'remark';\nimport { remarkCodeExample } from 'remark-code-example';\n\nconst markdownText = readFileSync('example.md', 'utf8');\n\nremark()\n  .use(remarkCodeSample, {})\n  .process(markdownText)\n  .then((file) =\u003e console.info(file))\n  .catch((error) =\u003e console.warn(error));\n```\n\n### Options.metas\n\n- type: object of string\n- default: {}\n- required: false\n- description: Metas of example code block\n\n## Syntax\n\n### code-example\n\n`````markdown\nTurn\n\n```mermaid code-example\nflowchart\n  Start --\u003e Stop\n```\n\nInto\n\n````markdown\n```mermaid\nflowchart\n  Start --\u003e Stop\n```\n````\n`````\n\n### code-example-copy\n\n`````markdown\nTurn\n\n```mermaid code-example-copy\nflowchart\n  Start --\u003e Stop\n```\n\nInto\n\n```mermaid\nflowchart\n  Start --\u003e Stop\n```\n\n````markdown\n```mermaid\nflowchart\n  Start --\u003e Stop\n```\n````\n`````\n\n### code-alias-copy\n\n````markdown\nTurn\n\n```mermaid code-alias-copy=diagram\nflowchart\n  Start --\u003e Stop\n```\n\nInto\n\n```mermaid\nflowchart\n  Start --\u003e Stop\n```\n\n```diagram\nflowchart\n  Start --\u003e Stop\n```\n````\n\n## Related\n\n- [markdown-code-block-meta](https://github.com/nice-move/markdown-code-block-meta)\n- [remark-docusaurus](https://github.com/nice-move/remark-docusaurus)\n- [remark-kroki](https://github.com/nice-move/remark-kroki)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshow-docs%2Fremark-code-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshow-docs%2Fremark-code-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshow-docs%2Fremark-code-example/lists"}