verbose / verb-generate-readme

Generate your project's readme with verb. Requires verb v0.9.0 or higher.
MIT License
162 stars 13 forks source link

allow generator options from global verb config #2

Open tunnckoCore opened 8 years ago

tunnckoCore commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

@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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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"
      }
    }
  }
}