@riebeckite/plugin-plantuml 0.0.21 → 0.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # @riebeckite/plugin-plantuml
2
2
 
3
+ <!-- Generated from docs/docs/plugins/plantuml.md. Edit the canonical documentation in docs/docs/plugins and run `pnpm docs:sync`. -->
4
+
3
5
  PlantUML diagram rendering for ` ```plantuml ` code blocks. Diagrams are turned into
4
6
  a PlantUML server image URL at build time; the build itself never talks to the
5
7
  network and no client JavaScript is shipped.
@@ -20,29 +22,35 @@ export default defineConfig({
20
22
 
21
23
  `plantuml` is also exported under the alias `plantumlPlugin`.
22
24
 
23
- ## Behavior
24
-
25
- Each ` ```plantuml ` code block is replaced with a `figure.rb-plantuml` whose
26
- diagram is an `<img>` pointing at the PlantUML server.
27
-
28
- ```html
29
- <figure class="rb-plantuml" data-plantuml data-plantuml-marker="..." data-plantuml-source="...">
30
- <div class="rb-plantuml__frame">
31
- <img class="rb-plantuml__image" src="https://www.plantuml.com/plantuml/svg/..." alt="..." loading="lazy" />
32
- </div>
33
- <details class="rb-plantuml__fallback">
34
- <summary>Diagram source</summary>
35
- <pre><code>...</code></pre>
36
- </details>
37
- <figcaption class="rb-plantuml__caption">...</figcaption>
38
- </figure>
25
+ ## Live example
26
+
27
+ Each ` ```plantuml ` code block is rendered as a diagram on this page.
28
+
29
+ #### Source
30
+
31
+ ````md
32
+ ```plantuml
33
+ @startuml
34
+ Alice -> Bob: Hello
35
+ Bob --> Alice: Hi
36
+ @enduml
39
37
  ```
38
+ ````
40
39
 
41
- The caption comes from the code block `title` or from a `%% caption: ...` line in
42
- the source. Because `%%` is not PlantUML comment syntax, the `%% caption:` line is
43
- removed from the diagram source before it is encoded. When there is no caption,
44
- the `<img>` alternative text is `PlantUML diagram`. With `fallback` enabled the
45
- original PlantUML source is kept in a collapsible `<details>` element.
40
+ #### Rendered
41
+
42
+ ```plantuml
43
+ @startuml
44
+ Alice -> Bob: Hello
45
+ Bob --> Alice: Hi
46
+ @enduml
47
+ ```
48
+
49
+ The caption comes from the code block `title` or from a `%% caption: ...` line
50
+ in the source. Because `%%` is not PlantUML comment syntax, the `%% caption:`
51
+ line is removed from the diagram source before it is encoded. When there is no
52
+ caption, the image alternative text is `PlantUML diagram`. With `fallback`
53
+ enabled the original PlantUML source is kept in a collapsible details element.
46
54
 
47
55
  ## URL encoding
48
56
 
@@ -97,5 +105,4 @@ Encoding failures are reported with `file.message(...)`. Diagnostics use
97
105
 
98
106
  ## See also
99
107
 
100
- - [Plugin guide](../../../docs/docs/reference/plugin-api.md)
101
-
108
+ - [Plugin guide](https://github.com/Rerurate514/riebeckite/blob/main/docs/docs/reference/plugin-api.md)
package/README_ja.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # @riebeckite/plugin-plantuml
2
2
 
3
+ <!-- Generated from docs/docs/plugins/plantuml.ja.md. Edit the canonical documentation in docs/docs/plugins and run `pnpm docs:sync`. -->
4
+
3
5
  `plantuml` コードブロックを PlantUML の図として表示するプラグインです。ビルド時に PlantUML サーバーの画像 URL を組み立てるだけで、ビルド中にネットワークへアクセスしません。クライアント用の JavaScript も配布しません。
4
6
 
5
7
  [English](./README.md)
@@ -18,24 +20,35 @@ export default defineConfig({
18
20
 
19
21
  `plantuml` は `plantumlPlugin` という別名でもエクスポートしています。
20
22
 
21
- ## どのように描画されるか
22
-
23
- ` ```plantuml ` のコードブロックは `figure.rb-plantuml` に置き換わります。図そのものは `<img>` で、PlantUML サーバーが返す画像を指します。
24
-
25
- ```html
26
- <figure class="rb-plantuml" data-plantuml data-plantuml-marker="..." data-plantuml-source="...">
27
- <div class="rb-plantuml__frame">
28
- <img class="rb-plantuml__image" src="https://www.plantuml.com/plantuml/svg/..." alt="..." loading="lazy" />
29
- </div>
30
- <details class="rb-plantuml__fallback">
31
- <summary>Diagram source</summary>
32
- <pre><code>...</code></pre>
33
- </details>
34
- <figcaption class="rb-plantuml__caption">...</figcaption>
35
- </figure>
23
+ ## 実行例
24
+
25
+ ` ```plantuml ` のコードブロックは、このページ上で図として実際に描画されます。
26
+
27
+ #### ソース
28
+
29
+ ````md
30
+ ```plantuml
31
+ @startuml
32
+ Alice -> Bob: Hello
33
+ Bob --> Alice: Hi
34
+ @enduml
36
35
  ```
36
+ ````
37
37
 
38
- キャプションはコードブロックの `title`、またはソース中の `%% caption: ...` 行から取得します。`%%` は PlantUML のコメント記法ではないため、`%% caption:` 行は図のソースから取り除いてからエンコードします。キャプションがない場合、`<img>` の代替テキストは `PlantUML diagram` になります。`fallback` を有効にすると、元の PlantUML ソースを折りたたみ表示で残します。
38
+ #### 実行例
39
+
40
+ ```plantuml
41
+ @startuml
42
+ Alice -> Bob: Hello
43
+ Bob --> Alice: Hi
44
+ @enduml
45
+ ```
46
+
47
+ キャプションはコードブロックの `title`、またはソース中の `%% caption: ...` 行から取得
48
+ します。`%%` は PlantUML のコメント記法ではないため、`%% caption:` 行は図のソースから
49
+ 取り除いてからエンコードします。キャプションがない場合、画像の代替テキストは
50
+ `PlantUML diagram` になります。`fallback` を有効にすると、元の PlantUML ソースを
51
+ 折りたたみ表示で残します。
39
52
 
40
53
  ## URL のエンコード
41
54
 
@@ -78,5 +91,4 @@ export default defineConfig({
78
91
 
79
92
  ## 関連資料
80
93
 
81
- - [プラグインシステム](../../../docs/docs/reference/plugin-api.ja.md)
82
-
94
+ - [プラグインシステム](https://github.com/Rerurate514/riebeckite/blob/main/docs/docs/reference/plugin-api.ja.md)
package/dist/index.js CHANGED
@@ -264,7 +264,9 @@ function plantuml(options = {}) {
264
264
  extendHtmlPipeline: (pipeline) => {
265
265
  pipeline.use(rehypePlantumlLazy, options);
266
266
  },
267
- assets: [createStyleAsset("plantuml")]
267
+ assets: [
268
+ createStyleAsset("plantuml", "@riebeckite/plugin-plantuml/style.css")
269
+ ]
268
270
  });
269
271
  }
270
272
  var plantumlPlugin = plantuml;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riebeckite/plugin-plantuml",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -15,7 +15,7 @@
15
15
  "./style.css": "./style.css"
16
16
  },
17
17
  "dependencies": {
18
- "@riebeckite/core": "0.0.21"
18
+ "@riebeckite/core": "0.0.23"
19
19
  },
20
20
  "publishConfig": {
21
21
  "access": "public"