ui-spec-mdのUI Flowsのコードブロックをパースする部分を抜き出したもの。
const uiflowsParser = require( 'uiflows-parser' );
const uiflowsStr = `
[what the user sees]
what they do
==> what they see next
[what they see next]
what they do next
`;
uiflowsParser(uiflowsStr);
digraph "" {
graph [ rankdir = "LR" ];
node [
fontsize = "16"
shape = "record"
tooltip = ""
];
edge [];
"node0" [
tooltip = ""
label = "
<port0> what the user sees
|
<port1> what they do
"
];
"node1" [
tooltip = ""
label = "
<port0> what they see next
|
<port1> what they do next
"
];
node0:port1 -> node1:port0;
}
would be to good pass the return to Viz.js.