jonschlinkert / generator-docs

WIP
1 stars 0 forks source link

generator for phaser #1

Open jonschlinkert opened 10 years ago

jonschlinkert commented 10 years ago

@hariadi / @doowb just wanted to start some discussion on this generator. What would you want this generator to do?

Ideally I would love to have a generator that:

What are your thoughts/ideas on this?

doowb commented 10 years ago

I like this.

I think we could have scaffolds for common types of docs like grunt and gulp plugins (and other systems that are out there).

Are we able to inject text into an existing file? I'm thinking about a sub-generator that adds an options block to options.md... yo docs options foo and it would add it at the end of the file. I think it should be possible.

hariadi commented 10 years ago

:+1:

Detect what type of current project; grunt, gulp, yeoman, or general node and generate docs template base on choice.

jonschlinkert commented 10 years ago

Detect what type of current project; grunt, gulp, yeoman, or general node and generate docs template base on choice.

Great idea!

Are we able to inject text into an existing file?

It would be more reliable if we just generate a new document, foo.md, then let the user add {%= include("foo.md") %} where they want it to be inserted.

Also, I think the actual documents/templates should be in different node lib(s) so that we are maintaining the actual docs/templates separate from the generator logic. we can either group them into concepts, like "readme-templates", or we can keep all the docs in one separate repo, like "phaser-templates". it would probably be easier to maintain the latter. thoughts!

jonschlinkert commented 10 years ago

also, do you guys know of an existing generator, maybe from the yeoman core team, that we can use as a starting point for this? I think it's a little different than the generators we have.

jonschlinkert commented 10 years ago

Detect what type of current project; grunt, gulp, yeoman, or general node and generate docs template base on choice.

@hariadi I'm working on this generator now, I don't know the Yeoman API that well yet. Do you have suggestions for how I would copy a whole directory of files based on the user's choice? e.g. if the user chooses helper as the boilerplate, it would copy over a few files specific to helpers, etc.

I have the rest of it done...

jonschlinkert commented 10 years ago

wait, I think I recall seeing something on the yeoman API for copying an entire directory, I can look for that

hariadi commented 10 years ago

If you want interactive use, I think we can use https://github.com/yeoman/yo/ as a base.

$ yo docs
[?] What would you like to do?
  Install a docs
  Install assemble helpers
  Install assemble plugins
  Find some help
> Get me out of here!
jonschlinkert commented 10 years ago

:+1:

hariadi commented 10 years ago

this.directory('helpers', 'helpers');

jonschlinkert commented 10 years ago

thanks!