Kroki plugin of remark.
npm install remark-kroki --save-dev
import readFileSync from 'fs';
import { remark } from 'remark';
import { remarkKroki } from 'remark-kroki';
const markdownText = readFileSync('example.md', 'utf8');
remark()
.use(remarkKroki, {
server: 'http://localhost:8000',
alias: ['plantuml']
})
.process(markdownText)
.then((file) => console.info(file))
.catch((error) => console.warn(error));
- type: string
- default: http://localhost:8000
Using self host server by default. Set https://kroki.io
to use free service.
- type: object
HTTP headers to send to the server for custom authentication.
- type: array
- example: ['plantuml']
Alias code language name to treat as kroki code block, meta.type will be ignored.
Turn
```kroki type=plantuml
A --> B
```
Into

Turn
```kroki type=plantuml alt=abc
A --> B
```
Into

```kroki type=plantuml
```
↓
```plantuml
```