Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
177a14e
commit 3551afb
Showing
19 changed files
with
2,659 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
"markdownit", | ||
"mdit", | ||
"mhchem", | ||
"plantuml", | ||
"softbreak", | ||
"tasklist", | ||
"treeshake", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
--- | ||
title: "@mdit/plugin-plantuml" | ||
icon: context | ||
--- | ||
|
||
Plugin to support plant uml base on [@mdit/plugin-uml](uml.md). | ||
|
||
<!-- more --> | ||
|
||
## Usage | ||
|
||
::: code-tabs#language | ||
|
||
@tab TS | ||
|
||
```ts | ||
import MarkdownIt from "markdown-it"; | ||
import { plantuml } from "@mdit/plugin-plantuml"; | ||
|
||
const mdIt = MarkdownIt().use(plantuml); | ||
|
||
mdIt.render(`\ | ||
@startuml | ||
Bob -> Alice : hello | ||
@enduml | ||
`); | ||
``` | ||
|
||
@tab JS | ||
|
||
```js | ||
const MarkdownIt = require("markdown-it"); | ||
const { plantuml } = require("@mdit/plugin-plantuml"); | ||
|
||
const mdIt = MarkdownIt().use(plantuml); | ||
|
||
mdIt.render(`\ | ||
@startuml | ||
Bob -> Alice : hello | ||
@enduml | ||
`); | ||
``` | ||
|
||
::: | ||
|
||
## Demo | ||
|
||
::: md-demo demo | ||
|
||
@startuml | ||
Bob -> Alice : hello | ||
@enduml | ||
|
||
::: | ||
|
||
## Options | ||
|
||
```ts | ||
interface MarkdownItPlantumlOptions { | ||
/** | ||
* Plantuml parse type | ||
* | ||
* @default "uml" | ||
*/ | ||
type?: "uml" | "fence"; | ||
|
||
/** | ||
* diagram type | ||
* | ||
* @description Only available when using default srcGetter | ||
* | ||
* @default "uml" | ||
*/ | ||
name?: string; | ||
|
||
/** | ||
* Fence info | ||
* | ||
* @default name | ||
*/ | ||
fence?: string; | ||
|
||
/** | ||
* Opening marker | ||
* | ||
* @description only available with type "uml" | ||
* | ||
* @default "start" + name | ||
*/ | ||
open?: string; | ||
|
||
/** | ||
* Closing marker | ||
* | ||
* @description only available with type "uml" | ||
*/ | ||
close?: string; | ||
|
||
/** | ||
* Plantuml server | ||
* | ||
* @description Only available when using default srcGetter | ||
* | ||
* @default "https://www.plantuml.com/plantuml" | ||
*/ | ||
server?: string; | ||
|
||
/** | ||
* Image format | ||
* | ||
* @description Only available when using default srcGetter | ||
* | ||
* @default "svg" | ||
*/ | ||
format?: string; | ||
|
||
/** | ||
* Image src getter | ||
* | ||
* @param content diagram content | ||
* @returns image link | ||
*/ | ||
srcGetter?: (content: string) => string; | ||
|
||
/** | ||
* Diagram renderer | ||
*/ | ||
render?: RenderRule; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.