verb-generate-readme icon indicating copy to clipboard operation
verb-generate-readme copied to clipboard

feature: option to format related list as a table

Open jonschlinkert opened this issue 7 years ago • 3 comments

Example

Related

Name Description Downloads
micromatch Highly optimized wildcard and glob matching library. NPM monthly downloads

jonschlinkert avatar Sep 24 '18 03:09 jonschlinkert

Yeaa! Make sense :P

tunnckoCore avatar Sep 24 '18 06:09 tunnckoCore

Hm. Where to start with that?

tunnckoCore avatar Oct 31 '18 23:10 tunnckoCore

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.

jonschlinkert avatar Nov 01 '18 00:11 jonschlinkert