{"id":26743865,"url":"https://github.com/tylingsoft/markdown-it-mermaid","last_synced_at":"2025-04-14T18:51:59.657Z","repository":{"id":88513958,"uuid":"86912643","full_name":"tylingsoft/markdown-it-mermaid","owner":"tylingsoft","description":"Mermaid plugin for markdown-it.","archived":false,"fork":false,"pushed_at":"2018-12-27T05:23:56.000Z","size":168,"stargazers_count":43,"open_issues_count":5,"forks_count":45,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-28T07:16:39.041Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tylingsoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-04-01T12:43:02.000Z","updated_at":"2025-03-21T00:54:50.000Z","dependencies_parsed_at":"2023-06-12T10:15:28.385Z","dependency_job_id":null,"html_url":"https://github.com/tylingsoft/markdown-it-mermaid","commit_stats":{"total_commits":22,"total_committers":1,"mean_commits":22.0,"dds":0.0,"last_synced_commit":"2b6d6cdfc5c9a04c79a72a9276b1140e10ff868d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tylingsoft%2Fmarkdown-it-mermaid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tylingsoft%2Fmarkdown-it-mermaid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tylingsoft%2Fmarkdown-it-mermaid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tylingsoft%2Fmarkdown-it-mermaid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tylingsoft","download_url":"https://codeload.github.com/tylingsoft/markdown-it-mermaid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248512726,"owners_count":21116668,"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":"2025-03-28T07:16:42.773Z","updated_at":"2025-04-14T18:51:59.631Z","avatar_url":"https://github.com/tylingsoft.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# markdown-it-mermaid\n\nMermaid plugin for markdown-it.\n\n\n## Installation\n\n```\nyarn install markdown-it-mermaid\n```\n\n\n## Usage\n\n```js\nimport markdownIt from 'markdown-it'\nimport markdownItMermaid from 'markdown-it-mermaid'\nconst mdi = markdownIt()\nmdi.use(markdownItMermaid)\nmdi.render(`\\`\\`\\`mermaid\ngraph TD\n    A[Christmas] --\u003e|Get money| B(Go shopping)\n    B --\u003e C{Let me think}\n    C --\u003e|One| D[Laptop]\n    C --\u003e|Two| E[iPhone]\n    C --\u003e|Three| F[Car]\n\\`\\`\\``)\n```\n\n### Customize mermaid\n\n```js\nmdi.mermaid.loadPreferences({\n  get: key =\u003e {\n    if (key === 'mermaid-theme') {\n      return 'forest'\n    } else if (key === 'gantt-axis-format') {\n      return '%Y/%m/%d'\n    } else {\n      return undefined\n    }\n  }\n})\n```\n\nYou can `loadPreferences` from any preferences store as long as it supports the `get` method. For example, you can use `js-cookie` library as a preferences store. Or you can write your own preferences store to achieve more flexibility.\n\n`mdi.mermaid.loadPreferences` not only applies the preferences, it also return the preferences loaded. Just in case you need to access the loaded preferences.\n\n`mdi.mermaid.loadPreferences` could be invoked multiple times. And the preferences applied later will override ones applied earlier.\n\n\n## Development\n\n### Build\n\n```\nyarn build:watch\n```\n\n### Test\n\n```\nyarn test\n```\n\n### Distribution\n\n```\nyarn release \u0026\u0026 npm publish\n```\n\n\n## Todo\n\n`gantt-axis-format` should support large date ranges\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftylingsoft%2Fmarkdown-it-mermaid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftylingsoft%2Fmarkdown-it-mermaid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftylingsoft%2Fmarkdown-it-mermaid/lists"}