Suggestion 1:
Don't write generators. Generic text editors are by far more powerful then request-response kind of programs.
Will you allow you users to return to previous item when they submit it? Will you allow to skip a couple of them? Will you allow users to correct their mistakes using search/replace? If you do that in generator, it will be way too complex. But text editors already can do any of this out of the box.
So just write a generic commented config file which people can just edit in their favorite text editor.
Suggestion 2:
Screw JSON.
This is an equivalent document written in YAML. By "equivalent" I mean it have exactly the same meaning (which you can check in https://nodeca.github.io/js-yaml/ ), but much shorter and it can be written by hand like I just did.
---
SiteName: My NodeJS Site
Look and Feel:
Theme: Business 1
Skin: Blue
Layout: 1H-3C-1F
Pages:
Home:
Region-1: &ACTIVE {Active: 'Yes'}
Region-2: *ACTIVE
Region-3: &INACTIVE {Active: 'No'}
Products:
Region-1: *ACTIVE
Region-2: *INACTIVE
Region-3: *INACTIVE
Services:
Region-1: *ACTIVE
Region-2: *ACTIVE
About Us:
Region-1: *ACTIVE
Region-2: *INACTIVE
Look and Feel:
Theme: Business 1
Skin: Blue
Layout: 1H-3C-1F
Pages:
Home:
Region-1: &ACTIVE {Active: 'Yes'}
Region-2: *ACTIVE
Region-3: &INACTIVE {Active: 'No'}
Products:
Region-1: *ACTIVE
Region-2: *INACTIVE
Region-3: *INACTIVE
Services:
Region-1: *ACTIVE
Region-2: *ACTIVE
About Us:
Region-1: *ACTIVE
Region-2: *INACTIVE
...
06.05.2014, 23:35, "Dino Lopez" <[email protected]>:
--I like to create a nodejs cli program that allow me to create a simple json configuration file.This configuration file will have the definition of the Application.{
"SiteName": "My NodeJS Site",
"Look and Feel": {
"Theme": "Business 1",
"Skin": "Blue",
"Layout": "1H-3C-1F"
},
"Pages": {"Home": {
"Region-1": {
"Acitve": "Yes"
},
"Region-2": {
"Active": "Yes"
},
"Region-3": {
"Active": "No"
}
},"Products": {
"Region-1": {
"Acitve": "Yes"
},
"Region-2": {
"Active": "No"
},
"Region-3": {
"Active": "No"
}
},
"Services": {
"Region-1": {
"Acitve": "Yes"
},
"Region-2": {
"Active": "Yes"
}
},
"About Us": {
"Region-1": {
"Acitve": "Yes"
},
"Region-2": {
"Active": "No"
}
}
}
}NOTE This JSON was created with: [ http://www.jsoneditoronline.org/ ]So basically, Like to have a cli program able to read the file and let me setup the configuration of the site, add ages, configure regions just like if I'm setting up objects and at the end save everything in a json format with later will be used to generate all the site.The regions will be feed data from another file where the text file can be stored or a reference to a dynamic List from a datase is called, perhaps some XML object /map or third party plugin.What would be the best recommendation to achieve this ?--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/515766be-8e15-4678-b869-fd18cefb94d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/2167761399445600%40web20g.yandex.ru.
For more options, visit https://groups.google.com/d/optout.
