{"id":18667741,"url":"https://github.com/temando/remark-graphviz","last_synced_at":"2025-04-11T23:34:05.519Z","repository":{"id":57140502,"uuid":"100233641","full_name":"temando/remark-graphviz","owner":"temando","description":"A remark plugin for Markdown that replaces graphs defined in `dot` with rendered SVGs.","archived":false,"fork":false,"pushed_at":"2019-02-19T12:08:43.000Z","size":39,"stargazers_count":20,"open_issues_count":1,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-25T19:53:37.725Z","etag":null,"topics":["graphviz","graphviz-dot","remark","remark-plugin"],"latest_commit_sha":null,"homepage":null,"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/temando.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}},"created_at":"2017-08-14T06:04:19.000Z","updated_at":"2024-12-04T00:44:21.000Z","dependencies_parsed_at":"2022-09-04T22:10:41.879Z","dependency_job_id":null,"html_url":"https://github.com/temando/remark-graphviz","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/temando%2Fremark-graphviz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/temando%2Fremark-graphviz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/temando%2Fremark-graphviz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/temando%2Fremark-graphviz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/temando","download_url":"https://codeload.github.com/temando/remark-graphviz/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248231630,"owners_count":21069366,"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":["graphviz","graphviz-dot","remark","remark-plugin"],"created_at":"2024-11-07T08:39:54.547Z","updated_at":"2025-04-11T23:34:00.506Z","avatar_url":"https://github.com/temando.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# remark-graphviz\n\n[![NPM](https://img.shields.io/npm/v/remark-graphviz.svg)](https://npmjs.org/packages/remark-graphviz/)\n[![Travis CI](https://img.shields.io/travis/temando/remark-graphviz.svg)](https://travis-ci.org/temando/remark-graphviz)\n[![MIT License](https://img.shields.io/github/license/temando/remark-graphviz.svg)](https://en.wikipedia.org/wiki/MIT_License)\n\nReplaces graphs defined in [`dot`](http://www.graphviz.org/content/dot-language)\nwith rendered SVGs.\n\n## Installation\n\n```sh\n$ npm install remark-graphviz\n```\n\n## Usage\n\nGraphs defined using `dot` can be referenced using a `dot:` title which will\ngenerate an SVG image.\n\n```md\n[Link to a Graph](test/fixtures/assets/example.dot \"dot:\")\n![Embed image of graph](test/fixtures/assets/example.dot \"dot:\")\n```\n\nAlternatively, graphs can be generated inline, by using `dot` (or `circo`) as\nthe language identifier for a fenced code block.\n\n\u003cpre\u003e\n```dot\ndigraph graphname {\n  a -\u003e b;\n  b -\u003e c;\n  a -\u003e c;\n}\n```\n\u003c/pre\u003e\n\nSee this project's [fixtures](test/fixtures) for more examples.\n\n## Example\n\nGiven a file, `example.md`, which contains the following Markdown:\n\n\u003cpre\u003e\n# dot code block\n\n```dot\ndigraph graphname {\n  a -\u003e b;\n  b -\u003e c;\n  a -\u003e c;\n}\n```\n\u003c/pre\u003e\n\nUsing remark like follows:\n\n```js\nvar vfile = require('to-vfile');\nvar remark = require('remark');\nvar graphviz = require('remark-graphviz');\n\nvar example = vfile.readSync('example.md');\n\nremark()\n  .use(graphviz)\n  .process(example, function (err, file) {\n    if (err) throw err;\n\n    console.log(String(file))\n  });\n```\n\nWill result in an SVG being written relative to `example.md`, and the Markdown\nbeing transformed to:\n\n```md\n# dot code block\n\n![](./6b03e143dc2a47a93496133d692c44d5ec012b57.svg \"`dot` image\")\n```\n\nTo change where the SVG's are written, set `data.destinationFilePath` on the\nvFile. This following shows how you could process a file from one directory and\noutput the transformed file to another:\n\n```js\nvar vfile = require('to-vfile');\nvar remark = require('remark');\nvar graphviz = require('remark-graphviz');\n\nvar example = vfile.readSync('example.md');\nexample.data = {\n  destinationFilePath: 'out/example.md'\n};\n\nremark()\n  .use(graphviz)\n  .process(example, function (err, file) {\n    if (err) throw err;\n\n    vfile.writeSync({ path: file.data.destinationFilePath });\n  });\n```\n\nBoth `example.md` and the generated SVG will reside in the `/out` directory.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftemando%2Fremark-graphviz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftemando%2Fremark-graphviz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftemando%2Fremark-graphviz/lists"}