6. Document

In the stasc repository, there are two scripts to help documentation.

Sxout.js

Sxout.js reads JSON object in the last comment before the script and insert it as a stasc graft just before the scrept. "nodeType" is taken as name of factory function to create the dom object. Other properties are passed to the dom object unless the value is an array. Elements of array are added to the property by using addChildElement().
You can use Sxout.js in document for end users like HowToPlay.html. It is convenient also when you need to check how it looks without running your code, which takes time in some cases such as screen shown when the game is over.

Sxin.js

Sxin.js reads JSON object in the same way as Sxout.js and present the tree as nested boxes.
Sxout.js and Sxin.js can share JSON object. Such a pair illustrates one possible usage of your graft factory function. You can explain your design by listing suggestive cases like ViewRecipes.html.
<< >>