{"repo":"BadgerHobbs/vitepress-plugin-d2","free":true,"listed":false,"github":"https://github.com/BadgerHobbs/vitepress-plugin-d2","clone":"git clone https://github.com/BadgerHobbs/vitepress-plugin-d2.git","description":"Plugin for VitePress to add support for rendering D2 diagrams.","language":"TypeScript","stars":10,"topics":["d2","diagram","markdown","markdown-it","vitepress"],"license":"MIT","category":"productivity","readme_excerpt":"vitepress-plugin-d2 Plugin for VitePress to add support for rendering D2 diagrams, you can check out the example site here. It is also available on NPM. Requirements The plugin requires the D2 diagram language to be installed on your system, it is compatible with Linux, Windows and MacOS. You can use the following command on Linux to install D2 (official docs). If you are running on Windows, you can install the latest release .msi file from the official GitHub repo here. Once you have installed D2, you can check it is working by running the following command. Installation First, install the plugin from NPM. Then import it and update your VitePress config.mts file to use the plugin as shown below. Usage To use the D2 diagram plugin you just need to specify the d2 language next to the backticks before the fenced code block. d2 x - y The configuration defined within the VitePress config.mts is the default config applied to all diagrams. If you want to override this configuration for a specific diagram, you can do so with the below syntax. d2 :::config layout: DAGRE theme: GRAPE SODA darkTheme: BUTTERED TOAST ::: x - y See the /example directory within the repository for a full working example of how to use the plugin with VitePress. Further Reading To view working examples deployed within a VitePress static site instance, you can checkout the repository example deployed via GitHub pages here. For more information about D2 and it's capabilities, checkout the official documentatio","default_branch":null,"files":null,"tree":[],"storefront":"/r/BadgerHobbs","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/BadgerHobbs/vitepress-plugin-d2/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}