verb-generate-readme
verb-generate-readme copied to clipboard
feature: option to format related list as a table
Example
Related
| Name | Description | Downloads |
|---|---|---|
| micromatch | Highly optimized wildcard and glob matching library. |
Yeaa! Make sense :P
Hm. Where to start with that?
Just so you can see how this works, try adding the following to package.json:
"verb": {
"layout": "default",
"tasks": ["readme"],
"templates": {
"includes": {
"related-list": "TEMPLATE HERE"
}
}
}
This is the default template used by the include helper to generate the related list:
{% if (verb.related && verb.related.list && verb.related.list.length) { %}
{%= verb.related.description || "You might also be interested in these projects:" %}
{%= related(verb.related.list) %}
{% } %}
You can create a custom template and use that where it says TEMPLATE HERE in the first code example. However, you'll also need to get the data for the template to render the list. This is the kind of thing that I want to simplify in the next release.