{"id":17659719,"url":"https://github.com/tscpp/remark-mermaid-ssr","last_synced_at":"2025-03-30T10:43:56.004Z","repository":{"id":57679681,"uuid":"473703237","full_name":"tscpp/remark-mermaid-ssr","owner":"tscpp","description":"Mermaid plugin for remark with server side rendering","archived":false,"fork":false,"pushed_at":"2022-03-25T17:58:48.000Z","size":52,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-05T13:41:47.653Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/tscpp.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}},"created_at":"2022-03-24T17:15:43.000Z","updated_at":"2022-07-26T21:19:24.000Z","dependencies_parsed_at":"2022-09-14T11:31:52.605Z","dependency_job_id":null,"html_url":"https://github.com/tscpp/remark-mermaid-ssr","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/tscpp%2Fremark-mermaid-ssr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tscpp%2Fremark-mermaid-ssr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tscpp%2Fremark-mermaid-ssr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tscpp%2Fremark-mermaid-ssr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tscpp","download_url":"https://codeload.github.com/tscpp/remark-mermaid-ssr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246307929,"owners_count":20756478,"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-23T16:08:03.627Z","updated_at":"2025-03-30T10:43:55.970Z","avatar_url":"https://github.com/tscpp.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# remark-mermaid-ssr\n\nRemark plugin for rendering mermaid diagrams server-side. Installation is smoothly handled by this package; no other installations are required. Supports rendering of an additional dark mode SVGs.\n\nThis plugin uses puppeteer to launch a headless chromium browser instance to render diagrams using mermaidAPI. The codeblocks of mermaid diagrams are replaced with rendered SVGs.\n\n## Usage\n\nThe plugin is installed as any other remark plugin, see [unified's plugin documentation](https://github.com/unifiedjs/unified#plugin).\n\nDiagrams are written as codeblocks with the \"mermaid\" language.\n\n    ```mermaid\n    graph TD;\n        A--\u003eB;\n        A--\u003eC;\n        B--\u003eD;\n        C--\u003eD;\n    ```\n\n## Options\n\nThe options are **not** the same as the mermaid options. The options have been tweaked to be easier to specify. Options can always be overwritten with raw mermaid options by using the `__mermaid` and `__mermaid.__darkMode` options.\n\n### security\n```typescript\nsecurity?: 'strict' | 'loose' | 'antiscript' | 'sandbox' = 'strict'\n```\n\nSame as the mermaid option `securityLevel`. Serves as an option for the level of trust for the parsed diagram.\n\n- `'strict'`: tags in text are encoded, script functionality is disabled.\n- `'loose'`: tags in text are allowed, script functionality is enabled.\n- `'antiscript'`: html tags in text are allowed, only script elements are removed, script functionality is enabled.\n\n### theme\n```typescript\ntheme?: string | ThemeOptions = 'default'\n```\n\n#### theme\n```typescript\ntheme?: string = 'default'\n```\n\n#### customCss\n```typescript\ncustomCss?: string\n```\n\n#### variables\n```typescript\nvariables?: unknown\n```\n\n### renderDark\n```typescript\nrenderDark?: DarkOptions | boolean = false\n```\n\nEnables the additional rendering of dark mode. This will require you to define css rules for displaying the images. Rendered svgs will always (even if you have `renderDark` disabled) have either the classes `mermaid`, and `mermaid__light` or `mermaid__dark`.\n\n```css\n.mermaid.mermaid__light { display: initial; }\n.mermaid.mermaid__dark { display: none; }\n\n@media (prefers-color-scheme: dark) {\n  .mermaid.mermaid__light { display: none; }\n  .mermaid.mermaid__dark { display: initial; }\n}\n```\n\n### logLevel\n```typescript\nlogLevel?: LogLevel = LogLevel.Error\n```\n\n### flowchart\n```typescript\nflowchart?: FlowchartDiagramOptions\n```\n\nOptions for flowchart diagrams.\n\n### sequence\n```typescript\nsequence?: SequenceDiagramOptions\n```\n\nOptions for sequence diagrams.\n\n### gantt\n```typescript\ngantt?: GanttDiagramOptions\n```\n\nOptions for gantt diagrams.\n\n### journey\n```typescript\njourney?: JourneyDiagramOptions\n```\n\nOptions for journey diagrams.\n\n### pie\n```typescript\npie?: PieChartOptions\n```\n\nOptions for pie diagrams.\n\n### requirement\n```typescript\nrequirement?: RequirementDiagramOptions\n```\n\nOptions for requirement diagrams.\n\n### er\n```typescript\ner?: ErDiagramOptions\n```\n\nOptions for er diagrams.\n\n### git\n```typescript\ngit?: GitGraphOptions\n```\n\nOptions for git diagrams.\n\n### state\n```typescript\nstate?: StateDiagramOptions\n```\n\nOptions for state diagrams.\n\n### freeze\n```typescript\nfreeze?: (keyof Options)[]\n```\n\nKeys in options to freeze. Same as the mermaid option `secure`.\n\n### style\n```typescript\nstyle?: StyleOptions\n```\n\n#### fontFamily\n```typescript\nfontFamily?: string\n```\n\n#### maxTextSize\n```typescript\nmaxTextSize?: number\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftscpp%2Fremark-mermaid-ssr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftscpp%2Fremark-mermaid-ssr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftscpp%2Fremark-mermaid-ssr/lists"}