{"id":15989329,"url":"https://github.com/robot-inventor/rehype-image-caption","last_synced_at":"2026-01-23T08:12:03.375Z","repository":{"id":228222639,"uuid":"773452603","full_name":"Robot-Inventor/rehype-image-caption","owner":"Robot-Inventor","description":"rehype plugin to set captions for images in addition to alt text.","archived":false,"fork":false,"pushed_at":"2025-08-08T19:29:00.000Z","size":564,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-08T21:25:52.021Z","etag":null,"topics":["rehype","rehype-plugin","remark","unified","unifiedjs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/Robot-Inventor.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2024-03-17T17:44:45.000Z","updated_at":"2025-08-08T19:29:03.000Z","dependencies_parsed_at":"2024-04-18T08:57:59.352Z","dependency_job_id":"228d37f7-d69a-4207-a85b-1801ac5d1ed9","html_url":"https://github.com/Robot-Inventor/rehype-image-caption","commit_stats":null,"previous_names":["robot-inventor/rehype-image-caption"],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/Robot-Inventor/rehype-image-caption","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robot-Inventor%2Frehype-image-caption","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robot-Inventor%2Frehype-image-caption/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robot-Inventor%2Frehype-image-caption/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robot-Inventor%2Frehype-image-caption/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Robot-Inventor","download_url":"https://codeload.github.com/Robot-Inventor/rehype-image-caption/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Robot-Inventor%2Frehype-image-caption/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269663702,"owners_count":24455828,"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-10T02:00:08.965Z","response_time":71,"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":["rehype","rehype-plugin","remark","unified","unifiedjs"],"created_at":"2024-10-08T04:41:45.149Z","updated_at":"2026-01-23T08:12:03.334Z","avatar_url":"https://github.com/Robot-Inventor.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rehype-image-caption\n\nrehype plugin to set captions for images in addition to alt text.\n\n## Installation\n\n```sh\nnpm install rehype-image-caption\n```\n\n## Example\n\n```javascript\nimport remarkParse from \"remark-parse\";\nimport rehypeStringify from \"rehype-stringify\";\nimport remarkRehype from \"remark-rehype\";\nimport { unified } from \"unified\";\nimport rehypeImageCaption from \"rehype-image-caption\";\n\nconst processor = unified()\n    .use(remarkParse)\n    .use(remarkRehype)\n    .use(rehypeImageCaption)\n    .use(rehypeStringify);\n\nconst markdown = `\n![alt text](image.jpg)\n\n![alt text](image.jpg)*caption text*\n\n![alt text](image.jpg)\n*caption text*\n`;\n\nprocessor.process(markdown).then((result) =\u003e {\n    console.log(result.toString());\n});\n```\n\nThe above code will output the following:\n\n```html\n\u003cfigure\u003e\n    \u003cimg src=\"image.jpg\" alt=\"alt text\"\u003e\n\u003c/figure\u003e\n\u003cfigure\u003e\n    \u003cimg src=\"image.jpg\" alt=\"alt text\"\u003e\n    \u003cfigcaption\u003ecaption text\u003c/figcaption\u003e\n\u003c/figure\u003e\n\u003cfigure\u003e\n    \u003cimg src=\"image.jpg\" alt=\"alt text\"\u003e\n    \u003cfigcaption\u003ecaption text\u003c/figcaption\u003e\n\u003c/figure\u003e\n```\n\n## Options\n\n### `wrapImagesWithoutCaptions`\n\n- Type: `boolean`\n- Default: `true`\n\nWrap images without captions in a `\u003cfigure\u003e` tag. If set to `false`, images without captions will not be wrapped in a `\u003cfigure\u003e` tag.\n\n## Development\n\n### Build\n\n```sh\nnpm run build\n```\n\n### Format\n\n```sh\nnpm run format\n```\n\nor\n\n```sh\nnpm run format:check\n```\n\n### Lint\n\n```sh\nnpm run lint\n```\n\n### Test\n\n```sh\nnpm run test\n```\n\n### Pull Requests\n\nThis repository uses [Changesets](https://github.com/changesets/changesets) to manage versioning and releases. When creating a pull request, please run the Changesets CLI and commit the changeset file.\n\n```bash\nnpx changeset\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobot-inventor%2Frehype-image-caption","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobot-inventor%2Frehype-image-caption","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobot-inventor%2Frehype-image-caption/lists"}