1.0.1 • Published 7 years ago

uiflows-parser v1.0.1

Weekly downloads
9
License
MIT
Repository
github
Last release
7 years ago

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