Skip to content

feature: option to format related list as a table #26

@jonschlinkert

Description

@jonschlinkert
Member

Example

Related

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

Activity

tunnckoCore

tunnckoCore commented on Sep 24, 2018

@tunnckoCore
Contributor

Yeaa! Make sense :P

tunnckoCore

tunnckoCore commented on Oct 31, 2018

@tunnckoCore
Contributor

Hm. Where to start with that?

jonschlinkert

jonschlinkert commented on Nov 1, 2018

@jonschlinkert
MemberAuthor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jonschlinkert@tunnckoCore

        Issue actions

          feature: option to format related list as a table · Issue #26 · verbose/verb-generate-readme