{"id":25127644,"url":"https://github.com/prinorange/remark-embed-plantuml","last_synced_at":"2026-02-11T22:05:37.601Z","repository":{"id":276105568,"uuid":"928174041","full_name":"PrinOrange/remark-embed-plantuml","owner":"PrinOrange","description":"A remark plugin that allows you render the PlantUML in the markdown document. This package has integrated JRE and it will execute PlantUML callings automatically, it realized out-of-the-box use.","archived":false,"fork":false,"pushed_at":"2025-02-08T05:42:47.000Z","size":10895,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T01:19:28.967Z","etag":null,"topics":["markdown","mdast","mdx","plantuml","remark","remark-plugin","unified"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/remark-embed-plantuml","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/PrinOrange.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":"2025-02-06T07:28:28.000Z","updated_at":"2025-02-08T05:42:50.000Z","dependencies_parsed_at":"2025-02-07T14:38:16.419Z","dependency_job_id":"5b8973f7-e67a-4e38-b9f2-53c51112dda5","html_url":"https://github.com/PrinOrange/remark-embed-plantuml","commit_stats":null,"previous_names":["prinorange/remark-plantuml","prinorange/remark-embed-plantuml"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrinOrange%2Fremark-embed-plantuml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrinOrange%2Fremark-embed-plantuml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrinOrange%2Fremark-embed-plantuml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PrinOrange%2Fremark-embed-plantuml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PrinOrange","download_url":"https://codeload.github.com/PrinOrange/remark-embed-plantuml/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250452543,"owners_count":21433039,"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":["markdown","mdast","mdx","plantuml","remark","remark-plugin","unified"],"created_at":"2025-02-08T11:17:38.574Z","updated_at":"2026-02-11T22:05:37.568Z","avatar_url":"https://github.com/PrinOrange.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Remark Embed PlantUML\n\n[![Downloads][downloads-badge]][downloads]\n[![Size][size-badge]][size]\n\n\u003e ⚠ **NOTE:** This package is in the early stages of development and requires user feedback and further investigation. If you encounter any issues, please [submit an issue](https://github.com/PrinOrange/remark-embed-plantuml/issues).\n\nThis is a **Remark** plugin that allows you to embed **PlantUML** diagrams directly in your markdown documents. It scans all **PlantUML** code blocks in the markdown file and converts them into **Base64-encoded** images locally.\n\nPlantUML requires a **Java Runtime Environment (JRE)**, but you do **not** need to install it manually. This package includes an integrated JRE and automatically executes PlantUML commands, making it easy to use out of the box.\n\n\u003e **Note:** Since this package includes a bundled Java JRE and PlantUML JAR file, it is only compatible with a **Node.js** environment. It will not work in **browsers** or **Electron render processes**. Additionally, because building tools like **Webpack** and **Vite** cannot recognize Java binaries, this package will not function properly if bundled into a project. That means you can not use this in Next.js client-side code or other most of frontend integration frameworks as far. But we are trying to work out this problem now.\n\n## Installation\n\nInstall this package using npm:\n\n```bash\nnpm install remark-embed-plantuml\n```\n\n## Usage\n\nConsider the following markdown file:\n\n```plaintext\n# Hello, PlantUML\n\nHere is a simple PlantUML diagram:\n\n\\`\\`\\`plantuml\n@startuml\nAlice -\u003e Bob: test\n@enduml\n\\`\\`\\`\n```\n\nNow, integrate this plugin into your code:\n\n```javascript\nimport remarkEmbedPlantUml from 'remark-embed-plantuml';\nimport remarkParse from 'remark-parse';\nimport remarkStringify from 'remark-stringify';\nimport {unified} from 'unified';\nimport {readFile} from 'node:fs/promises';\n\n(async () =\u003e {\n  const processor = unified()\n    .use(remarkParse)\n    .use(remarkEmbedPlantUml, {format: 'png', stdrpt: 2, darkmode: true})\n    .use(remarkStringify);\n\n  const transformed = await processor.process(await readFile('doc.md'));\n  console.log(transformed.toString());\n})();\n```\n\n### Output:\n\n```markdown\n# Hello, PlantUML\n\nHere is a simple PlantUML diagram:\n\n![PlantUML Diagram](data:image/png;base64,xxxxxxxxxx....)\n```\n\n## API\n\nThis package is **ESM-only** and provides a default export: `remarkEmbedPlantUML`. You can integrate it with **unified.js**.\n\n### `unified().use(remarkEmbedPlantUML, options?)`\n\nThis plugin supports [PlantUML command-line arguments](https://plantuml.com/en/command-line) and executes **PlantUML** via a CLI pipe.\n\n### Options\n\n#### `format?: 'png' | 'svg'`\n\nSpecifies the output format. Defaults to `'png'`. Only `'svg'` and `'png'` are supported. The result is embedded as a **Base64-encoded** image.\n\n#### `theme?: string`\n\nSpecifies the **theme** for the diagram. See the [official theme documentation](https://plantuml.com/en/theme) for available options.\n\n#### `darkmode?: boolean`\n\nEnables **dark mode** for diagrams.\n\n#### `stdrpt?: '' | 1 | 2`\n\nControls the error output format using the `-stdrpt` option. See [PlantUML command-line documentation](https://plantuml.com/en/command-line) for details.\n\n#### `verbose?: boolean`\n\nEnables logging output.\n\n#### `quiet?: boolean`\n\nSuppresses error messages in the console.\n\n#### `timeout?: number`\n\nSets the **processing timeout** in seconds. Defaults to **900 seconds (15 minutes)**.\n\nIf you need support for additional arguments, [submit an issue](https://github.com/PrinOrange/remark-plantuml) to request it.\n\n## Compatibility\n\nThis package requires **Node.js 18** or later.\n\n- **Bundled JRE Version:** 17.0.14+7\n- **PlantUML Version:** 1.2025.0\n\n## Related Projects\n\n- [PlantUML](https://github.com/plantuml/plantuml)\n\n## Contributing\n\nTest fixtures are generated and verified using **Linux**. Rendering results may slightly differ across platforms. If adding new test cases, don’t modify existing ones that cause CI failures. For general contribution guidelines, see [CONTRIBUTING.md](./CONTRIBUTION.MD).\n\n## License\n\n[MIT](./LICENSE.MD) © [但为君故](https://github.com/PrinOrange)\n\n\u003c!-- Definitions --\u003e\n\n[downloads-badge]: https://img.shields.io/npm/dm/remark-embed-plantuml.svg\n[downloads]: https://www.npmjs.com/package/remark-embed-plantuml\n[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size\u0026query=$.size.compressedSize\u0026url=https://deno.bundlejs.com/?q=remark-embed-plantuml\n[size]: https://bundlejs.com/?q=remark-embed-plantuml\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprinorange%2Fremark-embed-plantuml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprinorange%2Fremark-embed-plantuml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprinorange%2Fremark-embed-plantuml/lists"}