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

allow generator options from global verb config #2

Open
tunnckoCore opened this issue Feb 20, 2016 · 7 comments
Open

allow generator options from global verb config #2

tunnckoCore opened this issue Feb 20, 2016 · 7 comments

Comments

@tunnckoCore
Copy link
Contributor

I'm thinking for global generators options, so it can't be simple templates property in ~/data-store/verb.json config, because verb may need more than one generator, so it could be something like that

{
  "generators": {
    "readme": {
      "templates": "layouts/*.md",
      "includes": "includes",
      "badges": "badges"
    }
  }
}

or full paths/globs to dirs

for this generator

@jonschlinkert
Copy link
Member

do you want to store config values that will be used for all generators, or different values for each generator?

we should be able to do either, or both. I'm still working on questions/data/config atm

@tunnckoCore
Copy link
Contributor Author

Yea, I think for each generator would be better in long term. We don't know what users would create, it is real scenario to have more than generator. Currently I don't need, but at least it's in mind to have more than one.

@phun-ky
Copy link

phun-ky commented Mar 26, 2016

TBH, I liked the old version of verb for this better, where somethings came predefined with verb, so you could just include "license" or "copyright" or "changelog" yourself..

Is this still as easliy done now like before? Where is the docs for that?

@tunnckoCore
Copy link
Contributor Author

@phun-ky architecture is totally changed. Providing "templates" things and paths is in process (i think) in base-runner - i'm just reviewing newest things there. So soon verb-readme-generator would be able to get templates from different paths instead of the defaults in this repo. But before that this issue should be solve also the global store logic.

Docs can be found mostly in all of the @node-base org repos, also the generate repo from @generate org, plus in the absolutely core is jonschlinkert/templates and few of the @assemble repos used in http://npm.im/assemble-core.

It's a big trip. But you can start from generate/generate (there have docs folder) and the docs folder from jonschlinkert/templates. Actually I think the easiest way is to follow the deps, I do it this way most of the time, but I'm big follower of @jonschlinkert and know most of his libs, repos and projects - I'm very familiar with his job in last 1-2 year(s).

If you want to play and try, you can fork this repo and create you generator, then instead of tasks:readme set tasks:foobar if your generator is verb-foobar-generator (i think? i'm not sure, how they are resolved exactly).

But at all, you can pretty easily modify this generator to load templates from different folders by default and fallback to these here in the repo - I did it locally before few weeks.

@phun-ky
Copy link

phun-ky commented Mar 26, 2016

overload

Well, I will try to fiddle around with this, but I will not make promises :P

But a tip or doc on how to produce custom layouts would be nice, or if you could try to make a default layout for private npm packages, that would be of great help.

and how exactly, in the default layout, is the twitter and github links generated?

EDIT: found the generation for the twitter and github links

@jonschlinkert
Copy link
Member

TBH, I liked the old version of verb for this better, where somethings came predefined with verb, so you could just include "license" or "copyright" or "changelog" yourself..

agreed

Is this still as easliy done now like before?

before releasing 0.9.0 these things will be easier to add. keep the feedback coming

Where is the docs for that?

working on it now

@jonschlinkert
Copy link
Member

overload

yeah, we'll be publishing a single documentation resource for verb.

But a tip or doc on how to produce custom layouts would be nice, or if you could try to make a default layout for private npm packages, that would be of great help.

I believe the following is implemented: add a custom layout to a local file. Then in package.json:

{
  "verb": {
    "templates": {
      "layout": {
        "path": "my-layout.md"
      }
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants