履歴: ソフトウェア/pukiwiki/uml.inc.php
各行は、その日時に書かれた内容です。追加・削除は、1 つ前の版との行数の差です (全 11 版)。「差分」は比較する版、「基準」は比べる相手の版を選びます
| 日時 | タイトル | 文字数 | 追加 | 削除 | 内容 | 差分 | 基準 |
|---|---|---|---|---|---|---|---|
| 2023/6/26 15:42:39 | ソフトウェア/pukiwiki/uml.inc.php 最新版 | 8,013 | +1 | -29 | 表示 | 差分 | — |
| 2023/6/26 15:42:39 | ソフトウェア/pukiwiki/uml.inc.php | 8,952 | +1 | -1 | 表示 | 差分 | 選択 |
| 2023/6/23 5:02:03 | ソフトウェア/pukiwiki/uml.inc.php | 8,618 | +14 | -0 | 表示 | 差分 | 選択 |
| 2016/7/1 14:17:25 | ソフトウェア/pukiwiki/uml.inc.php | 8,347 | +3 | -0 | 表示 | 差分 | 選択 |
| 2016/7/1 14:17:25 | ソフトウェア/pukiwiki/uml.inc.php | 8,256 | +1 | -1 | 表示 | 差分 | 選択 |
| 2016/7/1 14:17:25 | ソフトウェア/pukiwiki/uml.inc.php | 8,252 | +2 | -1 | 表示 | 差分 | 選択 |
| 2016/7/1 14:17:25 | ソフトウェア/pukiwiki/uml.inc.php | 8,165 | +16 | -0 | 表示 | 差分 | 選択 |
| 2016/2/19 10:49:07 | ソフトウェア/pukiwiki/uml.inc.php | 7,797 | +263 | -14 | 表示 | 差分 | 選択 |
| 2016/2/19 8:45:33 | ソフトウェア/pukiwiki/uml.inc.php | 3,728 | +74 | -28 | 表示 | 差分 | 選択 |
| 2016/2/19 3:01:56 | ソフトウェア/pukiwiki/uml.inc.php | 2,876 | +118 | -1 | 表示 | 表示中 | 選択 |
| 2016/2/18 15:24:17 | ソフトウェア/pukiwiki/uml.inc.php | 273 | — | — | 表示 | — | 基準 |
基準: ソフトウェア/pukiwiki/uml.inc.php (2016/2/18 15:24:17) → 比較: ソフトウェア/pukiwiki/uml.inc.php (2016/2/19 3:01:56)
@@ -1,7 +1,24 @@
[[公開メモ]]
-* UML を貼りたい [#w0b69192]
+* UML を貼るためのプラグインです [#w0b69192]
+このように書くと、
+
+ ¨(
+ [*] -> idle
+ idle: rready = 1
+ idle: rvalid = 0
+ idle --> reading : arvalid & \narready
+ reading: rready = 0
+ reading: rvalid = 0
+ reading -right--> sending : read done
+ sending: rready = 0
+ sending: rvalid = 1
+ sending --> idle : rready
+ );
+
+こう表示されます。
+
¨(
[*] -> idle
idle: rready = 1
@@ -14,3 +31,103 @@
sending: rvalid = 1
sending --> idle : rready
);
+
+* PlantUML を利用させていただきました [#yde90f7f]
+
+http://ja.plantuml.com/
+
+/usr/local/bin に plantuml.jar を置いてあります。
+
+* ソースファイル [#s0919acf]
+
+plugin/uml.inc.php
+
+ LANG:php
+ <?php
+
+ function plantuml($source)
+ {
+ $tmp = tempnam("/tmp", "plantuml");
+
+ $source = <<<"EOS"
+ @startuml
+ skinparam defaultFontName arial,helvetica,MS Gothic
+ skinparam state {
+ FontStyle bold
+ }
+ $source
+ @enduml
+ EOS;
+
+ $handle = fopen($tmp, "w");
+ fwrite($handle, preg_replace("/\\r?\\n/","\r\n",$source));
+ fclose($handle);
+ system("/usr/bin/java -Dfile.encoding=utf-8 -jar /usr/local/bin/plantuml.jar ".$tmp." -tsvg");
+ unlink($tmp);
+
+ $svg = file_get_contents($tmp.".svg");
+ unlink($tmp.".svg");
+
+ return preg_replace('/^<\\?xml.*?>/', '', $svg);
+ }
+
+ function plantuml_convert($source)
+ {
+ $image_base = sha1($source);
+ $image_dir = "uml_img/{$image_base[0]}/{$image_base[1]}";
+ $image_svg = "{$image_dir}/{$image_base}.svg";
+
+ if(!file_exists($image_svg)) {
+ $svg = plantuml($source);
+
+ if (mb_substr($svg,0,4)=="<svg") {
+ if(!file_exists($image_dir)){
+ mkdir($image_dir, 0770, true);
+ }
+ $fh = fopen($image_svg, "w");
+ fwrite($fh, $svg);
+ fclose($fh);
+ }
+ } else {
+ $svg = file_get_contents($image_svg);
+ }
+
+ return $svg;
+ }
+
+ function plugin_uml_inline()
+ {
+ $aryargs = func_get_args();
+ $source = join(",", $aryargs);
+ $source = rtrim($source, ","); //remove extra comma at the end.
+ $source = str_replace("<br>", "\n",$source);
+ return plantuml_convert($source);
+ }
+
+ ?>
+
+* pukiwiki.php の改造 [#na6a8784]
+
+複数行のパラメータを渡せるように、次のように改造しました。
+
+ LANG:php
+ // $body = convert_html(get_source($base));
+
+ for($i=0;$i<count($lines);$i++)
+ if (preg_match('/\¨\(/', $lines[$i]) && $lines[$i][0]!=' ')
+ while(!preg_match('/\¨\(.*?\)\;/', $lines[$i]) && ($i+1<count($lines)))
+ array_splice($lines, $i, 2, chop($lines[$i]) . '<br>' . $lines[$i+1] );
+
+ $body = convert_html($lines);
+
+* plantuml のソースコードを簡単に書くには [#r1ff6881]
+
+こちらが参考になりそうです。
+
+Qiita - AtomとPlantUMLで爆速UMLモデリング~
+http://qiita.com/nakahashi/items/3d88655f055ca6a2617c
+
+
+* 質問・コメント [#y0f6fa29]
+
+#article_kcaptcha