Open jwtd opened 9 years ago
At this time, I can say, that:
{%= contrib('authors') %}
gives the same code as @jwtd described.{%= author %}
works fine, assuming, that in my package.json
exists property author
(singular, not authors): "author": "Andrii Lundiak", "license": "ISC",
{%= author %}
in .verb.md
, but different code in package.json
:"author": {
"name": "Andrii Lundiak",
"url": "https://github.com/alundiak"
}
My readme.md file regenarated, but with content:
## Author
[object Object]
include
code (suggested by someone time ago):{%= include("author") %}
I have error in console, and readme not re-generated.
Running "verb:readme" (verb) task TypeError: Cannot read property 'replace' of null Cannot find "username" on the context. TypeError: Cannot read property 'split' of undefined Warning: username is not defined Use --force to continue.
Here is my config:
verb: {
readme: {
files: [
{src: ['assets/docs/.verb.md'], dest: 'dist/docs/README_by_verb.md'}
]
}
},
So, regarding initial issue description by @jwtd - it's fixed/implemented, and issue can be closed.
But regarding include
I'am not sure. I guess, it's expected function, and you @jonschlinkert have not implemented such. Right?
The default .verbrc template contains a reference to contrib("authors").
This appears to resolve to https://github.com/verbose/verb-contrib-templates/templates/authors.md which in turn loads jon.md and brian.md...
As a result, every default README.md file generated contains:
For general use, it would make more sense to load authors and contributors from the module's package.json.