Add scripts to generate the docs for lodash/fp.

This commit is contained in:
Jeroen Engels
2016-01-29 00:09:27 +01:00
committed by John-David Dalton
parent fbfa578c11
commit 66d6e226a9
3 changed files with 133 additions and 2 deletions

View File

@@ -5,6 +5,9 @@ var _ = require('lodash'),
fs = require('fs-extra'),
path = require('path');
var mapping = require('../../fp/_mapping'),
applyFPMapping = require('./apply-fp-mapping');
var basePath = path.join(__dirname, '..', '..'),
docPath = path.join(basePath, 'doc'),
readmePath = path.join(docPath, 'README.md'),
@@ -46,7 +49,10 @@ function onComplete(error) {
}
}
function build(type) {
function build(fpFlag, type) {
if (fpFlag) {
applyFPMapping(mapping);
}
var options = _.defaults({}, config.base, config[type]),
markdown = docdown(options),
filePath = fpFlag ? fpReadmePath : readmePath;
@@ -54,4 +60,4 @@ function build(type) {
fs.writeFile(filePath, postprocess(markdown), onComplete);
}
build(_.last(process.argv));
build(_.includes(process.argv, '--fp'), _.last(process.argv));