Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make a Yeoman generator #185

Closed
11 of 12 tasks
KittyGiraudel opened this issue Aug 24, 2014 · 13 comments
Closed
11 of 12 tasks

Make a Yeoman generator #185

KittyGiraudel opened this issue Aug 24, 2014 · 13 comments
Assignees
Labels
Milestone

Comments

@KittyGiraudel
Copy link
Member

  • 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
Copy link
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

@pascalduez
Copy link
Member

@KittyGiraudel
Copy link
Member Author

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.?

@KittyGiraudel
Copy link
Member Author

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
Copy link
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.

@pascalduez
Copy link
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 ?

@KittyGiraudel
Copy link
Member Author

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
Copy link
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)

@KittyGiraudel
Copy link
Member Author

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
Copy link
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).

@KittyGiraudel
Copy link
Member Author

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
Copy link
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

@KittyGiraudel
Copy link
Member Author

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
Labels
Development

No branches or pull requests

2 participants