Skip to content

Latest commit

 

History

History
89 lines (50 loc) · 1.43 KB

README.md

File metadata and controls

89 lines (50 loc) · 1.43 KB

uiflows-parser

ui-spec-mdのUI Flowsのコードブロックをパースする部分を抜き出したもの。

Usage

want this

uiflows-sample

sample script

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);

the return (dot lang)

	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.

Other examples