{"id":16369681,"url":"https://github.com/dcsunset/remark-graphviz-svg","last_synced_at":"2025-04-15T02:36:42.119Z","repository":{"id":57352959,"uuid":"445859104","full_name":"DCsunset/remark-graphviz-svg","owner":"DCsunset","description":"A remark plugin to convert GraphViz code into SVG diagram","archived":false,"fork":false,"pushed_at":"2022-01-09T16:21:31.000Z","size":53,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T14:51:10.713Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DCsunset.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":"2022-01-08T15:40:32.000Z","updated_at":"2023-08-25T22:53:30.000Z","dependencies_parsed_at":"2022-09-16T08:20:27.200Z","dependency_job_id":null,"html_url":"https://github.com/DCsunset/remark-graphviz-svg","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCsunset%2Fremark-graphviz-svg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCsunset%2Fremark-graphviz-svg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCsunset%2Fremark-graphviz-svg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCsunset%2Fremark-graphviz-svg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DCsunset","download_url":"https://codeload.github.com/DCsunset/remark-graphviz-svg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248995100,"owners_count":21195497,"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":[],"created_at":"2024-10-11T02:56:01.603Z","updated_at":"2025-04-15T02:36:41.841Z","avatar_url":"https://github.com/DCsunset.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# remark-graphviz-svg\n\n[![Version](https://img.shields.io/npm/v/remark-graphviz-svg.svg)](https://npmjs.org/package/remark-graphviz-svg)\n\nA remark plugin to convert GraphViz code into SVG diagram\n\n## Features\n\n* Custom language name for code blocks\n* Support different GraphViz [engines](https://graphviz.org/docs/layouts/)\n* SVG Optimization using [svgo](https://github.com/svg/svgo)\n\n## Installation\n\n```\nnpm install remark-graphviz-svg\n```\n\nNote: This package uses [ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).\nUse Node 12+ and ESM import syntax to use this package.\n\n## Usage\n\n```js\nimport remarkParse from \"remark-parse\";\nimport remarkRehype from \"remark-rehype\";\nimport rehypeStringify from \"rehype-stringify\";\nimport { remarkGraphvizSvg } from \"remark-graphviz-svg\";\nimport fs from \"fs\";\n\nconst processor = unified()\n  .use(remarkParse)\n  .use(remarkGraphvizSvg)\n  .use(remarkRehype)\n  .use(rehypeStringify);\n\nconst content = await processor.process(\n  fs.readFileSync(\"example.md\")\n);\n\nconsole.log(content.value);\n```\n\nSuppose the `example.md` has the following content:\n\n````md\n# Hello, world\n\n```graphviz\ndigraph {\n  A -\u003e B\n}\n```\n````\n\nThen the output of the above code is similar to the following:\n\n```html\n\u003ch1\u003eHello, world\u003c/h1\u003e\n\u003cp\u003e\n  \u003csvg\u003e\u003c!-- generated svg --\u003e\u003c/svg\u003e\n\u003c/p\u003e\n```\n\n\n## Options\n\n* `language`: Render GraphViz diagrams on specific language blocks. (Default: `graphviz`)\n* `graphvizEngine`: GraphViz engine to use. See available engines [here](https://graphviz.org/docs/layouts/). (Default: `dot`)\n* `svgoOptions`: Override default svgo options. Set it to `null` to disable svgo. (Default: `defaultSvgoOptions`)\n\n## License\n\nGPL-3.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcsunset%2Fremark-graphviz-svg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcsunset%2Fremark-graphviz-svg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcsunset%2Fremark-graphviz-svg/lists"}