/** * Bud file for README.md */ 'use strict' const apeTmpl = require('ape-tmpl') const path = require('path') const childProcess = require('child_process') const pkg = require('./package.json') module.exports = apeTmpl.readmeMdBud({ pkg: pkg, repo: pkg.repository, sections: 'doc/guides/*.md.hbs', badges: { travis: true, npm: true, standard: true }, links: require('./doc/links.json'), overview: 'doc/overview.md', vars: { examplesUrl: 'https://github.com/fur-labo/fur-examples', get examples () { let BASE_URL = 'https://github.com/fur-labo/fur-examples/raw/master/example/' let banners = [], favicons = [] let examples = require('fur-examples') Object.keys(examples).forEach((key) => { let example = examples[ key ], banner = example[ '$banner' ], favicon = example[ '$favicon' ] if (banner) { banners.push({ img: BASE_URL + key + '/banner.png', options: banner }) } if (favicon) { favicons.push({ img: BASE_URL + key + '/favicon.png', options: favicon }) } }) return { banners: banners, favicons: favicons } }, get usages () { let furBin = require.resolve('./bin/fur') return { get all () { let command = [ furBin, '-h' ].join(' ') return childProcess.execSync(command) }, get banner () { let command = [ furBin, 'banner', '-h' ].join(' ') return childProcess.execSync(command) }, get favicon () { let command = [ furBin, 'favicon', '-h' ].join(' ') return childProcess.execSync(command) } } } } }) if (!module.parent) { require('coz').render(__filename) }