Skip to content

Parse a string of uiflows lang, return the string dot lang.

License

Notifications You must be signed in to change notification settings

pxgrid/uiflows-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Parse a string of uiflows lang, return the string dot lang.

Resources

License

Stars

Watchers

Forks

Packages

No packages published