{"id":45478317,"url":"https://github.com/ram02z/d2-filter","last_synced_at":"2026-02-22T15:43:58.222Z","repository":{"id":151657325,"uuid":"624504926","full_name":"ram02z/d2-filter","owner":"ram02z","description":"Pandoc filter for D2","archived":false,"fork":false,"pushed_at":"2024-09-03T09:00:14.000Z","size":89,"stargazers_count":20,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-30T12:57:18.313Z","etag":null,"topics":["d2","pandoc","pandoc-filter"],"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/ram02z.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}},"created_at":"2023-04-06T16:05:01.000Z","updated_at":"2025-08-20T17:59:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"ca02e807-e362-4ec6-9a13-3e968ce36373","html_url":"https://github.com/ram02z/d2-filter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ram02z/d2-filter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ram02z%2Fd2-filter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ram02z%2Fd2-filter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ram02z%2Fd2-filter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ram02z%2Fd2-filter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ram02z","download_url":"https://codeload.github.com/ram02z/d2-filter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ram02z%2Fd2-filter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29717739,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T15:10:41.462Z","status":"ssl_error","status_checked_at":"2026-02-22T15:10:04.636Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["d2","pandoc","pandoc-filter"],"created_at":"2026-02-22T15:43:57.714Z","updated_at":"2026-02-22T15:43:58.206Z","avatar_url":"https://github.com/ram02z.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# d2-filter\n\n`d2-filter` is a pandoc filter that adds [D2](https://d2lang.com) syntax\ndiagrams in markdown documents.\n\n## Example\n\n```\n~~~{.d2 pad=20}\nx -\u003e y\n~~~\n```\n![Output](https://user-images.githubusercontent.com/59267627/230503069-51bb0a62-68ee-429a-84a8-b42342659268.png)\n\n## Usage \n\n```bash\n# Installation\nnpm i -g d2-filter\n\n# Unix\npandoc -F d2-filter test.md -o test.pdf\n# Windows\npandoc -F d2-filter.cmd test.md -o test.pdf\n```\n\nIf using with [Quarto](https://quarto.org/), you can use [quarto-d2](https://github.com/data-intuitive/quarto-d2) to avoid issues with pandoc filters.\n\n## Configuration\n\nUsing attributes of the fenced code block, you can specify:\n\n- Theme\n    - Example: `{.d2 theme=\"Grape soda\"}`.\n    - Default: `0` or `Neutral default`\n    - Values: Run `d2 themes` for possible options.\n- Layout engine\n    - Example: `{.d2 layout=elk}`.\n    - Default: `dagre`\n    - Values: Run `d2 layout` for possible options.\n- Image format\n    - Example: `{.d2 format=png}`\n    - Default: `svg`\n    - Values: `svg`, `png`, `pdf`\n- Sketch\n    - Example: `{.d2 sketch=true}`\n    - Default: `false`\n- Image padding\n    - Example: `{.d2 pad=0}`\n    - Default: `100`\n- Folder\n    - Example: `{.d2 folder=img}`\n    - Default: no folder as image is encoded to data URI on `img` tag\n- Filename\n    - Example: `{.d2 filename=\"test\"}`\n    - Default: `diagram-N`\n    - `folder` attribute is required to save file locally\n- Pandoc caption\n    - Example: `{.d2 caption=\"This is a test image\"}`\n    - Default: empty string\n- Pandoc image attributes\n    - Example: `{.d2 width=30 height=20px}`\n    - Default: empty array\n    - Values: See pandoc's [`link_attributes`](https://pandoc.org/MANUAL.html#extension-link_attributes) extension\n    - Note that `#id` and `.class` attributes are not supported, but any\n      key-value attributes should work\n\n## Credits\n\n- [mermaid-filter](https://github.com/raghur/mermaid-filter)\n- [mathjax-pandoc-filter](https://github.com/lierdakil/mathjax-pandoc-filter)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fram02z%2Fd2-filter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fram02z%2Fd2-filter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fram02z%2Fd2-filter/lists"}