Skip to content
This repository has been archived by the owner on Apr 4, 2018. It is now read-only.

Tool for converting smart answers to smartdown (experimental)

Notifications You must be signed in to change notification settings

alphagov/smartanswer-to-smartdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smartanswer to smartdown converter

This is an experimental (work-in-progress) tool for converting smartanswers into smartdown.

In works by parsing the ruby code of the smart-answer flow, building a model of it and then generating the equivalent smartdown.

Note that it only works with the 'new-style' next node rules in smart answers defined using the next_node_if and on_condition methods. Some smart answers have not yet been converted to this new style, although a rough pass at this was made on the static-next-node-all branch.

To run the converter:

$ ./bin/smartanswer-to-smartdown ../smart-answers/lib/flows/student-finance-forms.rb student-finance-forms-smartdown

This will create a new folder named student-finance-forms-smartdown containing the smartdown files.

Known issues/limitations

currently silently ignores next_node statements, even unconditional ones. These are sometimes used in 'new-style' smartanswers to declare the 'default' in a sequence of rules. To fix this, you'd need to add a new transform to NextNodeRulesTransform.

Not all permutations of phrase lists are handled.

About

Tool for converting smart answers to smartdown (experimental)

Topics

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages