UNPKG

verb

Version:

Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used on hundreds of projects of all sizes to generate everything from API docs to readmes.

23 lines (18 loc) 439 B
'use strict'; var parse = require('parse-github-url'); /** * Called in the `init` transform. Adds a `github` * property to the context. * * @param {Object} `verb` */ module.exports = function(verb) { var repo = verb.get('data.repository'); var url = (repo && typeof repo === 'object') ? repo.url : repo; var github = parse(url); if (github && Object.keys(github).length) { verb.data({github: github}); } };