Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jonschlinkert opened this issue Sep 24, 2018 · 3 comments
Open

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

jonschlinkert opened this issue Sep 24, 2018 · 3 comments

Comments

@jonschlinkert
Copy link
Member

Example

Related

Name Description Downloads
micromatch Highly optimized wildcard and glob matching library. NPM monthly downloads
@tunnckoCore
Copy link
Contributor

Yeaa! Make sense :P

@tunnckoCore
Copy link
Contributor

Hm. Where to start with that?

@jonschlinkert
Copy link
Member Author

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants