Make a Yeoman generator #185

Closed
HugoGiraudel opened this Issue Aug 24, 2014 · 13 comments

Comments

Projects
None yet
2 participants
@HugoGiraudel
Member

HugoGiraudel commented Aug 24, 2014

  • Create a repository for the generator
  • Ask where to make the theme (would be handy with path autocompletetion, but I think this supplement will be only for Yeoman if it supports it) (defaults to CWD).
  • Ask to choose a template engine (defaults to something opinionated, but I'm not opinionated enough in JS template engines, mostly since I meet all these bugs bith my beloved Swig).
  • Ask whether to use sassdoc-indexer and sassdoc-filter (defaults to both).
  • Ask to use Grunt, Gulp (others?) or nothing.
    • Ask for tasks to create (SCSS compilation, CSS, JS and images minification).
  • Create assets/{css,img,js} and views folders.
    • Example CSS and JS files.
    • Example template according to the choosen template engine.
  • Create a package.json with Themeleon and template engine mixin dependencies, sassdoc-indexer and sassdoc-filter if selected.
  • Create the index.js using filter and indexer like sassdoc-theme-light if selected, and rendering the index.* according to the choosen template engine. The index.* needs also to be different if there is the filter and the indexer... because the structure won't be the same.
  • Create the Grunt/Gulp/whatever file with configured tasks.
@pascalduez

This comment has been minimized.

Show comment
Hide comment
@pascalduez

pascalduez Sep 3, 2014

Member

So here we are, we have a starting point. It's all on the develop branch of the repo.
I don't want to publish it at that stage.

What I still have to do:

  • The Grunt/Gulp file/tasks thing
  • Convert the different engines syntax intemplates (only a copy paste from theme-blank for now)

What I'm not sure about:

  • The different path option, other than CWD. This might be confusing and bring some troubles.
    It would be okay if this dir is a child of CWD, but this is not of much use for our theme scope.

What I would like your help on:

  • Templates declinations based on the result of useFilter or useIndexer.
    Basically there are four different files, and only one is being copied depending on the user input.
  • Testing
  • Reviewing

Let's coordinate on IRC @HugoGiraudel @valeriangalliat

Member

pascalduez commented Sep 3, 2014

So here we are, we have a starting point. It's all on the develop branch of the repo.
I don't want to publish it at that stage.

What I still have to do:

  • The Grunt/Gulp file/tasks thing
  • Convert the different engines syntax intemplates (only a copy paste from theme-blank for now)

What I'm not sure about:

  • The different path option, other than CWD. This might be confusing and bring some troubles.
    It would be okay if this dir is a child of CWD, but this is not of much use for our theme scope.

What I would like your help on:

  • Templates declinations based on the result of useFilter or useIndexer.
    Basically there are four different files, and only one is being copied depending on the user input.
  • Testing
  • Reviewing

Let's coordinate on IRC @HugoGiraudel @valeriangalliat

@pascalduez

This comment has been minimized.

Show comment
Hide comment
@HugoGiraudel

This comment has been minimized.

Show comment
Hide comment
@HugoGiraudel

HugoGiraudel Sep 3, 2014

Member

Templates declinations based on the result of useFilter or useIndexer.
Basically there are four different files, and only one is being copied depending on the user input.

I'll see if I can help.

When using sassdoc-filter for instance, do you use everything? Markdown? Groups? Etc.?

Member

HugoGiraudel commented Sep 3, 2014

Templates declinations based on the result of useFilter or useIndexer.
Basically there are four different files, and only one is being copied depending on the user input.

I'll see if I can help.

When using sassdoc-filter for instance, do you use everything? Markdown? Groups? Etc.?

@HugoGiraudel

This comment has been minimized.

Show comment
Hide comment
@HugoGiraudel

HugoGiraudel Sep 3, 2014

Member

The different path option, other than CWD. This might be confusing and bring some troubles.
It would be okay if this dir is a child of CWD, but this is not of much use for our theme scope.

@valeriangalliat is the path master. He'll know.

Member

HugoGiraudel commented Sep 3, 2014

The different path option, other than CWD. This might be confusing and bring some troubles.
It would be okay if this dir is a child of CWD, but this is not of much use for our theme scope.

@valeriangalliat is the path master. He'll know.

@pascalduez

This comment has been minimized.

Show comment
Hide comment
@pascalduez

pascalduez Sep 3, 2014

Member

@valeriangalliat is the path master. He'll know.

It's not about if it's possible (it is), it's about whether it's relevant/needed.

Member

pascalduez commented Sep 3, 2014

@valeriangalliat is the path master. He'll know.

It's not about if it's possible (it is), it's about whether it's relevant/needed.

@pascalduez

This comment has been minimized.

Show comment
Hide comment
@pascalduez

pascalduez Sep 3, 2014

Member

When using sassdoc-filter for instance, do you use everything? Markdown? Groups? Etc.?

Yes, at the moment it's one block.
If we want more granularity, then we need to introduce more questions in the prompt. (and even more templates ?)
Do we want this ?

Member

pascalduez commented Sep 3, 2014

When using sassdoc-filter for instance, do you use everything? Markdown? Groups? Etc.?

Yes, at the moment it's one block.
If we want more granularity, then we need to introduce more questions in the prompt. (and even more templates ?)
Do we want this ?

@HugoGiraudel

This comment has been minimized.

Show comment
Hide comment
@HugoGiraudel

HugoGiraudel Sep 4, 2014

Member

Do we want this ?

No. By the way, since we are outputing a blank theme, I think the different views will be very easy to do. Basically only the comments will change.

Member

HugoGiraudel commented Sep 4, 2014

Do we want this ?

No. By the way, since we are outputing a blank theme, I think the different views will be very easy to do. Basically only the comments will change.

@pascalduez

This comment has been minimized.

Show comment
Hide comment
@pascalduez

pascalduez Sep 4, 2014

Member

By the way, since we are outputing a blank theme, I think the different views will be very easy to do. Basically only the comments will change.

Yes, not too much hassle.
Also the object properties might be different ? (Markdown, not markdown, groups, etc)

Member

pascalduez commented Sep 4, 2014

By the way, since we are outputing a blank theme, I think the different views will be very easy to do. Basically only the comments will change.

Yes, not too much hassle.
Also the object properties might be different ? (Markdown, not markdown, groups, etc)

@HugoGiraudel

This comment has been minimized.

Show comment
Hide comment
@HugoGiraudel

HugoGiraudel Sep 4, 2014

Member

Also the object properties might be different ? (Markdown, not markdown, groups, etc)

Not really. The only thing is you won't have a data.groups, and you won't have a html* keys.

Member

HugoGiraudel commented Sep 4, 2014

Also the object properties might be different ? (Markdown, not markdown, groups, etc)

Not really. The only thing is you won't have a data.groups, and you won't have a html* keys.

@pascalduez

This comment has been minimized.

Show comment
Hide comment
@pascalduez

pascalduez Sep 4, 2014

Member

Not really. The only thing is you won't have a data.groups, and you won't have a html* keys.

Yep, that's what I meant. Not much, indeed.

Maybe you could make it for Swig ? Which would serve as a reference for the other engines.

I'll start converting the index.swig to other engines as well, as it is pretty stable (since extracted from sassdoc-theme-blank).

Member

pascalduez commented Sep 4, 2014

Not really. The only thing is you won't have a data.groups, and you won't have a html* keys.

Yep, that's what I meant. Not much, indeed.

Maybe you could make it for Swig ? Which would serve as a reference for the other engines.

I'll start converting the index.swig to other engines as well, as it is pretty stable (since extracted from sassdoc-theme-blank).

@HugoGiraudel

This comment has been minimized.

Show comment
Hide comment
@HugoGiraudel

HugoGiraudel Sep 4, 2014

Member

Should we consider making the theme folder the first question in order to force the user to manually create it?

$ Name of your theme:
$ > my-theme
$ Folder `my-theme` generated.
my-theme $
Member

HugoGiraudel commented Sep 4, 2014

Should we consider making the theme folder the first question in order to force the user to manually create it?

$ Name of your theme:
$ > my-theme
$ Folder `my-theme` generated.
my-theme $
@pascalduez

This comment has been minimized.

Show comment
Hide comment
@pascalduez

pascalduez Sep 4, 2014

Member

The default and common behavior for generators is to work from inside the destination directory:
https://github.com/SassDoc/generator-sassdoc-theme/blob/develop/README.md#usage
So you basically have to mkdir your theme folder before running the generator.

So I wouldn't make it a prompt and then trying to chdir in it.

The way to do it in Yeoman is to use the dest property.

If being able to pass a different dir is really something that you want, than I'll uncomment the code I already have: https://github.com/SassDoc/generator-sassdoc-theme/blob/develop/generators/app/index.js#L16-L23

This would then be used as follow:

$ yo sassdoc-theme --themePath=child/dir
Member

pascalduez commented Sep 4, 2014

The default and common behavior for generators is to work from inside the destination directory:
https://github.com/SassDoc/generator-sassdoc-theme/blob/develop/README.md#usage
So you basically have to mkdir your theme folder before running the generator.

So I wouldn't make it a prompt and then trying to chdir in it.

The way to do it in Yeoman is to use the dest property.

If being able to pass a different dir is really something that you want, than I'll uncomment the code I already have: https://github.com/SassDoc/generator-sassdoc-theme/blob/develop/generators/app/index.js#L16-L23

This would then be used as follow:

$ yo sassdoc-theme --themePath=child/dir
@HugoGiraudel

This comment has been minimized.

Show comment
Hide comment
@HugoGiraudel

HugoGiraudel Sep 4, 2014

Member

Let's keep it simple for now.

Member

HugoGiraudel commented Sep 4, 2014

Let's keep it simple for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment